summaryrefslogtreecommitdiffstats
path: root/src/customtraylabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/customtraylabel.cpp')
-rw-r--r--src/customtraylabel.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/customtraylabel.cpp b/src/customtraylabel.cpp
index 87e50ac..5ad3459 100644
--- a/src/customtraylabel.cpp
+++ b/src/customtraylabel.cpp
@@ -44,11 +44,10 @@
CustomTrayLabel::CustomTrayLabel(Window w, TQWidget* p, const TQString& t)
: TQTrayLabel(w, p, t), mUndockWhenDead(false)
{
- installMenu();
+ installMenu();
}
-CustomTrayLabel::CustomTrayLabel(const TQStringList& argv, pid_t pid,
- TQWidget* parent)
+CustomTrayLabel::CustomTrayLabel(const TQStringList& argv, pid_t pid, TQWidget* parent)
: TQTrayLabel(argv, pid, parent), mUndockWhenDead(false)
{
installMenu();
@@ -124,6 +123,11 @@ void CustomTrayLabel::installMenu()
setAcceptDrops(true); // and you thought this function only installs the menu
}
+void CustomTrayLabel::enableSessionManagement(bool sm)
+{
+ mSessionManagement->setOn(!appName().isEmpty() && sm);
+}
+
// Session Management
bool CustomTrayLabel::restoreState(TDEConfig *config)
{
@@ -132,13 +136,20 @@ bool CustomTrayLabel::restoreState(TDEConfig *config)
return TQTrayLabel::restoreState(config);
}
-void CustomTrayLabel::saveState(TDEConfig *config)
+bool CustomTrayLabel::saveState(TDEConfig *config)
{
- if (!mSessionManagement->isOn()) return;
+ if (!mSessionManagement->isOn())
+ {
+ return false;
+ }
- TQTrayLabel::saveState(config);
+ if (!TQTrayLabel::saveState(config))
+ {
+ return false;
+ }
config->writeEntry("DockWhenObscured", isDockWhenObscured());
TRACE("WM=%i DWO=%i", isDockWhenMinimized(), isDockWhenObscured());
+ return true;
}
static bool which(const char *app)
@@ -177,6 +188,7 @@ void CustomTrayLabel::setSkipTaskbar(bool skip)
void CustomTrayLabel::setAppName(const TQString& name)
{
+ //FIXME HACK relies on window and application name being the same.
TQTrayLabel::setAppName(name.lower());
}