File indexing completed on 2024-12-22 04:40:07
0001 /* 0002 SPDX-FileCopyrightText: 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar> 0003 SPDX-FileCopyrightText: 2010-2022 Mladen Milinkovic <max@smoothware.net> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #include "smarttextsadjustdialog.h" 0009 0010 #include <QLabel> 0011 #include <QGroupBox> 0012 #include <QGridLayout> 0013 #include <QSpinBox> 0014 0015 using namespace SubtitleComposer; 0016 0017 SmartTextsAdjustDialog::SmartTextsAdjustDialog(unsigned minLengthForLineBreak, QWidget *parent) : 0018 ActionWithTargetDialog(i18n("Break Lines"), parent) 0019 { 0020 QGroupBox *settingsGroupBox = createGroupBox(i18nc("@title:group", "Settings")); 0021 0022 m_minLengthForLineBreakSpinBox = new QSpinBox(settingsGroupBox); 0023 m_minLengthForLineBreakSpinBox->setMinimum(0); 0024 m_minLengthForLineBreakSpinBox->setMaximum(1000); 0025 m_minLengthForLineBreakSpinBox->setValue(minLengthForLineBreak); 0026 m_minLengthForLineBreakSpinBox->setSuffix(i18n(" characters")); 0027 0028 QLabel *minLengthForLineBreakLabel = new QLabel(settingsGroupBox); 0029 minLengthForLineBreakLabel->setText(i18n("Minimum length for line break:")); 0030 minLengthForLineBreakLabel->setBuddy(m_minLengthForLineBreakSpinBox); 0031 0032 createLineTargetsButtonGroup(); 0033 createTextTargetsButtonGroup(); 0034 0035 QGridLayout *settingsLayout = createLayout(settingsGroupBox); 0036 settingsLayout->addWidget(minLengthForLineBreakLabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter); 0037 settingsLayout->addWidget(m_minLengthForLineBreakSpinBox, 0, 1); 0038 } 0039 0040 unsigned 0041 SmartTextsAdjustDialog::minLengthForLineBreak() const 0042 { 0043 return m_minLengthForLineBreakSpinBox->value(); 0044 }