Changeset View
Changeset View
Standalone View
Standalone View
src/kjotswidget.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
72 | #include <KMessageBox> | 72 | #include <KMessageBox> | ||
73 | #include <KReplaceDialog> | 73 | #include <KReplaceDialog> | ||
74 | #include <KSelectionProxyModel> | 74 | #include <KSelectionProxyModel> | ||
75 | #include <KXMLGUIClient> | 75 | #include <KXMLGUIClient> | ||
76 | #include <KActionMenu> | 76 | #include <KActionMenu> | ||
77 | #include <KRandom> | 77 | #include <KRandom> | ||
78 | #include <KSharedConfig> | 78 | #include <KSharedConfig> | ||
79 | #include <KRun> | 79 | #include <KRun> | ||
80 | #include <KConfigDialog> | ||||
80 | 81 | | |||
81 | // KMime | 82 | // KMime | ||
82 | #include <KMime/Message> | 83 | #include <KMime/Message> | ||
83 | 84 | | |||
84 | // KJots | 85 | // KJots | ||
85 | #include "kjotsbookmarks.h" | 86 | #include "kjotsbookmarks.h" | ||
86 | #include "kjotssortproxymodel.h" | 87 | #include "kjotssortproxymodel.h" | ||
87 | #include "kjotsmodel.h" | 88 | #include "kjotsmodel.h" | ||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Line(s) | 544 | } else { | |||
553 | } | 554 | } | ||
554 | editor->setActionsEnabled(true); | 555 | editor->setActionsEnabled(true); | ||
555 | } | 556 | } | ||
556 | } | 557 | } | ||
557 | } | 558 | } | ||
558 | 559 | | |||
559 | void KJotsWidget::configure() | 560 | void KJotsWidget::configure() | ||
560 | { | 561 | { | ||
561 | // create a new preferences dialog... | 562 | if (KConfigDialog::showDialog(QStringLiteral("kjotssettings"))) { | ||
562 | auto *dialog = new KJotsConfigDlg(i18n("Settings"), this); | 563 | return; | ||
563 | connect(dialog, qOverload<>(&KJotsConfigDlg::configCommitted), this, &KJotsWidget::updateConfiguration); | 564 | } | ||
565 | auto* dialog = new KConfigDialog(this, QStringLiteral("kjotssettings"), KJotsSettings::self()); | ||||
566 | dialog->addPage(new KJotsConfigMisc(dialog), i18nc("@title:window config dialog page", "Misc"), QStringLiteral("preferences-other")); | ||||
567 | connect(dialog, &KConfigDialog::settingsChanged, this, &KJotsWidget::updateConfiguration); | ||||
564 | dialog->show(); | 568 | dialog->show(); | ||
565 | } | 569 | } | ||
566 | 570 | | |||
567 | void KJotsWidget::updateConfiguration() | 571 | void KJotsWidget::updateConfiguration() | ||
568 | { | 572 | { | ||
569 | if (KJotsSettings::autoSave()) { | 573 | if (KJotsSettings::autoSave()) { | ||
570 | m_autosaveTimer->setInterval(KJotsSettings::autoSaveInterval() * 1000 * 60); | 574 | m_autosaveTimer->setInterval(KJotsSettings::autoSaveInterval() * 1000 * 60); | ||
571 | m_autosaveTimer->start(); | 575 | m_autosaveTimer->start(); | ||
▲ Show 20 Lines • Show All 691 Lines • Show Last 20 Lines |