diff options
Diffstat (limited to 'src/kdocker.cpp')
-rw-r--r-- | src/kdocker.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/kdocker.cpp b/src/kdocker.cpp index b85198d..deb6143 100644 --- a/src/kdocker.cpp +++ b/src/kdocker.cpp @@ -19,13 +19,13 @@ // $Id: kdocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $ -#include <qsessionmanager.h> -#include <qdir.h> -#include <qfile.h> -#include <qtextcodec.h> -#include <qtextstream.h> -#include <qtimer.h> -#include <qstring.h> +#include <tqsessionmanager.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtextcodec.h> +#include <tqtextstream.h> +#include <tqtimer.h> +#include <tqstring.h> #include <klocale.h> @@ -39,11 +39,11 @@ #include <stdio.h> #include <stdlib.h> -// #define TMPFILE_PREFIX QString("/tmp/kdocker.") -#define TMPFILE_PREFIX QDir::homeDirPath() + "/.kdocker." +// #define TMPFILE_PREFIX TQString("/tmp/kdocker.") +#define TMPFILE_PREFIX TQDir::homeDirPath() + "/.kdocker." KDocker::KDocker(int& argc, char** argv) - :QApplication(argc, argv), mTrayLabelMgr(0) + :TQApplication(argc, argv), mTrayLabelMgr(0) { INIT_TRACE(); @@ -65,13 +65,13 @@ KDocker::KDocker(int& argc, char** argv) * selection owner. If someone else owns it, transfer control to that * instance of KDocker */ - Display *display = QPaintDevice::x11AppDisplay(); + Display *display = TQPaintDevice::x11AppDisplay(); Atom kdocker = XInternAtom(display, "_KDOCKER_RUNNING", False); Window prev_instance = XGetSelectionOwner(display, kdocker); if (prev_instance == None) { - mSelectionOwner = XCreateSimpleWindow(display, qt_xrootwin(), 1, 1, 1, + mSelectionOwner = XCreateSimpleWindow(display, tqt_xrootwin(), 1, 1, 1, 1, 1, 1, 1); XSetSelectionOwner(display, kdocker, mSelectionOwner, CurrentTime); TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner); @@ -83,51 +83,51 @@ KDocker::KDocker(int& argc, char** argv) void KDocker::printVersion(void) { - qDebug("Qt: %s", qVersion()); - qDebug("KDocker: %s", KDOCKER_APP_VERSION); + tqDebug("TQt: %s", tqVersion()); + tqDebug("KDocker: %s", KDOCKER_APP_VERSION); } // Prints the CLI arguments. Does not return void KDocker::printUsage(char optopt) { - if (optopt != 'h') qDebug("%s", i18n("kdocker: invalid option -- %1").arg(optopt).local8Bit().data()); - - qDebug("%s", i18n("Usage: KDocker [options] command\n").local8Bit().data()); - qDebug("%s", i18n("Docks any application into the system tray\n").local8Bit().data()); - qDebug("%s", i18n("command \tCommand to execute\n").local8Bit().data()); - qDebug("%s", i18n("Options").local8Bit().data()); - qDebug("%s", i18n("-a \tShow author information").local8Bit().data()); - qDebug("%s", i18n("-b \tDont warn about non-normal windows (blind mode)").local8Bit().data()); - qDebug("%s", i18n("-d \tDisable session management").local8Bit().data()); - qDebug("%s", i18n("-e \tEnable session management").local8Bit().data()); - qDebug("%s", i18n("-f \tDock window that has the focus(active window)").local8Bit().data()); - qDebug("%s", i18n("-h \tDisplay this help").local8Bit().data()); - qDebug("%s", i18n("-i icon\tCustom dock Icon").local8Bit().data()); - qDebug("%s", i18n("-l \tLaunch on startup").local8Bit().data()); - qDebug("%s", i18n("-m \tKeep application window mapped (dont hide on dock)").local8Bit().data()); - qDebug("%s", i18n("-o \tDock when obscured").local8Bit().data()); - qDebug("%s", i18n("-p secs\tSet ballooning timeout (popup time)").local8Bit().data()); - qDebug("%s", i18n("-q \tDisable ballooning title changes (quiet)").local8Bit().data()); - qDebug("%s", i18n("-t \tRemove this application from the task bar").local8Bit().data()); - qDebug("%s", i18n("-v \tDisplay version").local8Bit().data()); - qDebug("%s", i18n("-w wid \tWindow id of the application to dock\n").local8Bit().data()); - - qDebug("%s", i18n("NOTE: Use -d for all startup scripts.\n").local8Bit().data()); - - qDebug("%s", i18n("Bugs and wishes to gramakri@uiuc.edu").local8Bit().data()); - qDebug("%s", i18n("Project information at http://kdocker.sourceforge.net").local8Bit().data()); + if (optopt != 'h') tqDebug("%s", i18n("kdocker: invalid option -- %1").arg(optopt).local8Bit().data()); + + tqDebug("%s", i18n("Usage: KDocker [options] command\n").local8Bit().data()); + tqDebug("%s", i18n("Docks any application into the system tray\n").local8Bit().data()); + tqDebug("%s", i18n("command \tCommand to execute\n").local8Bit().data()); + tqDebug("%s", i18n("Options").local8Bit().data()); + tqDebug("%s", i18n("-a \tShow author information").local8Bit().data()); + tqDebug("%s", i18n("-b \tDont warn about non-normal windows (blind mode)").local8Bit().data()); + tqDebug("%s", i18n("-d \tDisable session management").local8Bit().data()); + tqDebug("%s", i18n("-e \tEnable session management").local8Bit().data()); + tqDebug("%s", i18n("-f \tDock window that has the focus(active window)").local8Bit().data()); + tqDebug("%s", i18n("-h \tDisplay this help").local8Bit().data()); + tqDebug("%s", i18n("-i icon\tCustom dock Icon").local8Bit().data()); + tqDebug("%s", i18n("-l \tLaunch on startup").local8Bit().data()); + tqDebug("%s", i18n("-m \tKeep application window mapped (dont hide on dock)").local8Bit().data()); + tqDebug("%s", i18n("-o \tDock when obscured").local8Bit().data()); + tqDebug("%s", i18n("-p secs\tSet ballooning timeout (popup time)").local8Bit().data()); + tqDebug("%s", i18n("-q \tDisable ballooning title changes (quiet)").local8Bit().data()); + tqDebug("%s", i18n("-t \tRemove this application from the task bar").local8Bit().data()); + tqDebug("%s", i18n("-v \tDisplay version").local8Bit().data()); + tqDebug("%s", i18n("-w wid \tWindow id of the application to dock\n").local8Bit().data()); + + tqDebug("%s", i18n("NOTE: Use -d for all startup scripts.\n").local8Bit().data()); + + tqDebug("%s", i18n("Bugs and wishes to gramakri@uiuc.edu").local8Bit().data()); + tqDebug("%s", i18n("Project information at http://kdocker.sourceforge.net").local8Bit().data()); } void KDocker::notifyPreviousInstance(Window prevInstance) { - Display *display = QPaintDevice::x11AppDisplay(); + Display *display = TQPaintDevice::x11AppDisplay(); TRACE("Notifying previous instance [%x]", (unsigned) prevInstance); // Dump all arguments in temporary file - QFile f(TMPFILE_PREFIX + QString().setNum(getpid())); + TQFile f(TMPFILE_PREFIX + TQString().setNum(getpid())); if (!f.open(IO_WriteOnly)) return; - QTextStream s(&f); + TQTextStream s(&f); /* * Its normal to use KDocker in startup scripts. We could be getting restored @@ -163,7 +163,7 @@ void KDocker::notifyPreviousInstance(Window prevInstance) } /* - * The X11 Event filter called by Qt. Look out for ClientMessage events from + * The X11 Event filter called by TQt. Look out for ClientMessage events from * our new instance */ bool KDocker::x11EventFilter(XEvent * event) @@ -179,7 +179,7 @@ bool KDocker::x11EventFilter(XEvent * event) client->data.l[1], (unsigned) mSelectionOwner); char tmp[50]; struct stat buf; - sprintf(tmp, QString(TMPFILE_PREFIX "%ld").local8Bit(), client->data.l[1]); + sprintf(tmp, TQString(TMPFILE_PREFIX "%ld").local8Bit(), client->data.l[1]); if (stat(tmp, &buf) || (getuid()!=buf.st_uid)) { /* @@ -194,11 +194,11 @@ bool KDocker::x11EventFilter(XEvent * event) unlink(tmp); return TRUE; } - QFile f(tmp); + TQFile f(tmp); if (!f.open(IO_ReadOnly)) return TRUE; - QTextStream s(&f); - QStringList argv; - while (!s.atEnd()) { QString x; s >> x; argv += x; } + TQTextStream s(&f); + TQStringList argv; + while (!s.atEnd()) { TQString x; s >> x; argv += x; } f.close(); unlink(tmp); // delete the tmp file mTrayLabelMgr->processCommand(argv); @@ -210,22 +210,22 @@ bool KDocker::x11EventFilter(XEvent * event) /* * XSMP Support */ -void KDocker::saveState(QSessionManager &sm) +void KDocker::saveState(TQSessionManager &sm) { - QString sf = mTrayLabelMgr->saveSession(); + TQString sf = mTrayLabelMgr->saveSession(); - QStringList discard_command; + TQStringList discard_command; discard_command << "rm" << sf; sm.setDiscardCommand(discard_command); - sm.setRestartHint(QSessionManager::RestartIfRunning); - QStringList restart_command; + sm.setRestartHint(TQSessionManager::RestartIfRunning); + TQStringList restart_command; restart_command << this->argv()[0] << "-session" << sm.sessionId(); sm.setRestartCommand(restart_command); TRACE("SessionFile=%s AppName=%s", sf.latin1(), this->argv()[0]); - DUMP_TRACE(QDir::homeDirPath() + "/kdocker.trace"); + DUMP_TRACE(TQDir::homeDirPath() + "/kdocker.trace"); // sm.setRestartCommand(applicationFilePath()); } |