summaryrefslogtreecommitdiffstats
path: root/kicker/taskbar/taskbarcontainer.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-30 20:54:16 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-30 20:54:16 -0600
commitce3da132361e281919a222a519ff9901c8d6c3e1 (patch)
treee622ebded549e5f7c87a0cb1ab56a7a974032098 /kicker/taskbar/taskbarcontainer.cpp
parent4d3d2420430fb53000ceda25ae7498e49f6e94b2 (diff)
downloadtdebase-ce3da132361e281919a222a519ff9901c8d6c3e1.tar.gz
tdebase-ce3da132361e281919a222a519ff9901c8d6c3e1.zip
Fix media:/ kioslave handling of audio CDs
Allow separate settings for each taskbar applet Add mouse-driven Kicker resize support
Diffstat (limited to 'kicker/taskbar/taskbarcontainer.cpp')
-rw-r--r--kicker/taskbar/taskbarcontainer.cpp38
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)