Changeset View
Changeset View
Standalone View
Standalone View
shell/settings/uipreferences.cpp
Show All 34 Lines | |||||
35 | UiPreferences::UiPreferences(QWidget* parent) | 35 | UiPreferences::UiPreferences(QWidget* parent) | ||
36 | : ConfigPage(nullptr, UiConfig::self(), parent) | 36 | : ConfigPage(nullptr, UiConfig::self(), parent) | ||
37 | { | 37 | { | ||
38 | QVBoxLayout* l = new QVBoxLayout( this ); | 38 | QVBoxLayout* l = new QVBoxLayout( this ); | ||
39 | QWidget* w = new QWidget(parent); | 39 | QWidget* w = new QWidget(parent); | ||
40 | m_uiconfigUi = new Ui::UiConfig(); | 40 | m_uiconfigUi = new Ui::UiConfig(); | ||
41 | m_uiconfigUi->setupUi( w ); | 41 | m_uiconfigUi->setupUi( w ); | ||
42 | l->addWidget( w ); | 42 | l->addWidget( w ); | ||
43 | | ||||
44 | m_focusEditorOrHideDocks = UiConfig::self()->focusEditorOrHideDocks(); | ||||
45 | m_uiconfigUi->messageWidget->setText(i18n( | ||||
46 | "Changed setting \"Focus Editor or Hide Docks\"" | ||||
47 | "will be applied after KDevelop restart")); | ||||
48 | m_uiconfigUi->messageWidget->hide(); | ||||
49 | | ||||
50 | connect(this, &ConfigPage::changed, [this]() { | ||||
51 | qDebug() << "ConfigPage::changed()"; | ||||
52 | if (m_uiconfigUi->kcfg_FocusEditorOrHideDocks->isChecked() == m_focusEditorOrHideDocks) | ||||
53 | m_uiconfigUi->messageWidget->hide(); | ||||
54 | else | ||||
55 | m_uiconfigUi->messageWidget->show(); | ||||
56 | }); | ||||
43 | } | 57 | } | ||
44 | 58 | | |||
45 | UiPreferences::~UiPreferences() | 59 | UiPreferences::~UiPreferences() | ||
46 | { | 60 | { | ||
47 | delete m_uiconfigUi; | 61 | delete m_uiconfigUi; | ||
48 | } | 62 | } | ||
49 | 63 | | |||
50 | void UiPreferences::apply() | 64 | void UiPreferences::apply() | ||
51 | { | 65 | { | ||
52 | KDevelop::ConfigPage::apply(); | 66 | KDevelop::ConfigPage::apply(); | ||
53 | 67 | | |||
54 | UiController *uiController = Core::self()->uiControllerInternal(); | 68 | UiController *uiController = Core::self()->uiControllerInternal(); | ||
55 | foreach (Sublime::MainWindow *window, uiController->mainWindows()) | 69 | foreach (Sublime::MainWindow *window, uiController->mainWindows()) | ||
56 | (static_cast<KDevelop::MainWindow*>(window))->loadSettings(); | 70 | (static_cast<KDevelop::MainWindow*>(window))->loadSettings(); | ||
57 | uiController->loadSettings(); | 71 | uiController->loadSettings(); | ||
72 | | ||||
73 | m_uiconfigUi->messageWidget->hide(); | ||||
74 | m_focusEditorOrHideDocks = UiConfig::self()->focusEditorOrHideDocks(); | ||||
58 | } | 75 | } | ||
59 | 76 | | |||
60 | QString UiPreferences::name() const | 77 | QString UiPreferences::name() const | ||
61 | { | 78 | { | ||
62 | return i18n("User Interface"); | 79 | return i18n("User Interface"); | ||
63 | } | 80 | } | ||
64 | 81 | | |||
65 | QIcon UiPreferences::icon() const | 82 | QIcon UiPreferences::icon() const | ||
Show All 9 Lines |