Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/SettingsDialog/SettingsDialog.cpp
Show All 15 Lines | |||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "SettingsDialog.h" | 20 | #include "SettingsDialog.h" | ||
21 | 21 | | |||
22 | #include "GeneralOptionsPage.h" | 22 | #include "GeneralOptionsPage.h" | ||
23 | #include "SaveOptionsPage.h" | 23 | #include "SaveOptionsPage.h" | ||
24 | #include "ShortcutsOptionsPage.h" | ||||
24 | 25 | | |||
25 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
27 | #include <KShortcutWidget> | ||||
26 | 28 | | |||
27 | #include <QIcon> | 29 | #include <QIcon> | ||
28 | #include <QMessageBox> | 30 | #include <QMessageBox> | ||
29 | 31 | | |||
30 | SettingsDialog::SettingsDialog(QWidget *parent) : | 32 | SettingsDialog::SettingsDialog(QWidget *parent) : | ||
31 | KPageDialog(parent) | 33 | KPageDialog(parent) | ||
32 | { | 34 | { | ||
33 | // set up window options and geometry | 35 | // set up window options and geometry | ||
Show All 14 Lines | 45 | { | |||
48 | mPages.insert(generalOptions); | 50 | mPages.insert(generalOptions); | ||
49 | 51 | | |||
50 | KPageWidgetItem *saveOptions = new KPageWidgetItem(new SaveOptionsPage(this), i18n("Save")); | 52 | KPageWidgetItem *saveOptions = new KPageWidgetItem(new SaveOptionsPage(this), i18n("Save")); | ||
51 | saveOptions->setHeader(i18n("Save")); | 53 | saveOptions->setHeader(i18n("Save")); | ||
52 | saveOptions->setIcon(QIcon::fromTheme(QStringLiteral("document-save"))); | 54 | saveOptions->setIcon(QIcon::fromTheme(QStringLiteral("document-save"))); | ||
53 | addPage(saveOptions); | 55 | addPage(saveOptions); | ||
54 | mPages.insert(saveOptions); | 56 | mPages.insert(saveOptions); | ||
55 | 57 | | |||
58 | KPageWidgetItem *shortcutOptions = new KPageWidgetItem(new ShortcutsOptionsPage(this), i18n("Shortcuts")); | ||||
59 | shortcutOptions->setHeader(i18n("Shortcuts")); | ||||
60 | shortcutOptions->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-keyboard"))); | ||||
61 | addPage(shortcutOptions); | ||||
62 | mPages.insert(shortcutOptions); | ||||
63 | | ||||
56 | connect(this, &SettingsDialog::currentPageChanged, this, &SettingsDialog::onPageChanged); | 64 | connect(this, &SettingsDialog::currentPageChanged, this, &SettingsDialog::onPageChanged); | ||
57 | } | 65 | } | ||
58 | 66 | | |||
59 | void SettingsDialog::accept() | 67 | void SettingsDialog::accept() | ||
60 | { | 68 | { | ||
61 | Q_FOREACH(auto page, mPages) { | 69 | Q_FOREACH(auto page, mPages) { | ||
62 | SettingsPage *pageWidget = dynamic_cast<SettingsPage *>(page->widget()); | 70 | SettingsPage *pageWidget = dynamic_cast<SettingsPage *>(page->widget()); | ||
63 | if (pageWidget) { | 71 | if (pageWidget) { | ||
Show All 23 Lines |