Changeset View
Changeset View
Standalone View
Standalone View
src/configuredialog/configureappearancepage.cpp
Show First 20 Lines • Show All 870 Lines • ▼ Show 20 Line(s) | 845 | { | |||
---|---|---|---|---|---|
871 | QGroupBox *systrayBox = new QGroupBox(i18n("System Tray"), this); | 871 | QGroupBox *systrayBox = new QGroupBox(i18n("System Tray"), this); | ||
872 | topLayout->addWidget(systrayBox); | 872 | topLayout->addWidget(systrayBox); | ||
873 | 873 | | |||
874 | QVBoxLayout *systrayBoxlayout = new QVBoxLayout(systrayBox); | 874 | QVBoxLayout *systrayBoxlayout = new QVBoxLayout(systrayBox); | ||
875 | 875 | | |||
876 | // "Enable system tray applet" check box | 876 | // "Enable system tray applet" check box | ||
877 | mSystemTrayCheck = new QCheckBox(i18n("Enable system tray icon"), this); | 877 | mSystemTrayCheck = new QCheckBox(i18n("Enable system tray icon"), this); | ||
878 | systrayBoxlayout->addWidget(mSystemTrayCheck); | 878 | systrayBoxlayout->addWidget(mSystemTrayCheck); | ||
879 | connect(mSystemTrayCheck, &QCheckBox::stateChanged, | 879 | | ||
880 | this, &ConfigModuleTab::slotEmitChanged); | 880 | // "Enable start in system tray" check box | ||
881 | mStartInTrayCheck = new QCheckBox(i18n("Start minimized to tray")); | ||||
882 | systrayBoxlayout->addWidget(mStartInTrayCheck); | ||||
883 | | ||||
884 | // Dependencies between the two checkboxes | ||||
885 | connect(mStartInTrayCheck, &QCheckBox::stateChanged, this, [this](int state) { | ||||
886 | if (state == Qt::Checked) | ||||
887 | mSystemTrayCheck->setCheckState(Qt::Checked); | ||||
mlaurent: "this->" is necessary ? | |||||
888 | slotEmitChanged(); | ||||
889 | }); | ||||
890 | connect(mSystemTrayCheck, &QCheckBox::stateChanged, this, [this](int state) { | ||||
891 | if(state == Qt::Unchecked) | ||||
892 | mStartInTrayCheck->setCheckState(Qt::Unchecked); | ||||
893 | slotEmitChanged(); | ||||
894 | }); | ||||
881 | 895 | | |||
882 | // "Enable system tray applet" check box | 896 | // "Enable system tray applet" check box | ||
883 | mShowNumberInTaskBar = new QCheckBox(i18n("Show unread email in Taskbar"), this); | 897 | mShowNumberInTaskBar = new QCheckBox(i18n("Show unread email in Taskbar"), this); | ||
884 | systrayBoxlayout->addWidget(mShowNumberInTaskBar); | 898 | systrayBoxlayout->addWidget(mShowNumberInTaskBar); | ||
885 | connect(mShowNumberInTaskBar, &QCheckBox::stateChanged, | 899 | connect(mShowNumberInTaskBar, &QCheckBox::stateChanged, | ||
886 | this, &ConfigModuleTab::slotEmitChanged); | 900 | this, &ConfigModuleTab::slotEmitChanged); | ||
887 | 901 | | |||
888 | topLayout->addStretch(100); // spacer | 902 | topLayout->addStretch(100); // spacer | ||
889 | } | 903 | } | ||
Please merge two signal : this, &ConfigModuleTab::slotEmitChanged); and this one in one slot. mlaurent: Please merge two signal :
connect(mStartInTrayCheck, &QCheckBox::stateChanged,
this… | |||||
890 | 904 | | |||
891 | void AppearancePage::ReaderTab::doResetToDefaultsOther() | 905 | void AppearancePage::ReaderTab::doResetToDefaultsOther() | ||
892 | { | 906 | { | ||
893 | mGravatarConfigWidget->doResetToDefaultsOther(); | 907 | mGravatarConfigWidget->doResetToDefaultsOther(); | ||
mlaurent: same | |||||
894 | } | 908 | } | ||
895 | 909 | | |||
896 | void AppearancePage::ReaderTab::doLoadOther() | 910 | void AppearancePage::ReaderTab::doLoadOther() | ||
897 | { | 911 | { | ||
898 | loadWidget(mSystemTrayCheck, KMailSettings::self()->systemTrayEnabledItem()); | 912 | loadWidget(mSystemTrayCheck, KMailSettings::self()->systemTrayEnabledItem()); | ||
913 | loadWidget(mStartInTrayCheck, KMailSettings::self()->startInTrayItem()); | ||||
899 | loadWidget(mShowNumberInTaskBar, KMailSettings::self()->showUnreadInTaskbarItem()); | 914 | loadWidget(mShowNumberInTaskBar, KMailSettings::self()->showUnreadInTaskbarItem()); | ||
900 | loadWidget(mCloseAfterReplyOrForwardCheck, MessageViewer::MessageViewerSettings::self()->closeAfterReplyOrForwardItem()); | 915 | loadWidget(mCloseAfterReplyOrForwardCheck, MessageViewer::MessageViewerSettings::self()->closeAfterReplyOrForwardItem()); | ||
901 | mViewerSettings->readConfig(); | 916 | mViewerSettings->readConfig(); | ||
902 | mGravatarConfigWidget->doLoadFromGlobalSettings(); | 917 | mGravatarConfigWidget->doLoadFromGlobalSettings(); | ||
903 | } | 918 | } | ||
904 | 919 | | |||
905 | void AppearancePage::ReaderTab::save() | 920 | void AppearancePage::ReaderTab::save() | ||
906 | { | 921 | { | ||
907 | saveCheckBox(mSystemTrayCheck, KMailSettings::self()->systemTrayEnabledItem()); | 922 | saveCheckBox(mSystemTrayCheck, KMailSettings::self()->systemTrayEnabledItem()); | ||
923 | saveCheckBox(mStartInTrayCheck, KMailSettings::self()->startInTrayItem()); | ||||
908 | saveCheckBox(mShowNumberInTaskBar, KMailSettings::self()->showUnreadInTaskbarItem()); | 924 | saveCheckBox(mShowNumberInTaskBar, KMailSettings::self()->showUnreadInTaskbarItem()); | ||
909 | KMailSettings::self()->save(); | 925 | KMailSettings::self()->save(); | ||
910 | saveCheckBox(mCloseAfterReplyOrForwardCheck, MessageViewer::MessageViewerSettings::self()->closeAfterReplyOrForwardItem()); | 926 | saveCheckBox(mCloseAfterReplyOrForwardCheck, MessageViewer::MessageViewerSettings::self()->closeAfterReplyOrForwardItem()); | ||
911 | mViewerSettings->writeConfig(); | 927 | mViewerSettings->writeConfig(); | ||
912 | mGravatarConfigWidget->save(); | 928 | mGravatarConfigWidget->save(); | ||
913 | } | 929 | } | ||
914 | 930 | | |||
915 | QString AppearancePage::MessageTagTab::helpAnchor() const | 931 | QString AppearancePage::MessageTagTab::helpAnchor() const | ||
▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines |
"this->" is necessary ?