diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-17 14:34:51 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-17 14:34:51 -0600 |
commit | a0d0b876b6447c5be26a50a0b295e91cd95a8ceb (patch) | |
tree | d8d5ddf687d96525743613a38c280fb8b4cc4706 /kcontrol | |
parent | 18f6f27f9f340d56b12b8f7bc87ae410d595d1b1 (diff) | |
download | tdebase-a0d0b876b6447c5be26a50a0b295e91cd95a8ceb.tar.gz tdebase-a0d0b876b6447c5be26a50a0b295e91cd95a8ceb.zip |
Fix taskbar configuration issues
Fix Kicker menu button layout in Deep Buttons mode
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/kicker/menutab_impl.cpp | 33 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.cpp | 29 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.h | 3 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbarui.ui | 32 |
4 files changed, 85 insertions, 12 deletions
diff --git a/kcontrol/kicker/menutab_impl.cpp b/kcontrol/kicker/menutab_impl.cpp index 35ebdd6af..63adf48d5 100644 --- a/kcontrol/kicker/menutab_impl.cpp +++ b/kcontrol/kicker/menutab_impl.cpp @@ -36,6 +36,7 @@ #include <kmessagebox.h> #include <knuminput.h> #include <kstandarddirs.h> +#include <kfontrequester.h> #include <kicondialog.h> #include <kiconloader.h> @@ -198,6 +199,8 @@ void MenuTab::menuStyleChanged() void MenuTab::save() { + bool forceRestart = false; + KSharedConfig::Ptr c = KSharedConfig::openConfig(KickerConfig::the()->configName()); c->setGroup("menus"); @@ -226,19 +229,37 @@ void MenuTab::save() bool kmenusetting = m_comboMenuStyle->currentItem()==1; bool oldkmenusetting = c->readBoolEntry("LegacyKMenu", true); + c->setGroup("KMenu"); + bool oldmenutextenabledsetting = c->readBoolEntry("ShowText", true); + TQString oldmenutextsetting = c->readEntry("Text", ""); + + c->setGroup("buttons"); + TQFont oldmenufontsetting = c->readFontEntry("Font"); + c->writeEntry("LegacyKMenu", kmenusetting); c->writeEntry("OpenOnHover", m_openOnHover->isChecked()); c->sync(); - if (kmenusetting != oldkmenusetting) - DCOPRef ("kicker", "default").call("restart()"); + if (kmenusetting != oldkmenusetting) { + forceRestart = true; + } + if (kcfg_ShowKMenuText->isChecked() != oldmenutextenabledsetting) { + forceRestart = true; + } + if (kcfg_KMenuText->text() != oldmenutextsetting) { + forceRestart = true; + } + if (kcfg_ButtonFont->font() != oldmenufontsetting) { + forceRestart = true; + } c->setGroup("KMenu"); bool sidepixmapsetting = kcfg_UseSidePixmap->isChecked(); bool oldsidepixmapsetting = c->readBoolEntry("UseSidePixmap", true); - if (sidepixmapsetting != oldsidepixmapsetting) - DCOPRef ("kicker", "default").call("restart()"); + if (sidepixmapsetting != oldsidepixmapsetting) { + forceRestart = true; + } // Save KMenu settings c->setGroup("KMenu"); @@ -253,6 +274,10 @@ void MenuTab::save() config->sync(); if (m_kmenu_button_changed == true) { + forceRestart = true; + } + + if (forceRestart) { DCOPRef ("kicker", "default").call("restart()"); } } diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index 3a2436b24..00e0cd1f3 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -21,6 +21,8 @@ #include <tqlayout.h> #include <tqtimer.h> #include <tqvaluelist.h> +#include <tqfile.h> +#include <tqlabel.h> #include <dcopclient.h> @@ -31,7 +33,7 @@ #include <kgenericfactory.h> #include <twin.h> #include <kcolorbutton.h> -#include <tqlabel.h> +#include <kstandarddirs.h> #define protected public #include "kcmtaskbarui.h" @@ -161,7 +163,24 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL { m_configFileName = args[0]; m_widget->globalConfigWarning->hide(); + m_widget->globalConfigReload->show(); + } + else + { + m_widget->globalConfigReload->hide(); + m_widget->globalConfigWarning->show(); + } + connect(m_widget->globalConfigReload, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReloadConfigurationFromGlobals())); + + TQFile configFile(locateLocal("config", m_configFileName)); + if (!configFile.exists()) + { + KConfig globalConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME, TRUE, TRUE); + KConfig localConfig(m_configFileName); + globalConfig.copyTo(m_configFileName, &localConfig); + localConfig.sync(); } + m_settingsObject = new TaskBarSettings(KSharedConfig::openConfig(m_configFileName)); m_settingsObject->readConfig(); @@ -240,6 +259,14 @@ TaskbarConfig::~TaskbarConfig() } } +void TaskbarConfig::slotReloadConfigurationFromGlobals() +{ + KConfig globalConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME, TRUE, TRUE); + globalConfig.copyTo(m_configFileName); + m_settingsObject->readConfig(); + load(); +} + void TaskbarConfig::slotUpdateCustomColors() { m_widget->kcfg_ActiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index 5e7d9d905..9aaec9664 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -70,6 +70,9 @@ protected slots: void notChanged(); void slotUpdateCustomColors(); +private slots: + void slotReloadConfigurationFromGlobals(); + private: TaskbarAppearance::List m_appearances; void updateAppearanceCombo(); diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index ce0ddb6fe..a522ef683 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -462,16 +462,34 @@ By default, this option is selected and all windows are shown.</string> </widget> </grid> </widget> - <widget class="TQLabel" rowspan="1" colspan="2"> + <widget class="TQGroupBox"> <property name="name"> - <cstring>globalConfigWarning</cstring> + <cstring>GroupBox2</cstring> </property> - <property name="text"> - <string>NOTE: This module is currently editing the global floating taskbar configuration.<br>To change the configuration of a specific Kicker taskbar applet, please use the Configure Taskbar menu option.</string> - </property> - <property name="buddy" stdset="0"> - <cstring>kcfg_ShowTaskStates</cstring> + <property name="title"> + <string>Settings</string> </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" rowspan="1" colspan="2"> + <property name="name"> + <cstring>globalConfigWarning</cstring> + </property> + <property name="text"> + <string>NOTE: This module is currently editing the global floating taskbar configuration.<br>To change the configuration of a specific Kicker taskbar applet, please use the Configure Taskbar menu option.</string> + </property> + </widget> + <widget class="TQPushButton" rowspan="1" colspan="2"> + <property name="name"> + <cstring>globalConfigReload</cstring> + </property> + <property name="text"> + <string>Use current global floating taskbar configuration</string> + </property> + </widget> + </grid> </widget> <spacer> <property name="name"> |