diff options
author | Darrell Anderson <[email protected]> | 2013-01-06 15:44:22 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2013-01-06 15:44:22 -0600 |
commit | 3642a26c369228341bc7abf55341eb1d6d4d6dfa (patch) | |
tree | 1ab102939f160e204c237f19af47e362ad31785b /kicker/taskbar/taskbarcontainer.cpp | |
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 'kicker/taskbar/taskbarcontainer.cpp')
-rw-r--r-- | kicker/taskbar/taskbarcontainer.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/kicker/taskbar/taskbarcontainer.cpp b/kicker/taskbar/taskbarcontainer.cpp index 938487dfc..00ed9786c 100644 --- a/kicker/taskbar/taskbarcontainer.cpp +++ b/kicker/taskbar/taskbarcontainer.cpp @@ -42,15 +42,25 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "taskbarcontainer.h" #include "taskbarcontainer.moc" -TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const char *name ) +#define GLOBAL_TASKBAR_CONFIG_FILE_NAME "ktaskbarrc" + +TaskBarContainer::TaskBarContainer( bool enableFrame, TQString configFileOverride, TQWidget *parent, const char *name ) : TQFrame(parent, name), + configFile(configFileOverride), direction( KPanelApplet::Up ), showWindowListButton( true ), windowListButton(0), - windowListMenu(0) + windowListMenu(0), + settingsObject(NULL) { + if (configFile == "") + { + configFile = GLOBAL_TASKBAR_CONFIG_FILE_NAME; + } + settingsObject = new TaskBarSettings(KSharedConfig::openConfig(configFile)); + setBackgroundOrigin( AncestorOrigin ); - + uint margin; if ( enableFrame ) { @@ -69,7 +79,7 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const ch layout->setMargin( margin ); // scrollable taskbar - taskBar = new TaskBar(this); + taskBar = new TaskBar(settingsObject, this); layout->addWidget( taskBar ); connect( taskBar, TQT_SIGNAL( containerCountChanged() ), TQT_SIGNAL( containerCountChanged() ) ); @@ -85,13 +95,14 @@ TaskBarContainer::TaskBarContainer( bool enableFrame, TQWidget *parent, const ch TaskBarContainer::~TaskBarContainer() { - delete windowListMenu; + if (windowListMenu) delete windowListMenu; + if (settingsObject) delete settingsObject; } void TaskBarContainer::configure() { - setFont(TaskBarSettings::taskbarFont()); - showWindowListButton = TaskBarSettings::showWindowListBtn(); + setFont(settingsObject->taskbarFont()); + showWindowListButton = settingsObject->showWindowListBtn(); if (!showWindowListButton) { @@ -148,7 +159,7 @@ void TaskBarContainer::configChanged() // doesn't have to also connect to the DCOP signal (less places // to change/fix it if/when it changes) without calling // configure() twice on taskbar on start up - TaskBarSettings::self()->readConfig(); + settingsObject->readConfig(); configure(); taskBar->configure(); @@ -163,7 +174,16 @@ void TaskBarContainer::preferences() kapp->dcopClient()->attach(); } - kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig()", data); + if (configFile == GLOBAL_TASKBAR_CONFIG_FILE_NAME) + { + kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig()", data); + } + else + { + TQDataStream args( data, IO_WriteOnly ); + args << configFile; + kapp->dcopClient()->send("kicker", "kicker", "showTaskBarConfig(TQString)", data); + } } void TaskBarContainer::orientationChange(Orientation o) |