From 7fea3c42ee6179edaa3e9f36c794540ae73fcc95 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 24 Feb 2020 14:33:07 +0900 Subject: Completed kdocker -> tdedocker renaming effort. Signed-off-by: Michele Calgaro --- src/CMakeL10n.txt | 2 +- src/CMakeLists.txt | 6 +- src/customtraylabel.cpp | 24 ++-- src/kdocker.cpp | 233 ------------------------------------- src/kdocker.h | 59 ---------- src/kdocker.xpm | 304 ------------------------------------------------ src/main.cpp | 8 +- src/tdedocker.cpp | 233 +++++++++++++++++++++++++++++++++++++ src/tdedocker.h | 59 ++++++++++ src/tdedocker.xpm | 304 ++++++++++++++++++++++++++++++++++++++++++++++++ src/traylabelmgr.cpp | 24 ++-- 11 files changed, 628 insertions(+), 628 deletions(-) delete mode 100644 src/kdocker.cpp delete mode 100644 src/kdocker.h delete mode 100644 src/kdocker.xpm create mode 100644 src/tdedocker.cpp create mode 100644 src/tdedocker.h create mode 100644 src/tdedocker.xpm (limited to 'src') diff --git a/src/CMakeL10n.txt b/src/CMakeL10n.txt index fc3b369..3a6ef82 100644 --- a/src/CMakeL10n.txt +++ b/src/CMakeL10n.txt @@ -1,3 +1,3 @@ ##### create translation templates ############## -tde_l10n_create_template( "kdocker" ) +tde_l10n_create_template( "tdedocker" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4cf714f..02193f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,12 +24,12 @@ link_directories( ) -##### kdocker ################################### +##### tdedocker ################################### -tde_add_executable( kdocker AUTOMOC +tde_add_executable( tdedocker AUTOMOC SOURCES customtraylabel.cpp - kdocker.cpp + tdedocker.cpp main.cpp qtraylabel.cpp trace.cpp diff --git a/src/customtraylabel.cpp b/src/customtraylabel.cpp index a657a89..e27dbba 100644 --- a/src/customtraylabel.cpp +++ b/src/customtraylabel.cpp @@ -36,7 +36,7 @@ #include "trace.h" #include "customtraylabel.h" #include "traylabelmgr.h" -#include "kdocker.h" +#include "tdedocker.h" CustomTrayLabel::CustomTrayLabel(Window w, TQWidget* p, const TQString& t) : TQTrayLabel(w, p, t), mUndockWhenDead(false) @@ -56,9 +56,9 @@ CustomTrayLabel::CustomTrayLabel(const TQStringList& argv, pid_t pid, */ void CustomTrayLabel::installMenu() { - //TQPixmap kdocker_png(TDEGlobal::iconLoader()->loadIcon("kdocker", TDEIcon::NoGroup, TDEIcon::SizeSmall)); - TQPixmap *kdocker_png = new TQPixmap("kdocker"); - setIcon(*kdocker_png); + //TQPixmap tdedocker_png(TDEGlobal::iconLoader()->loadIcon("tdedocker", TDEIcon::NoGroup, TDEIcon::SizeSmall)); + TQPixmap *tdedocker_png = new TQPixmap("tdedocker"); + setIcon(*tdedocker_png); TrayLabelMgr *tlMgr = TrayLabelMgr::instance(); mOptionsMenu = new TQPopupMenu(this); @@ -106,8 +106,8 @@ void CustomTrayLabel::installMenu() mSkipTaskbar->addTo(mOptionsMenu); mMainMenu = new TQPopupMenu(this); - mMainMenu->insertItem(TQIconSet(*kdocker_png), - i18n("About KDocker"), tlMgr, SLOT(about())); + mMainMenu->insertItem(TQIconSet(*tdedocker_png), + i18n("About TDEDocker"), tlMgr, SLOT(about())); mMainMenu->insertSeparator(); mMainMenu->insertItem(i18n("Options"), mOptionsMenu); mMainMenu->insertItem(i18n("Dock Another"), tlMgr, SLOT(dockAnother())); @@ -215,7 +215,7 @@ void CustomTrayLabel::setCustomIcon(void) if (icon.isNull()) return; // user cancelled if (!TQPixmap(icon).isNull()) break; TRACE("Attempting to set icon to %s", icon.latin1()); - TQMessageBox::critical(this, i18n("KDocker"), + TQMessageBox::critical(this, i18n("TDEDocker"), i18n("%1 is not a valid icon").arg(icon)); } @@ -226,7 +226,7 @@ void CustomTrayLabel::setCustomIcon(void) void CustomTrayLabel::slotSetBalloonTimeout(void) { bool ok; - int timeout = TQInputDialog::getInteger(i18n("KDocker"), + int timeout = TQInputDialog::getInteger(i18n("TDEDocker"), i18n("Enter balloon timeout (secs). 0 to disable ballooning"), balloonTimeout()/1000, 0, 60, 1, &ok); @@ -259,7 +259,7 @@ void CustomTrayLabel::slotSetLaunchOnStartup() } // Request user to provide file name himself - if (TQMessageBox::critical(NULL, i18n("KDocker"), + if (TQMessageBox::critical(NULL, i18n("TDEDocker"), i18n("\"%1\" is not a valid executable " "or was not found in your $PATH").arg(app), i18n("Select program"), i18n("Cancel")) == 1) @@ -331,8 +331,8 @@ void CustomTrayLabel::processDead(void) { /* * This is a ugly hack but worth every but of ugliness IMO ;). - * Lets say, an instance of xmms, already exists. You type kdocker xmms. - * KDocker launches xmms. xmms cowardly exists seeing its previous instance. + * Lets say, an instance of xmms, already exists. You type tdedocker xmms. + * TDEDocker launches xmms. xmms cowardly exists seeing its previous instance. * Wouldnt it be nice now to dock the previous instance of xmms automatically. * This is more common than you think (think of session restoration) */ @@ -356,7 +356,7 @@ bool CustomTrayLabel::canDockWindow(Window w) void CustomTrayLabel::dropEvent(TQDropEvent *) { - TQMessageBox::information(NULL, "KDocker", + TQMessageBox::information(NULL, "TDEDocker", i18n("You cannot drop an item into the tray icon. Drop it on the window\n" "that is brought in front when you hover the item over the tray icon")); } diff --git a/src/kdocker.cpp b/src/kdocker.cpp deleted file mode 100644 index 2df7eb6..0000000 --- a/src/kdocker.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -// $Id: kdocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "trace.h" -#include "traylabelmgr.h" -#include "kdocker.h" - -#include -#include -#include -#include -#include - -// #define TMPFILE_PREFIX TQString("/tmp/kdocker.") -#define TMPFILE_PREFIX TQDir::homeDirPath() + "/.kdocker." - -KDocker::KDocker(int& argc, char** argv) - :TQApplication(argc, argv), mTrayLabelMgr(0) -{ - INIT_TRACE(); - - // Attempt doing anything only if the CLI arguments were good - opterr = 0; // suppress the warning - int option; - while ((option = getopt(argc, argv, TrayLabelMgr::options().latin1())) != EOF) - { - if (option == '?') - { - if (optopt == 'v') printVersion(); else printUsage(optopt); - ::exit(0); - } - } - - /* - * Detect and transfer control to previous instance (if one exists) - * _KDOCKER_RUNNING is a X Selection. We start out by trying to locate the - * selection owner. If someone else owns it, transfer control to that - * instance of KDocker - */ - Display *display = TQPaintDevice::x11AppDisplay(); - Atom kdocker = XInternAtom(display, "_KDOCKER_RUNNING", False); - Window prev_instance = XGetSelectionOwner(display, kdocker); - - if (prev_instance == None) - { - 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); - mTrayLabelMgr = TrayLabelMgr::instance(); - } - else - notifyPreviousInstance(prev_instance); // does not return -} - -void KDocker::printVersion(void) -{ - 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') 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 = TQPaintDevice::x11AppDisplay(); - - TRACE("Notifying previous instance [%x]", (unsigned) prevInstance); - - // Dump all arguments in temporary file - TQFile f(TMPFILE_PREFIX + TQString().setNum(getpid())); - if (!f.open(IO_WriteOnly)) return; - TQTextStream s(&f); - - /* - * Its normal to use KDocker in startup scripts. We could be getting restored - * from a session at the same time. So, if we were getting restored and - * another instance already exists, send across the session id. Remember, qt - * strips out all the arguments that it understands. So need to do it by hand. - */ - if (isSessionRestored()) - s << argv()[0] << " " << "-session" << " " << sessionId(); - else - for (int i = 0; i < argc(); i++) s << argv()[i] << " "; - - f.close(); - - /* - * Now tell our previous instance that we came to pass. Actually, it can - * figure it out itself using PropertyNotify events but this is a lot nicer - */ - XClientMessageEvent dock_event; - memset(&dock_event, 0, sizeof(XClientMessageEvent)); - dock_event.display = display; - dock_event.window = prevInstance; - dock_event.send_event = True; - dock_event.type = ClientMessage; - dock_event.message_type = 0x220679; // it all started this day - dock_event.format = 8; - dock_event.data.l[0] = 0xBABE; // love letter ;) - dock_event.data.l[1] = getpid(); - XSendEvent(display, prevInstance, False, 0, (XEvent *) &dock_event); - XSync(display, False); - - ::exit(0); -} - -/* - * The X11 Event filter called by TQt. Look out for ClientMessage events from - * our new instance - */ -bool KDocker::x11EventFilter(XEvent * event) -{ - if (event->type == ClientMessage) - { - // look for requests from a new instance of kdocker - XClientMessageEvent *client = (XClientMessageEvent *) event; - if (!(client->message_type == 0x220679 && client->data.l[0] == 0xBABE)) - return FALSE; - - TRACE("ClientMessage from PID=%ld. SelOwn=0x%x", - client->data.l[1], (unsigned) mSelectionOwner); - char tmp[50]; - struct stat buf; - sprintf(tmp, TQString(TMPFILE_PREFIX "%ld").local8Bit(), client->data.l[1]); - if (stat(tmp, &buf) || (getuid()!=buf.st_uid)) - { - /* - * We make sure that the owner of this process and the owner of the file - * are the same. This will prevent someone from executing arbitrary - * programs by sending client message. Of course, you can send a message - * only if you are authenticated to the X session and have permission to - * create files in TMPFILE_PREFIX. So this code is there just for the - * heck of it. - */ - TRACE("User %i is trying something fishy...", buf.st_uid); - unlink(tmp); - return TRUE; - } - TQFile f(tmp); - if (!f.open(IO_ReadOnly)) return TRUE; - 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); - return TRUE; - } - else return mTrayLabelMgr->x11EventFilter(event); -} - -/* - * XSMP Support - */ -void KDocker::saveState(TQSessionManager &sm) -{ - TQString sf = mTrayLabelMgr->saveSession(); - - TQStringList discard_command; - discard_command << "rm" << sf; - sm.setDiscardCommand(discard_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(TQDir::homeDirPath() + "/kdocker.trace"); - // sm.setRestartCommand(applicationFilePath()); -} - - -#include "kdocker.moc" diff --git a/src/kdocker.h b/src/kdocker.h deleted file mode 100644 index ecfdbb7..0000000 --- a/src/kdocker.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -// $Id: kdocker.h,v 1.11 2005/02/09 03:32:26 cs19713 Exp $ - -#ifndef _KDOCKER_H -#define _KDOCKER_H - -#include -#include - -#define KDOCKER_APP_VERSION "1.3" - -class TrayLabelMgr; - -class KDocker : public TQApplication -{ - Q_OBJECT - -public: - KDocker(int& argc, char** argv); - - TrayLabelMgr *trayLabelMgr(void) { return mTrayLabelMgr; } - - void dumpState(const TQString &file); - void printUsage(char optopt = 'h'); - -protected: - bool x11EventFilter(XEvent * event); - void saveState(TQSessionManager &sm); - -private: - TQString saveSession(); - bool restoreSession(); - void notifyPreviousInstance(Window prevInstance); - - void printVersion(); - - Window mSelectionOwner; - TrayLabelMgr *mTrayLabelMgr; -}; - -#endif // _KDOCKER_H diff --git a/src/kdocker.xpm b/src/kdocker.xpm deleted file mode 100644 index 63fb2fa..0000000 --- a/src/kdocker.xpm +++ /dev/null @@ -1,304 +0,0 @@ -/* XPM */ -static char * kdocker_xpm[] = { -"24 24 277 2", -" c None", -". c #0080FF", -"+ c #007AF3", -"@ c #349AFF", -"# c #43A2FF", -"$ c #43A1FE", -"% c #3694F2", -"& c #3B9AF8", -"* c #409FFD", -"= c #3F9EFD", -"- c #3E9EFC", -"; c #3E9DFC", -"> c #1F87ED", -", c #C5E2FE", -"' c #FEFEFE", -") c #E2E5E4", -"! c #267126", -"~ c #206D20", -"{ c #327734", -"] c #518754", -"^ c #82A688", -"/ c #BECBC9", -"( c #DDE4EB", -"_ c #74AEE8", -": c #FAFBFC", -"< c #EDF0F2", -"[ c #8DAD92", -"} c #3B7B3D", -"| c #045F05", -"1 c #005D00", -"2 c #025F02", -"3 c #056005", -"4 c #37793C", -"5 c #3D7F94", -"6 c #F5F7FA", -"7 c #F0F3F8", -"8 c #EBF0F5", -"9 c #E0E6ED", -"0 c #ADC0B9", -"a c #3B7B40", -"b c #046004", -"c c #539A48", -"d c #4A9243", -"e c #025E03", -"f c #005100", -"g c #FBFCFD", -"h c #F6F8FA", -"i c #F0F4F8", -"j c #E5ECF3", -"k c #E1E8F1", -"l c #DCE5EE", -"m c #D0DAE4", -"n c #6D977A", -"o c #82BB73", -"p c #ADD69F", -"q c #21741F", -"r c #005700", -"s c #FDFDFE", -"t c #F8F9FB", -"u c #F2F5F9", -"v c #ECF1F6", -"w c #E7EDF3", -"x c #E1E9F1", -"y c #D6E1EC", -"z c #D1DDEA", -"A c #CAD6E4", -"B c #679276", -"C c #096308", -"D c #AEDB9B", -"E c #CDEBBE", -"F c #2E7C2B", -"G c #005600", -"H c #EFF3F7", -"I c #E9EFF5", -"J c #E3EAF2", -"K c #DDE6EF", -"L c #D8E2EC", -"M c #D2DDEA", -"N c #CDD9E7", -"O c #C7D6E5", -"P c #BBCADA", -"Q c #307339", -"R c #3E8B35", -"S c #D2F5BA", -"T c #C7E6B9", -"U c #136A12", -"V c #004C00", -"W c #F9FBFC", -"X c #F3F6F9", -"Y c #EDF1F6", -"Z c #DBE4EE", -"` c #D5DFEB", -" . c #CFDBE8", -".. c #C9D7E6", -"+. c #C3D2E3", -"@. c #BECEE0", -"#. c #82A29C", -"$. c #035F02", -"%. c #B0E294", -"&. c #D4F5BD", -"*. c #88BB7E", -"=. c #005B00", -"-. c #C5E1FE", -";. c #F8FAFB", -">. c #ECF0F6", -",. c #DFE7F0", -"'. c #D9E3ED", -"). c #D3DEEA", -"!. c #C6D5E4", -"~. c #C0D0E2", -"{. c #BACCDF", -"]. c #A8BBCD", -"^. c #116415", -"/. c #74BA5C", -"(. c #C5F2A7", -"_. c #D1F2BB", -":. c #156B13", -"<. c #C4E1FE", -"[. c #F2F5F8", -"}. c #E5EBF3", -"|. c #D9E2ED", -"1. c #D2DEEA", -"2. c #CCD9E7", -"3. c #C6D4E4", -"4. c #BFD0E1", -"5. c #B6C7DA", -"6. c #ACBFD3", -"7. c #286E32", -"8. c #52A23C", -"9. c #B7EF90", -"0. c #C7F3AA", -"a. c #559B4C", -"b. c #005400", -"c. c #70B5F8", -"d. c #8CC1F5", -"e. c #89BEF3", -"f. c #85BCF2", -"g. c #82B9F0", -"h. c #7EB6EE", -"i. c #7BB4ED", -"j. c #77B1EB", -"k. c #74AFEA", -"l. c #70ACE8", -"m. c #689FD6", -"n. c #2E7138", -"o. c #276E30", -"p. c #0E6312", -"q. c #449B2D", -"r. c #A8EC79", -"s. c #B9F093", -"t. c #7BBA68", -"u. c #004E00", -"v. c #004D00", -"w. c #096702", -"x. c #359A13", -"y. c #6AC739", -"z. c #99E963", -"A. c #AAED7C", -"B. c #9EDB7E", -"C. c #3B8932", -"D. c #196F16", -"E. c #005C00", -"F. c #015D00", -"G. c #4DB915", -"H. c #7AE233", -"I. c #8BE64C", -"J. c #9BEA66", -"K. c #ACED80", -"L. c #AFE68E", -"M. c #176E14", -"N. c #005000", -"O. c #0E6F02", -"P. c #68DB1B", -"Q. c #7CE335", -"R. c #8DE64F", -"S. c #9DE968", -"T. c #3D902D", -"U. c #005800", -"V. c #005A00", -"W. c #319D07", -"X. c #6DE01F", -"Y. c #7EE338", -"Z. c #5EB835", -"`. c #046200", -" + c #52CA09", -".+ c #65D41E", -"++ c #0A6805", -"@+ c #9C9CA1", -"#+ c #95959A", -"$+ c #E0E0E1", -"%+ c #C7C7C9", -"&+ c #CDCDCF", -"*+ c #005500", -"=+ c #1A8100", -"-+ c #1C8302", -";+ c #BAB9BA", -">+ c #F2DEC0", -",+ c #F8F8F9", -"'+ c #EBEBED", -")+ c #065F06", -"!+ c #086007", -"~+ c #B8B6B3", -"{+ c #E0CDAC", -"]+ c #FAD468", -"^+ c #EFE9D9", -"/+ c #E5DBBD", -"(+ c #B5B5BF", -"_+ c #C5C3B7", -":+ c #BEC1B4", -"<+ c #85A0A1", -"[+ c #B6BDB7", -"}+ c #E1DECF", -"|+ c #D3D1C3", -"1+ c #AABFCA", -"2+ c #307877", -"3+ c #367B7F", -"4+ c #98B0C1", -"5+ c #CCC9BC", -"6+ c #B8B4AC", -"7+ c #958E9D", -"8+ c #BCBAAE", -"9+ c #BEBCAF", -"0+ c #D5D2C4", -"a+ c #BAB4A8", -"b+ c #F3E055", -"c+ c #E8E2AA", -"d+ c #DEC768", -"e+ c #9998A1", -"f+ c #CAC7BA", -"g+ c #77966A", -"h+ c #67A18A", -"i+ c #3B82AB", -"j+ c #D8D6C8", -"k+ c #D3D0C3", -"l+ c #DBE3E4", -"m+ c #F5F8FA", -"n+ c #E2E9F1", -"o+ c #B0BEC8", -"p+ c #8A5593", -"q+ c #8C3BA2", -"r+ c #9687B4", -"s+ c #C5C2B5", -"t+ c #DCDACB", -"u+ c #AFAEB0", -"v+ c #B1ADA8", -"w+ c #C2BBB0", -"x+ c #ADACAE", -"y+ c #B0AEAB", -"z+ c #DDDACB", -"A+ c #729472", -"B+ c #609F92", -"C+ c #3C82AC", -"D+ c #D9D6C8", -"E+ c #D9E2E4", -"F+ c #E6EDF4", -"G+ c #CBD9E7", -"H+ c #A1B3C2", -"I+ c #915A8A", -"J+ c #8C2E8C", -"K+ c #9F8EAF", -"L+ c #DFDCCD", -"M+ c #CDCBBE", -"N+ c #B5B3B0", -"O+ c #E0DDCE", -"P+ c #C2C4B8", -"Q+ c #89A2A6", -"R+ c #BBC0B9", -"S+ c #D5D3C5", -"T+ c #C4C7BF", -"U+ c #AAB2B1", -"V+ c #A6AEAE", -"W+ c #ADB2AD", -"X+ c #CAC8BA", -"Y+ c #C1BEB2", -"Z+ c #A7A19D", -"`+ c #C2C0B3", -" @ c #C2BFB2", -" ", -" . . . . . . . . . . . . . + ", -" @ # # # # $ % % & * = - ; > ", -" , ' ' ' ' ) ! ~ { ] ^ / ( _ ", -" , ' ' ' : < [ } | 1 2 3 4 5 ", -" , ' ' : 6 7 8 9 0 a b c d e f ", -" , ' g h i 8 j k l m n 3 o p q r ", -" , s t u v w x l y z A B C D E F G ", -" , g 6 H I J K L M N O P Q R S T U V ", -" , W X Y w k Z ` ...+.@.#.$.%.&.*.=. ", -" -.;.u >.j ,.'.).N !.~.{.].^./.(._.:. ", -" <.t [.8 }.,.|.1.2.3.4.5.6.7.8.9.0.a.b. ", -" c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.=.u.v. ", -" G w.x.y.z.A.B.C.D.E. ", -" F.G.H.I.J.K.L.M.N. ", -" N.O.P.Q.R.S.T.U. ", -" V.W.X.Y.Z.F. ", -" `. +.+++v. ", -" @+#+$+%+&+ *+=+-+r ", -" ;+>+,+'+ )+!+ ", -"~+{+]+^+/+(+_+:+<+[+}+}+}+}+|+1+2+3+4+5+6+7+8+9+", -"0+a+b+c+d+e+f+g+h+i+j+}+}+}+k+l+m+n+o+}+p+q+r+s+", -"t+u+v+w+x+y+z+A+B+C+D+}+}+}+k+E+F+G+H+}+I+J+K+s+", -"}+L+M+N+O+L+}+P+Q+R+}+}+}+}+S+T+U+V+W+X+Y+Z+`+ @"}; diff --git a/src/main.cpp b/src/main.cpp index d1e0a38..1cd955e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,7 @@ #include #include -#include "kdocker.h" +#include "tdedocker.h" #include "traylabelmgr.h" #include "trace.h" #include @@ -36,12 +36,12 @@ static void sighandler(int sig) { if (sig == SIGUSR1) { - DUMP_TRACE(TQDir::homeDirPath() + "/kdocker.trace"); + DUMP_TRACE(TQDir::homeDirPath() + "/tdedocker.trace"); return; } tqDebug("%s", i18n("Caught signal %1. Cleaning up.").arg(sig).local8Bit().data()); - ((KDocker *)tqApp)->trayLabelMgr()->undockAll(); + ((TDEDocker *)tqApp)->trayLabelMgr()->undockAll(); } int main(int argc, char *argv[]) @@ -52,6 +52,6 @@ int main(int argc, char *argv[]) signal(SIGINT, sighandler); signal(SIGUSR1, sighandler); - KDocker app(argc, argv); + TDEDocker app(argc, argv); return app.exec(); } diff --git a/src/tdedocker.cpp b/src/tdedocker.cpp new file mode 100644 index 0000000..2b404c7 --- /dev/null +++ b/src/tdedocker.cpp @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: tdedocker.cpp,v 1.24 2005/02/04 10:25:46 cs19713 Exp $ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "trace.h" +#include "traylabelmgr.h" +#include "tdedocker.h" + +#include +#include +#include +#include +#include + +// #define TMPFILE_PREFIX TQString("/tmp/tdedocker.") +#define TMPFILE_PREFIX TQDir::homeDirPath() + "/.tdedocker." + +TDEDocker::TDEDocker(int& argc, char** argv) + :TQApplication(argc, argv), mTrayLabelMgr(0) +{ + INIT_TRACE(); + + // Attempt doing anything only if the CLI arguments were good + opterr = 0; // suppress the warning + int option; + while ((option = getopt(argc, argv, TrayLabelMgr::options().latin1())) != EOF) + { + if (option == '?') + { + if (optopt == 'v') printVersion(); else printUsage(optopt); + ::exit(0); + } + } + + /* + * Detect and transfer control to previous instance (if one exists) + * _KDOCKER_RUNNING is a X Selection. We start out by trying to locate the + * selection owner. If someone else owns it, transfer control to that + * instance of TDEDocker + */ + Display *display = TQPaintDevice::x11AppDisplay(); + Atom tdedocker = XInternAtom(display, "_KDOCKER_RUNNING", False); + Window prev_instance = XGetSelectionOwner(display, tdedocker); + + if (prev_instance == None) + { + mSelectionOwner = XCreateSimpleWindow(display, tqt_xrootwin(), 1, 1, 1, + 1, 1, 1, 1); + XSetSelectionOwner(display, tdedocker, mSelectionOwner, CurrentTime); + TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner); + mTrayLabelMgr = TrayLabelMgr::instance(); + } + else + notifyPreviousInstance(prev_instance); // does not return +} + +void TDEDocker::printVersion(void) +{ + tqDebug("TQt: %s", tqVersion()); + tqDebug("TDEDocker: %s", KDOCKER_APP_VERSION); +} + +// Prints the CLI arguments. Does not return +void TDEDocker::printUsage(char optopt) +{ + if (optopt != 'h') tqDebug("%s", i18n("tdedocker: invalid option -- %1").arg(optopt).local8Bit().data()); + + tqDebug("%s", i18n("Usage: TDEDocker [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://tdedocker.sourceforge.net").local8Bit().data()); +} + +void TDEDocker::notifyPreviousInstance(Window prevInstance) +{ + Display *display = TQPaintDevice::x11AppDisplay(); + + TRACE("Notifying previous instance [%x]", (unsigned) prevInstance); + + // Dump all arguments in temporary file + TQFile f(TMPFILE_PREFIX + TQString().setNum(getpid())); + if (!f.open(IO_WriteOnly)) return; + TQTextStream s(&f); + + /* + * Its normal to use TDEDocker in startup scripts. We could be getting restored + * from a session at the same time. So, if we were getting restored and + * another instance already exists, send across the session id. Remember, qt + * strips out all the arguments that it understands. So need to do it by hand. + */ + if (isSessionRestored()) + s << argv()[0] << " " << "-session" << " " << sessionId(); + else + for (int i = 0; i < argc(); i++) s << argv()[i] << " "; + + f.close(); + + /* + * Now tell our previous instance that we came to pass. Actually, it can + * figure it out itself using PropertyNotify events but this is a lot nicer + */ + XClientMessageEvent dock_event; + memset(&dock_event, 0, sizeof(XClientMessageEvent)); + dock_event.display = display; + dock_event.window = prevInstance; + dock_event.send_event = True; + dock_event.type = ClientMessage; + dock_event.message_type = 0x220679; // it all started this day + dock_event.format = 8; + dock_event.data.l[0] = 0xBABE; // love letter ;) + dock_event.data.l[1] = getpid(); + XSendEvent(display, prevInstance, False, 0, (XEvent *) &dock_event); + XSync(display, False); + + ::exit(0); +} + +/* + * The X11 Event filter called by TQt. Look out for ClientMessage events from + * our new instance + */ +bool TDEDocker::x11EventFilter(XEvent * event) +{ + if (event->type == ClientMessage) + { + // look for requests from a new instance of tdedocker + XClientMessageEvent *client = (XClientMessageEvent *) event; + if (!(client->message_type == 0x220679 && client->data.l[0] == 0xBABE)) + return FALSE; + + TRACE("ClientMessage from PID=%ld. SelOwn=0x%x", + client->data.l[1], (unsigned) mSelectionOwner); + char tmp[50]; + struct stat buf; + sprintf(tmp, TQString(TMPFILE_PREFIX "%ld").local8Bit(), client->data.l[1]); + if (stat(tmp, &buf) || (getuid()!=buf.st_uid)) + { + /* + * We make sure that the owner of this process and the owner of the file + * are the same. This will prevent someone from executing arbitrary + * programs by sending client message. Of course, you can send a message + * only if you are authenticated to the X session and have permission to + * create files in TMPFILE_PREFIX. So this code is there just for the + * heck of it. + */ + TRACE("User %i is trying something fishy...", buf.st_uid); + unlink(tmp); + return TRUE; + } + TQFile f(tmp); + if (!f.open(IO_ReadOnly)) return TRUE; + 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); + return TRUE; + } + else return mTrayLabelMgr->x11EventFilter(event); +} + +/* + * XSMP Support + */ +void TDEDocker::saveState(TQSessionManager &sm) +{ + TQString sf = mTrayLabelMgr->saveSession(); + + TQStringList discard_command; + discard_command << "rm" << sf; + sm.setDiscardCommand(discard_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(TQDir::homeDirPath() + "/tdedocker.trace"); + // sm.setRestartCommand(applicationFilePath()); +} + + +#include "tdedocker.moc" diff --git a/src/tdedocker.h b/src/tdedocker.h new file mode 100644 index 0000000..46d0e13 --- /dev/null +++ b/src/tdedocker.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +// $Id: tdedocker.h,v 1.11 2005/02/09 03:32:26 cs19713 Exp $ + +#ifndef _KDOCKER_H +#define _KDOCKER_H + +#include +#include + +#define KDOCKER_APP_VERSION "1.3" + +class TrayLabelMgr; + +class TDEDocker : public TQApplication +{ + Q_OBJECT + +public: + TDEDocker(int& argc, char** argv); + + TrayLabelMgr *trayLabelMgr(void) { return mTrayLabelMgr; } + + void dumpState(const TQString &file); + void printUsage(char optopt = 'h'); + +protected: + bool x11EventFilter(XEvent * event); + void saveState(TQSessionManager &sm); + +private: + TQString saveSession(); + bool restoreSession(); + void notifyPreviousInstance(Window prevInstance); + + void printVersion(); + + Window mSelectionOwner; + TrayLabelMgr *mTrayLabelMgr; +}; + +#endif // _KDOCKER_H diff --git a/src/tdedocker.xpm b/src/tdedocker.xpm new file mode 100644 index 0000000..314c220 --- /dev/null +++ b/src/tdedocker.xpm @@ -0,0 +1,304 @@ +/* XPM */ +static char * tdedocker_xpm[] = { +"24 24 277 2", +" c None", +". c #0080FF", +"+ c #007AF3", +"@ c #349AFF", +"# c #43A2FF", +"$ c #43A1FE", +"% c #3694F2", +"& c #3B9AF8", +"* c #409FFD", +"= c #3F9EFD", +"- c #3E9EFC", +"; c #3E9DFC", +"> c #1F87ED", +", c #C5E2FE", +"' c #FEFEFE", +") c #E2E5E4", +"! c #267126", +"~ c #206D20", +"{ c #327734", +"] c #518754", +"^ c #82A688", +"/ c #BECBC9", +"( c #DDE4EB", +"_ c #74AEE8", +": c #FAFBFC", +"< c #EDF0F2", +"[ c #8DAD92", +"} c #3B7B3D", +"| c #045F05", +"1 c #005D00", +"2 c #025F02", +"3 c #056005", +"4 c #37793C", +"5 c #3D7F94", +"6 c #F5F7FA", +"7 c #F0F3F8", +"8 c #EBF0F5", +"9 c #E0E6ED", +"0 c #ADC0B9", +"a c #3B7B40", +"b c #046004", +"c c #539A48", +"d c #4A9243", +"e c #025E03", +"f c #005100", +"g c #FBFCFD", +"h c #F6F8FA", +"i c #F0F4F8", +"j c #E5ECF3", +"k c #E1E8F1", +"l c #DCE5EE", +"m c #D0DAE4", +"n c #6D977A", +"o c #82BB73", +"p c #ADD69F", +"q c #21741F", +"r c #005700", +"s c #FDFDFE", +"t c #F8F9FB", +"u c #F2F5F9", +"v c #ECF1F6", +"w c #E7EDF3", +"x c #E1E9F1", +"y c #D6E1EC", +"z c #D1DDEA", +"A c #CAD6E4", +"B c #679276", +"C c #096308", +"D c #AEDB9B", +"E c #CDEBBE", +"F c #2E7C2B", +"G c #005600", +"H c #EFF3F7", +"I c #E9EFF5", +"J c #E3EAF2", +"K c #DDE6EF", +"L c #D8E2EC", +"M c #D2DDEA", +"N c #CDD9E7", +"O c #C7D6E5", +"P c #BBCADA", +"Q c #307339", +"R c #3E8B35", +"S c #D2F5BA", +"T c #C7E6B9", +"U c #136A12", +"V c #004C00", +"W c #F9FBFC", +"X c #F3F6F9", +"Y c #EDF1F6", +"Z c #DBE4EE", +"` c #D5DFEB", +" . c #CFDBE8", +".. c #C9D7E6", +"+. c #C3D2E3", +"@. c #BECEE0", +"#. c #82A29C", +"$. c #035F02", +"%. c #B0E294", +"&. c #D4F5BD", +"*. c #88BB7E", +"=. c #005B00", +"-. c #C5E1FE", +";. c #F8FAFB", +">. c #ECF0F6", +",. c #DFE7F0", +"'. c #D9E3ED", +"). c #D3DEEA", +"!. c #C6D5E4", +"~. c #C0D0E2", +"{. c #BACCDF", +"]. c #A8BBCD", +"^. c #116415", +"/. c #74BA5C", +"(. c #C5F2A7", +"_. c #D1F2BB", +":. c #156B13", +"<. c #C4E1FE", +"[. c #F2F5F8", +"}. c #E5EBF3", +"|. c #D9E2ED", +"1. c #D2DEEA", +"2. c #CCD9E7", +"3. c #C6D4E4", +"4. c #BFD0E1", +"5. c #B6C7DA", +"6. c #ACBFD3", +"7. c #286E32", +"8. c #52A23C", +"9. c #B7EF90", +"0. c #C7F3AA", +"a. c #559B4C", +"b. c #005400", +"c. c #70B5F8", +"d. c #8CC1F5", +"e. c #89BEF3", +"f. c #85BCF2", +"g. c #82B9F0", +"h. c #7EB6EE", +"i. c #7BB4ED", +"j. c #77B1EB", +"k. c #74AFEA", +"l. c #70ACE8", +"m. c #689FD6", +"n. c #2E7138", +"o. c #276E30", +"p. c #0E6312", +"q. c #449B2D", +"r. c #A8EC79", +"s. c #B9F093", +"t. c #7BBA68", +"u. c #004E00", +"v. c #004D00", +"w. c #096702", +"x. c #359A13", +"y. c #6AC739", +"z. c #99E963", +"A. c #AAED7C", +"B. c #9EDB7E", +"C. c #3B8932", +"D. c #196F16", +"E. c #005C00", +"F. c #015D00", +"G. c #4DB915", +"H. c #7AE233", +"I. c #8BE64C", +"J. c #9BEA66", +"K. c #ACED80", +"L. c #AFE68E", +"M. c #176E14", +"N. c #005000", +"O. c #0E6F02", +"P. c #68DB1B", +"Q. c #7CE335", +"R. c #8DE64F", +"S. c #9DE968", +"T. c #3D902D", +"U. c #005800", +"V. c #005A00", +"W. c #319D07", +"X. c #6DE01F", +"Y. c #7EE338", +"Z. c #5EB835", +"`. c #046200", +" + c #52CA09", +".+ c #65D41E", +"++ c #0A6805", +"@+ c #9C9CA1", +"#+ c #95959A", +"$+ c #E0E0E1", +"%+ c #C7C7C9", +"&+ c #CDCDCF", +"*+ c #005500", +"=+ c #1A8100", +"-+ c #1C8302", +";+ c #BAB9BA", +">+ c #F2DEC0", +",+ c #F8F8F9", +"'+ c #EBEBED", +")+ c #065F06", +"!+ c #086007", +"~+ c #B8B6B3", +"{+ c #E0CDAC", +"]+ c #FAD468", +"^+ c #EFE9D9", +"/+ c #E5DBBD", +"(+ c #B5B5BF", +"_+ c #C5C3B7", +":+ c #BEC1B4", +"<+ c #85A0A1", +"[+ c #B6BDB7", +"}+ c #E1DECF", +"|+ c #D3D1C3", +"1+ c #AABFCA", +"2+ c #307877", +"3+ c #367B7F", +"4+ c #98B0C1", +"5+ c #CCC9BC", +"6+ c #B8B4AC", +"7+ c #958E9D", +"8+ c #BCBAAE", +"9+ c #BEBCAF", +"0+ c #D5D2C4", +"a+ c #BAB4A8", +"b+ c #F3E055", +"c+ c #E8E2AA", +"d+ c #DEC768", +"e+ c #9998A1", +"f+ c #CAC7BA", +"g+ c #77966A", +"h+ c #67A18A", +"i+ c #3B82AB", +"j+ c #D8D6C8", +"k+ c #D3D0C3", +"l+ c #DBE3E4", +"m+ c #F5F8FA", +"n+ c #E2E9F1", +"o+ c #B0BEC8", +"p+ c #8A5593", +"q+ c #8C3BA2", +"r+ c #9687B4", +"s+ c #C5C2B5", +"t+ c #DCDACB", +"u+ c #AFAEB0", +"v+ c #B1ADA8", +"w+ c #C2BBB0", +"x+ c #ADACAE", +"y+ c #B0AEAB", +"z+ c #DDDACB", +"A+ c #729472", +"B+ c #609F92", +"C+ c #3C82AC", +"D+ c #D9D6C8", +"E+ c #D9E2E4", +"F+ c #E6EDF4", +"G+ c #CBD9E7", +"H+ c #A1B3C2", +"I+ c #915A8A", +"J+ c #8C2E8C", +"K+ c #9F8EAF", +"L+ c #DFDCCD", +"M+ c #CDCBBE", +"N+ c #B5B3B0", +"O+ c #E0DDCE", +"P+ c #C2C4B8", +"Q+ c #89A2A6", +"R+ c #BBC0B9", +"S+ c #D5D3C5", +"T+ c #C4C7BF", +"U+ c #AAB2B1", +"V+ c #A6AEAE", +"W+ c #ADB2AD", +"X+ c #CAC8BA", +"Y+ c #C1BEB2", +"Z+ c #A7A19D", +"`+ c #C2C0B3", +" @ c #C2BFB2", +" ", +" . . . . . . . . . . . . . + ", +" @ # # # # $ % % & * = - ; > ", +" , ' ' ' ' ) ! ~ { ] ^ / ( _ ", +" , ' ' ' : < [ } | 1 2 3 4 5 ", +" , ' ' : 6 7 8 9 0 a b c d e f ", +" , ' g h i 8 j k l m n 3 o p q r ", +" , s t u v w x l y z A B C D E F G ", +" , g 6 H I J K L M N O P Q R S T U V ", +" , W X Y w k Z ` ...+.@.#.$.%.&.*.=. ", +" -.;.u >.j ,.'.).N !.~.{.].^./.(._.:. ", +" <.t [.8 }.,.|.1.2.3.4.5.6.7.8.9.0.a.b. ", +" c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.=.u.v. ", +" G w.x.y.z.A.B.C.D.E. ", +" F.G.H.I.J.K.L.M.N. ", +" N.O.P.Q.R.S.T.U. ", +" V.W.X.Y.Z.F. ", +" `. +.+++v. ", +" @+#+$+%+&+ *+=+-+r ", +" ;+>+,+'+ )+!+ ", +"~+{+]+^+/+(+_+:+<+[+}+}+}+}+|+1+2+3+4+5+6+7+8+9+", +"0+a+b+c+d+e+f+g+h+i+j+}+}+}+k+l+m+n+o+}+p+q+r+s+", +"t+u+v+w+x+y+z+A+B+C+D+}+}+}+k+E+F+G+H+}+I+J+K+s+", +"}+L+M+N+O+L+}+P+Q+R+}+}+}+}+S+T+U+V+W+X+Y+Z+`+ @"}; diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp index c24034d..40c8231 100644 --- a/src/traylabelmgr.cpp +++ b/src/traylabelmgr.cpp @@ -62,10 +62,10 @@ TrayLabelMgr::~TrayLabelMgr() void TrayLabelMgr::about(void) { - if (TQMessageBox::information(NULL, i18n("About KDocker"), + if (TQMessageBox::information(NULL, i18n("About TDEDocker"), i18n("Bugs/wishes to Girish Ramakrishnan (gramakri@uiuc.edu)\n" "English translation by Girish (gramakri@uiuc.edu)\n\n" - "http://kdocker.sourceforge.net for updates"), + "http://tdedocker.sourceforge.net for updates"), TQString::null, SHOW_TRACE_TEXT) == 1) SHOW_TRACE(); } @@ -91,7 +91,7 @@ void TrayLabelMgr::startup(void) return; } - if (TQMessageBox::warning(NULL, i18n("KDocker"), + if (TQMessageBox::warning(NULL, i18n("TDEDocker"), i18n(state == SysTrayAbsent ? "No system tray found" : "System tray appears to be hidden"), TQMessageBox::Abort, TQMessageBox::Ignore) == TQMessageBox::Abort) @@ -182,7 +182,7 @@ bool TrayLabelMgr::processCommand(int argc, char** argv) if (argc < 1) return false; - // Restore session (See the comments in KDocker::notifyPreviousInstance() + // Restore session (See the comments in TDEDocker::notifyPreviousInstance() if (qstrcmp(argv[1], "-session") == 0) { TRACE("Restoring session %s (new instance request)", argv[2]); @@ -288,7 +288,7 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality) if ((w = selectWindow(TQPaintDevice::x11AppDisplay(), &err)) == None) { - if (err) TQMessageBox::critical(NULL, i18n("KDocker"), i18n(err)); + if (err) TQMessageBox::critical(NULL, i18n("TDEDocker"), i18n(err)); return NULL; } } @@ -299,7 +299,7 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality) * Abort should be the only option here really. "Ignore" is provided here * for the curious user who wants to screw himself very badly */ - if (TQMessageBox::warning(NULL, i18n("KDocker"), + if (TQMessageBox::warning(NULL, i18n("TDEDocker"), i18n("The window you are attempting to dock does not seem to be a" " normal window."), TQMessageBox::Abort, TQMessageBox::Ignore) == TQMessageBox::Abort) @@ -310,7 +310,7 @@ TQTrayLabel *TrayLabelMgr::selectAndDock(Window w, bool checkNormality) TRACE("0x%x is not docked", (unsigned) w); - TQMessageBox::message(i18n("KDocker"), + TQMessageBox::message(i18n("TDEDocker"), i18n("This window is already docked.\n" "Click on system tray icon to toggle docking.")); return NULL; @@ -360,7 +360,7 @@ TQTrayLabel *TrayLabelMgr::dockApplication(char *argv[]) if (pid == -1) { - TQMessageBox::critical(NULL, "KDocker", + TQMessageBox::critical(NULL, "TDEDocker", i18n("Failed to fork: %1").arg(strerror(errno))); return NULL; } @@ -427,7 +427,7 @@ void TrayLabelMgr::notifySysTrayAbsence() if (state == SysTrayPresent) return; // So sweet of the systray to come back so soon - if (TQMessageBox::warning(NULL, i18n("KDocker"), + if (TQMessageBox::warning(NULL, i18n("TDEDocker"), i18n("The System tray was hidden or removed"), i18n("Undock All"), i18n("Ignore")) == 0) undockAll(); @@ -438,7 +438,7 @@ void TrayLabelMgr::notifySysTrayAbsence() */ bool TrayLabelMgr::restoreSession(const TQString& sessionId) { - TQString session_file = "kdocker_" + sessionId; + TQString session_file = "tdedocker_" + sessionId; TQSettings settings; settings.beginGroup(TQString("/" + session_file)); @@ -451,7 +451,7 @@ bool TrayLabelMgr::restoreSession(const TQString& sessionId) if (pname.isEmpty()) break; if (settings.readBoolEntry("/LaunchOnStartup")) { - TQStringList args("kdocker"); + TQStringList args("tdedocker"); args += TQStringList::split(" ", pname); TRACE("Triggering AutoLaunch"); if (!processCommand(args)) continue; @@ -469,7 +469,7 @@ bool TrayLabelMgr::restoreSession(const TQString& sessionId) TQString TrayLabelMgr::saveSession(void) { - TQString session_file = "kdocker_" + tqApp->sessionId(); + TQString session_file = "tdedocker_" + tqApp->sessionId(); TQSettings settings; settings.beginGroup(TQString("/" + session_file)); -- cgit v1.2.1