diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-06 15:44:22 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-01-06 15:44:22 -0600 |
commit | 3642a26c369228341bc7abf55341eb1d6d4d6dfa (patch) | |
tree | 1ab102939f160e204c237f19af47e362ad31785b /kcontrol/taskbar | |
parent | 39c9f76c1b1bf4d2db41a217c301d1f260332697 (diff) | |
parent | ce3da132361e281919a222a519ff9901c8d6c3e1 (diff) | |
download | tdebase-3642a26c369228341bc7abf55341eb1d6d4d6dfa.tar.gz tdebase-3642a26c369228341bc7abf55341eb1d6d4d6dfa.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'kcontrol/taskbar')
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.cpp | 65 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.desktop | 2 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbar.h | 8 | ||||
-rw-r--r-- | kcontrol/taskbar/kcmtaskbarui.ui | 11 |
4 files changed, 66 insertions, 20 deletions
diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index cd1c67a1d..25f2c778d 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -36,44 +36,55 @@ #define protected public #include "kcmtaskbarui.h" #undef protected + #include "taskbarsettings.h" #include "kcmtaskbar.h" #include "kcmtaskbar.moc" +#define GLOBAL_TASKBAR_CONFIG_FILE_NAME "ktaskbarrc" + typedef KGenericFactory<TaskbarConfig, TQWidget > TaskBarFactory; K_EXPORT_COMPONENT_FACTORY (kcm_taskbar, TaskBarFactory("kcmtaskbar") ) TaskbarAppearance::TaskbarAppearance(TQString name, bool drawButtons, bool haloText, - bool showButtonOnHover) + bool showButtonOnHover, + TaskBarSettings* settingsObject) : m_name(name), m_drawButtons(drawButtons), m_haloText(haloText), - m_showButtonOnHover(showButtonOnHover) + m_showButtonOnHover(showButtonOnHover), + m_settingsObject(NULL) { + m_settingsObject = settingsObject; + if (m_settingsObject) + { + m_settingsObject->readConfig(); + } } TaskbarAppearance::TaskbarAppearance() : m_drawButtons(false), m_haloText(false), - m_showButtonOnHover(true) + m_showButtonOnHover(true), + m_settingsObject(NULL) { } bool TaskbarAppearance::matchesSettings() const { - return TaskBarSettings::drawButtons() == m_drawButtons && - TaskBarSettings::haloText() == m_haloText && - TaskBarSettings::showButtonOnHover() == m_showButtonOnHover; + return m_settingsObject->drawButtons() == m_drawButtons && + m_settingsObject->haloText() == m_haloText && + m_settingsObject->showButtonOnHover() == m_showButtonOnHover; } void TaskbarAppearance::alterSettings() const { - TaskBarSettings::self()->setDrawButtons(m_drawButtons); - TaskBarSettings::self()->setHaloText(m_haloText); - TaskBarSettings::self()->setShowButtonOnHover(m_showButtonOnHover); + m_settingsObject->setDrawButtons(m_drawButtons); + m_settingsObject->setHaloText(m_haloText); + m_settingsObject->setShowButtonOnHover(m_showButtonOnHover); } // These are the strings that are actually stored in the config file. @@ -137,17 +148,27 @@ TQStringList TaskbarConfig::i18nShowTaskStatesList() return i18nList; } -TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList&) - : KCModule(TaskBarFactory::instance(), parent, name) +TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList& args) + : KCModule(TaskBarFactory::instance(), parent, name), + m_settingsObject(NULL) { TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); m_widget = new TaskbarConfigUI(this); layout->addWidget(m_widget); + m_configFileName = GLOBAL_TASKBAR_CONFIG_FILE_NAME; + if (args.count() > 0) + { + m_configFileName = args[0]; + m_widget->globalConfigWarning->hide(); + } + m_settingsObject = new TaskBarSettings(KSharedConfig::openConfig(m_configFileName)); + m_settingsObject->readConfig(); + // TODO: Load these from .desktop files? - m_appearances.append(TaskbarAppearance(i18n("Elegant"), false, false, true)); - m_appearances.append(TaskbarAppearance(i18n("Classic"), true, false, true)); - m_appearances.append(TaskbarAppearance(i18n("For Transparency"), false, true, true)); + m_appearances.append(TaskbarAppearance(i18n("Elegant"), false, false, true, m_settingsObject)); + m_appearances.append(TaskbarAppearance(i18n("Classic"), true, false, true, m_settingsObject)); + m_appearances.append(TaskbarAppearance(i18n("For Transparency"), false, true, true, m_settingsObject)); for (TaskbarAppearance::List::const_iterator it = m_appearances.constBegin(); it != m_appearances.constEnd(); @@ -158,7 +179,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL connect(m_widget->appearance, TQT_SIGNAL(activated(int)), this, TQT_SLOT(appearanceChanged(int))); - addConfig(TaskBarSettings::self(), m_widget); + addConfig(m_settingsObject, m_widget); setQuickHelp(i18n("<h1>Taskbar</h1> You can configure the taskbar here." " This includes options such as whether or not the taskbar should show all" @@ -207,6 +228,14 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL TQTimer::singleShot(0, this, TQT_SLOT(notChanged())); } +TaskbarConfig::~TaskbarConfig() +{ + if (m_settingsObject) + { + delete m_settingsObject; + } +} + void TaskbarConfig::slotUpdateCustomColors() { m_widget->kcfg_ActiveTaskTextColor->setEnabled(m_widget->kcfg_UseCustomColors->isChecked()); @@ -279,17 +308,17 @@ void TaskbarConfig::load() KCModule::load(); slotUpdateComboBox(); updateAppearanceCombo(); - m_widget->showAllScreens->setChecked(!TaskBarSettings::self()->showCurrentScreenOnly()); + m_widget->showAllScreens->setChecked(!m_settingsObject->showCurrentScreenOnly()); } void TaskbarConfig::save() { - TaskBarSettings::self()->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); + m_settingsObject->setShowCurrentScreenOnly(!m_widget->showAllScreens->isChecked()); int selectedAppearance = m_widget->appearance->currentItem(); if (selectedAppearance < m_appearances.count()) { m_appearances[selectedAppearance].alterSettings(); - TaskBarSettings::self()->writeConfig(); + m_settingsObject->writeConfig(); } KCModule::save(); diff --git a/kcontrol/taskbar/kcmtaskbar.desktop b/kcontrol/taskbar/kcmtaskbar.desktop index fe5942dab..204b2e4ec 100644 --- a/kcontrol/taskbar/kcmtaskbar.desktop +++ b/kcontrol/taskbar/kcmtaskbar.desktop @@ -87,7 +87,7 @@ Name[zh_CN]=任务条 Name[zh_TW]=工作列 Name[zu]=Ibha yemisebenzi -Comment=Configure the panel taskbar +Comment=Configure the selected taskbar Comment[af]=Stel die paneel taakbalk op Comment[ar]=إعداد شريط المهام اللوح Comment[be]=Настаўленні панэлі заданняў diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index d41f5e6f0..5e7d9d905 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -24,6 +24,7 @@ #include <kcmodule.h> class TaskbarConfigUI; +class TaskBarSettings; class TaskbarAppearance { @@ -34,7 +35,8 @@ class TaskbarAppearance TaskbarAppearance(TQString name, bool drawButtons, bool haloText, - bool showButtonOnHover); + bool showButtonOnHover, + TaskBarSettings* settingsObject); bool matchesSettings() const; void alterSettings() const; @@ -45,6 +47,7 @@ class TaskbarAppearance bool m_drawButtons; bool m_haloText; bool m_showButtonOnHover; + TaskBarSettings* m_settingsObject; }; class TaskbarConfig : public KCModule @@ -54,6 +57,7 @@ class TaskbarConfig : public KCModule public: TaskbarConfig(TQWidget *parent = 0, const char* name = 0, const TQStringList &list = TQStringList()); + ~TaskbarConfig(); public slots: void load(); @@ -76,6 +80,8 @@ private: static const TQStringList& showTaskStatesList(); static TQStringList i18nShowTaskStatesList(); TaskbarConfigUI *m_widget; + TQString m_configFileName; + TaskBarSettings* m_settingsObject; }; #endif diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index dd0aadb9d..6a43b5fbb 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -462,6 +462,17 @@ By default, this option is selected and all windows are shown.</string> </widget> </grid> </widget> + <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> + <property name="buddy" stdset="0"> + <cstring>kcfg_ShowTaskStates</cstring> + </property> + </widget> <spacer> <property name="name"> <cstring>Spacer1</cstring> |