summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-03-16 21:58:44 +0900
committerMichele Calgaro <[email protected]>2020-03-16 21:58:44 +0900
commitab3e99d8ee8ef5b53dcd1e6f90e3cdbbc08322e3 (patch)
treee622bfddde12ec89c8a84bfefec8dce7140109db /src/main.cpp
parentd9e1d9fa71544a674d213117c0b675a0e874e556 (diff)
downloadtdedocker-ab3e99d8ee8ef5b53dcd1e6f90e3cdbbc08322e3.tar.gz
tdedocker-ab3e99d8ee8ef5b53dcd1e6f90e3cdbbc08322e3.zip
Conversion to TDE application.
Notable changes: 1) save/restore data are saved in TDE session files. 2) remove -a, -l options. Removed "Launch on startup" option. 3) docked application are restored automatically by the TDE session manager. After being restored, tdedocker will wait for 5 seconds to let the various applications be restored, then it will try to grab the required windows. 4) save/restore of docked applications is now working properly. 5) due to the way TDE manages command line options, at the moment additional parameters cannot be passed to the application to be docked. This will be address in a subsequent commit. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1cd955e..b61d52e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,6 +24,10 @@
#include <unistd.h>
#include <signal.h>
+#include <tdeaboutdata.h>
+#include <tdeapplication.h>
+#include <tdecmdlineargs.h>
+#include <tdeglobal.h>
#include <tdelocale.h>
#include <tqdir.h>
@@ -36,14 +40,33 @@ static void sighandler(int sig)
{
if (sig == SIGUSR1)
{
- DUMP_TRACE(TQDir::homeDirPath() + "/tdedocker.trace");
+ DUMP_TRACE((TQDir::homeDirPath() + "/tdedocker.trace").ascii());
return;
}
tqDebug("%s", i18n("Caught signal %1. Cleaning up.").arg(sig).local8Bit().data());
((TDEDocker *)tqApp)->trayLabelMgr()->undockAll();
+ ::exit(0);
}
+static const TDECmdLineOptions options[] =
+{
+ { "b", I18N_NOOP("Dont warn about non-normal windows (blind mode)"), 0L },
+ { "d", I18N_NOOP("Disable session management"), 0L },
+ { "e", I18N_NOOP("Enable session management"), 0L },
+ { "f", I18N_NOOP("Dock window that has the focus(active window)"), 0L },
+ { "i icon", I18N_NOOP("Custom dock Icon"), 0L },
+ { "m", I18N_NOOP("Keep application window mapped (dont hide on dock)"), 0L },
+ { "o", I18N_NOOP("Dock when obscured"), 0L },
+ { "p secs", I18N_NOOP("Set ballooning timeout (popup time)"), 0L },
+ { "q", I18N_NOOP("Disable ballooning title changes (quiet)"), 0L },
+ { "t", I18N_NOOP("Remove this application from the task bar"), 0L },
+ { "w wid", I18N_NOOP("Window id of the application to dock"), 0L },
+ { "+[command <args>]", I18N_NOOP("Application to dock"), 0 },
+ TDECmdLineLastOption
+};
+
+//extern "C" int KDE_EXPORT kdemain(int argc, char* argv[])
int main(int argc, char *argv[])
{
// setup signal handlers that undock and quit
@@ -52,6 +75,17 @@ int main(int argc, char *argv[])
signal(SIGINT, sighandler);
signal(SIGUSR1, sighandler);
- TDEDocker app(argc, argv);
+ TDEAboutData about("tdedocker", I18N_NOOP("tdedocker"), "1.3",
+ I18N_NOOP("Docks any application into the system tray\nNOTE: Use -d for all startup scripts."), TDEAboutData::License_GPL);
+ about.addAuthor("John Schember", I18N_NOOP("Original KDocker maintainer"), "[email protected]");
+ about.addAuthor("Girish Ramakrishnan", I18N_NOOP("Original KDocker developer"), "[email protected]");
+
+ TDEGlobal::locale()->setMainCatalogue("tdedocker");
+
+ TDECmdLineArgs::init(argc, argv, &about);
+ TDECmdLineArgs::addCmdLineOptions(options);
+ TDEDocker::addCmdLineOptions();
+ TDEDocker app;
+
return app.exec();
}