From 0ef12d60c85f58af9052d83ce1945d71afe16cb4 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 23 Dec 2012 17:29:08 -0600 Subject: Add preliminary taskbar task state support --- kcontrol/taskbar/kcmtaskbar.cpp | 20 +++++++ kcontrol/taskbar/kcmtaskbar.h | 2 + kcontrol/taskbar/kcmtaskbarui.ui | 114 ++++++++++++++++++++++++--------------- 3 files changed, 93 insertions(+), 43 deletions(-) (limited to 'kcontrol/taskbar') diff --git a/kcontrol/taskbar/kcmtaskbar.cpp b/kcontrol/taskbar/kcmtaskbar.cpp index 22ec10b14..cd1c67a1d 100644 --- a/kcontrol/taskbar/kcmtaskbar.cpp +++ b/kcontrol/taskbar/kcmtaskbar.cpp @@ -118,6 +118,25 @@ TQStringList TaskbarConfig::i18nGroupModeList() return i18nList; } +// These are the strings that are actually stored in the config file. +const TQStringList& TaskbarConfig::showTaskStatesList() +{ + static TQStringList list( + TQStringList() << I18N_NOOP("Any") << I18N_NOOP("Only Stopped") + << I18N_NOOP("Only Running")); + return list; +} + +// Get a translated version of the above string list. +TQStringList TaskbarConfig::i18nShowTaskStatesList() +{ + TQStringList i18nList; + for( TQStringList::ConstIterator it = showTaskStatesList().begin(); it != showTaskStatesList().end(); ++it ) { + i18nList << i18n((*it).latin1()); + } + return i18nList; +} + TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringList&) : KCModule(TaskBarFactory::instance(), parent, name) { @@ -151,6 +170,7 @@ TaskbarConfig::TaskbarConfig(TQWidget *parent, const char* name, const TQStringL m_widget->kcfg_MiddleButtonAction->insertStringList(list); m_widget->kcfg_RightButtonAction->insertStringList(list); m_widget->kcfg_GroupTasks->insertStringList(i18nGroupModeList()); + m_widget->kcfg_ShowTaskStates->insertStringList(i18nShowTaskStatesList()); connect(m_widget->kcfg_GroupTasks, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotUpdateComboBox())); diff --git a/kcontrol/taskbar/kcmtaskbar.h b/kcontrol/taskbar/kcmtaskbar.h index 877f26daf..d41f5e6f0 100644 --- a/kcontrol/taskbar/kcmtaskbar.h +++ b/kcontrol/taskbar/kcmtaskbar.h @@ -73,6 +73,8 @@ private: static TQStringList i18nActionList(); static const TQStringList& groupModeList(); static TQStringList i18nGroupModeList(); + static const TQStringList& showTaskStatesList(); + static TQStringList i18nShowTaskStatesList(); TaskbarConfigUI *m_widget; }; diff --git a/kcontrol/taskbar/kcmtaskbarui.ui b/kcontrol/taskbar/kcmtaskbarui.ui index 632f0c109..dd0aadb9d 100644 --- a/kcontrol/taskbar/kcmtaskbarui.ui +++ b/kcontrol/taskbar/kcmtaskbarui.ui @@ -107,13 +107,40 @@ By default the taskbar groups windows when it is full. - groupTasksLabel + showTaskStatesLabel &Group similar tasks: - kcfg_GroupTasks + kcfg_ShowTaskStates + + + + + kcfg_ShowTaskStates + + + + 7 + 0 + 0 + 0 + + + + The taskbar can show and/or hide tasks based on their current process state. Select <em>Any</em> to show all tasks regardless of current state. + + + + + groupTasksLabel + + + &Show tasks with state: + + + kcfg_ShowTaskStates @@ -161,12 +188,12 @@ By default this option is selected. By default, this option is selected and all windows are shown. - + appearance - + textLabel1 @@ -177,7 +204,7 @@ By default, this option is selected and all windows are shown. appearance - + kcfg_UseCustomColors @@ -191,7 +218,7 @@ By default, this option is selected and all windows are shown. true - + layout9 @@ -199,23 +226,17 @@ By default, this option is selected and all windows are shown. unnamed - + - spacer11_2 - - - Horizontal + inactiveTaskTextColorLabel - - Expanding + + Inacti&ve task text color: - - - 191 - 20 - + + kcfg_InactiveTaskTextColor - + kcfg_InactiveTaskTextColor @@ -241,26 +262,18 @@ By default, this option is selected and all windows are shown. - + - kcfg_TaskBackgroundColor - - - - - - - - taskBackgroundColorLabel + activeTaskTextColorLabel - &Background color: + Active task te&xt color: - kcfg_TaskBackgroundColor + kcfg_ActiveTaskTextColor - + kcfg_ActiveTaskTextColor @@ -268,29 +281,43 @@ By default, this option is selected and all windows are shown. - + - inactiveTaskTextColorLabel + spacer11_2 + + + Horizontal + + + Expanding + + + + 191 + 20 + + + + + + taskBackgroundColorLabel - Inacti&ve task text color: + &Background color: - kcfg_InactiveTaskTextColor + kcfg_TaskBackgroundColor - + - activeTaskTextColorLabel + kcfg_TaskBackgroundColor - Active task te&xt color: - - - kcfg_ActiveTaskTextColor + - + spacer12 @@ -471,6 +498,7 @@ By default, this option is selected and all windows are shown. kcfg_ShowIcon kcfg_ShowWindowListBtn kcfg_GroupTasks + kcfg_ShowTaskStates appearance kcfg_UseCustomColors kcfg_InactiveTaskTextColor -- cgit v1.2.3