Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/applet/psePlasmoid/Molmasscalculator.cpp
Context not available. | |||||
32 | 32 | | |||
---|---|---|---|---|---|
33 | // Plasma | 33 | // Plasma | ||
34 | #include <plasma/theme.h> | 34 | #include <plasma/theme.h> | ||
35 | #include <KConfigGroup> | ||||
36 | #include <QDialogButtonBox> | ||||
37 | #include <QPushButton> | ||||
38 | #include <QVBoxLayout> | ||||
35 | 39 | | |||
36 | // local | 40 | // local | ||
37 | 41 | | |||
Context not available. | |||||
53 | m_triggerTimer->setSingleShot(true); | 57 | m_triggerTimer->setSingleShot(true); | ||
54 | m_triggerTimer->setInterval(700); | 58 | m_triggerTimer->setInterval(700); | ||
55 | 59 | | |||
56 | connect(m_triggerTimer, SIGNAL(timeout()), this, SLOT(ParseMolecule())); | 60 | connect(m_triggerTimer, &QTimer::timeout, this, &Molmasscalculator::ParseMolecule); | ||
57 | 61 | | |||
58 | // Needed for the Popupapplet | 62 | // Needed for the Popupapplet | ||
59 | setPopupIcon("kalzium"); | 63 | setPopupIcon("kalzium"); | ||
Context not available. | |||||
160 | m_lineedit->setClearButtonEnabled(true); | 164 | m_lineedit->setClearButtonEnabled(true); | ||
161 | m_lineedit->setMinimumWidth(100); | 165 | m_lineedit->setMinimumWidth(100); | ||
162 | m_lineedit->setText(i18n("C2H5OH")); | 166 | m_lineedit->setText(i18n("C2H5OH")); | ||
163 | connect(m_lineedit, SIGNAL(textEdited(QString)), m_triggerTimer, SLOT(start())); | 167 | connect(m_lineedit, &Plasma::LineEdit::textEdited, m_triggerTimer, &QTimer::start); | ||
164 | 168 | | |||
165 | m_switchButton = new Plasma::IconWidget(); | 169 | m_switchButton = new Plasma::IconWidget(); | ||
166 | connect(m_switchButton, SIGNAL(clicked()), this, SLOT(toggleTable())); | 170 | connect(m_switchButton, &Plasma::IconWidget::clicked, this, &graphicsWidget::toggleTable); | ||
167 | 171 | | |||
168 | TopLayout->addItem(MoleculeLabel); | 172 | TopLayout->addItem(MoleculeLabel); | ||
169 | TopLayout->addItem(m_lineedit); | 173 | TopLayout->addItem(m_lineedit); | ||
Context not available. | |||||
217 | 221 | | |||
218 | void Molmasscalculator::createConfigurationInterface(KConfigDialog* parent) | 222 | void Molmasscalculator::createConfigurationInterface(KConfigDialog* parent) | ||
219 | { | 223 | { | ||
220 | parent->setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply); | 224 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); | ||
225 | QWidget *mainWidget = new QWidget(this); | ||||
226 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||||
227 | parent->setLayout(mainLayout); | ||||
228 | mainLayout->addWidget(mainWidget); | ||||
229 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||||
230 | okButton->setDefault(true); | ||||
231 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||||
232 | parent->connect(buttonBox, &QDialogButtonBox::accepted, this, &createConfigurationInterface::accept); | ||||
233 | parent->connect(buttonBox, &QDialogButtonBox::rejected, this, &createConfigurationInterface::reject); | ||||
234 | mainLayout->addWidget(buttonBox); | ||||
221 | 235 | | |||
222 | QWidget *widget = new QWidget(parent); | 236 | QWidget *widget = new QWidget(parent); | ||
223 | 237 | | |||
Context not available. | |||||
234 | 248 | | |||
235 | m_ui.tabletyp->setCurrentIndex(m_PeriodWidget->getCurrentPseTyp()); | 249 | m_ui.tabletyp->setCurrentIndex(m_PeriodWidget->getCurrentPseTyp()); | ||
236 | 250 | | |||
237 | connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted())); | 251 | connect(parent->okButton, &QPushButton::clicked, | ||
238 | connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted())); | 252 | this, &Molmasscalculator::configAccepted); | ||
253 | connect(parent->buttonBox, &QDialogButtonBox::Apply::clicked, | ||||
254 | this, &Molmasscalculator::configAccepted); | ||||
239 | 255 | | |||
240 | connect(m_ui.showPeriodic, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); | 256 | connect(m_ui.showPeriodic, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); | ||
241 | connect(m_ui.copyToCliboard, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); | 257 | connect(m_ui.copyToCliboard, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); | ||
Context not available. |