summaryrefslogtreecommitdiffstats
path: root/src/customtraylabel.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-03-26 15:10:12 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-03-26 15:10:12 +0900
commit88fbf7e81a6ab317262bd97875a0296f59287586 (patch)
tree0effe4e64f5cdf3c0aa42e8ca8096cca8b6ddc89 /src/customtraylabel.cpp
parent5c2a45303ead893a78c69ddbef21d5acedf654ff (diff)
downloadtdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.tar.gz
tdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.zip
1) Additional work on tq app -> tde app translation.
2) Make sure to exit app after restore if no app window can be grabbed 3) Save state only for known applications (app with empty name will not be saved and restored) Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
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());
}