diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-04-10 16:55:58 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-04-10 16:55:58 -0500 |
commit | 137c3446f89fe808518981f974714161f794b364 (patch) | |
tree | c2510cece63d90384375b1daf0b708fb7b23169e /kcontrol | |
parent | 4dc80faf840ee48bd4c0b8d5338a5274de013c39 (diff) | |
download | tdebase-137c3446f89fe808518981f974714161f794b364.tar.gz tdebase-137c3446f89fe808518981f974714161f794b364.zip |
Overhaul taskbar configuration system
This resolves Bug 1399
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.cpp | 58 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.h | 3 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbarui.ui | 82 |
3 files changed, 104 insertions, 39 deletions
diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index be897883f..f05e78822 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -23,6 +23,7 @@ #include <tqvaluelist.h> #include <tqfile.h> #include <tqlabel.h> +#include <tqbuttongroup.h> #include <dcopclient.h> @@ -162,15 +163,15 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL if (args.count() > 0) { m_configFileName = args[0]; - m_widget->globalConfigWarning->hide(); - m_widget->globalConfigReload->show(); + m_isGlobalConfig = false; } else { - m_widget->globalConfigReload->hide(); - m_widget->globalConfigWarning->show(); + m_isGlobalConfig = true; } connect(m_widget->globalConfigReload, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReloadConfigurationFromGlobals())); + connect(m_widget->globalConfigEdit, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditGlobalConfiguration())); + connect(m_widget->kcfg_UseGlobalSettings, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts())); TQFile configFile(locateLocal("config", m_configFileName)); if (!configFile.exists()) @@ -248,6 +249,8 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL setAboutData(about); load(); + processLockouts(); + TQTimer::singleShot(0, this, TQT_SLOT(notChanged())); } @@ -259,6 +262,42 @@ TaskbarConfig::~TaskbarConfig() } } +void TaskbarConfig::slotEditGlobalConfiguration() { + TQByteArray data; + kapp->dcopClient()->send("kicker", "kicker", "reshowTaskBarConfig()", data); +} + +void TaskbarConfig::processLockouts() +{ + m_configFileName = GLOBAL_TASKBAR_CONFIG_FILE_NAME; + if (m_isGlobalConfig) + { + m_widget->globalConfigWarning->show(); + m_widget->globalConfigReload->hide(); + m_widget->globalConfigEdit->hide(); + m_widget->kcfg_UseGlobalSettings->hide(); + } + else { + m_widget->globalConfigWarning->hide(); + m_widget->kcfg_UseGlobalSettings->show(); + if (m_widget->kcfg_UseGlobalSettings->isChecked()) { + m_widget->taskbarGroup->hide(); + m_widget->actionsGroup->hide(); + m_widget->globalConfigReload->hide(); + m_widget->globalConfigEdit->hide(); + } + else { + m_widget->taskbarGroup->show(); + m_widget->actionsGroup->show(); + // FIXME + // Disable this feature until a method can be found to force the TDECModule to reload its settings from disk after the global settings have been copied! + //m_widget->globalConfigReload->show(); + m_widget->globalConfigReload->hide(); + m_widget->globalConfigEdit->show(); + } + } +} + void TaskbarConfig::slotReloadConfigurationFromGlobals() { TDEConfig globalConfig(GLOBAL_TASKBAR_CONFIG_FILE_NAME, TRUE, TRUE); @@ -267,16 +306,17 @@ void TaskbarConfig::slotReloadConfigurationFromGlobals() localConfig.sync(); m_settingsObject->readConfig(); load(); + m_widget->kcfg_UseGlobalSettings->setChecked(false); } void TaskbarConfig::slotUpdateCustomColors() { m_widget->kcfg_ActiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); m_widget->activeTaskTextColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); - + m_widget->kcfg_InactiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); m_widget->inactiveTaskTextColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); - + m_widget->kcfg_TaskBackgroundColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); m_widget->taskBackgroundColorLabel->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); } @@ -320,7 +360,7 @@ void TaskbarConfig::updateAppearanceCombo() return; } - if (m_widget->appearance->count() == m_appearances.count()) + if (m_widget->appearance->count() == (int)m_appearances.count()) { m_widget->appearance->insertItem(i18n("Custom")); } @@ -330,7 +370,7 @@ void TaskbarConfig::updateAppearanceCombo() void TaskbarConfig::appearanceChanged(int selected) { - if (selected < m_appearances.count()) + if (selected < (int)m_appearances.count()) { unmanagedWidgetChangeState(!m_appearances[selected].matchesSettings()); } @@ -348,7 +388,7 @@ void TaskbarConfig::save() { m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); int selectedAppearance = m_widget->appearance->currentItem(); - if (selectedAppearance < m_appearances.count()) + if (selectedAppearance < (int)m_appearances.count()) { m_appearances[selectedAppearance].alterSettings(); m_settingsObject->writeConfig(); diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index 1f9a1e813..b0fe0c7ea 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -72,6 +72,8 @@ protected slots: private slots: void slotReloadConfigurationFromGlobals(); + void slotEditGlobalConfiguration(); + void processLockouts(); private: TaskbarAppearance::List m_appearances; @@ -85,6 +87,7 @@ private: TaskbarConfigUI *m_widget; TQString m_configFileName; TaskBarSettings* m_settingsObject; + bool m_isGlobalConfig; }; #endif diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index a522ef683..871badd75 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -24,6 +24,57 @@ <property name="margin"> <number>0</number> </property> + <widget class="TQGroupBox"> + <property name="name"> + <cstring>GroupBox2</cstring> + </property> + <property name="title"> + <string>Settings</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>globalConfigWarning</cstring> + </property> + <property name="text"> + <string><b>NOTE: This module is currently editing the global floating taskbar configuration.</b><br>To change the configuration of a specific Kicker taskbar applet, please use the corresponding Configure Taskbar menu option.</string> + </property> + </widget> + <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>kcfg_UseGlobalSettings</cstring> + </property> + <property name="text"> + <string>Use global floating taskbar configuration</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="whatsThis" stdset="0"> + <string>Selecting this option causes the taskbar to use the global taskbar configuration.</string> + </property> + </widget> + <widget class="TQPushButton" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>globalConfigReload</cstring> + </property> + <property name="text"> + <string>Overwrite current configuration with the current global floating taskbar configuration</string> + </property> + </widget> + <widget class="TQPushButton" row="2" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>globalConfigEdit</cstring> + </property> + <property name="text"> + <string>Edt global floating taskbar configuration</string> + </property> + </widget> + </grid> + </widget> <widget class="TQButtonGroup"> <property name="name"> <cstring>taskbarGroup</cstring> @@ -379,7 +430,7 @@ By default, this option is selected and all windows are shown.</string> </widget> <widget class="TQGroupBox"> <property name="name"> - <cstring>GroupBox1</cstring> + <cstring>actionsGroup</cstring> </property> <property name="title"> <string>Actions</string> @@ -462,35 +513,6 @@ By default, this option is selected and all windows are shown.</string> </widget> </grid> </widget> - <widget class="TQGroupBox"> - <property name="name"> - <cstring>GroupBox2</cstring> - </property> - <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"> <cstring>Spacer1</cstring> |