diff options
Diffstat (limited to 'src/kdocker.cpp')
| -rw-r--r-- | src/kdocker.cpp | 72 | 
1 files changed, 27 insertions, 45 deletions
| diff --git a/src/kdocker.cpp b/src/kdocker.cpp index 40cf00a..fd6ce9b 100644 --- a/src/kdocker.cpp +++ b/src/kdocker.cpp @@ -22,12 +22,13 @@  #include <qsessionmanager.h>  #include <qdir.h>  #include <qfile.h> -#include <qtranslator.h>  #include <qtextcodec.h>  #include <qtextstream.h>  #include <qtimer.h>  #include <qstring.h> +#include <klocale.h> +  #include "trace.h"  #include "traylabelmgr.h"  #include "kdocker.h" @@ -46,25 +47,6 @@ KDocker::KDocker(int& argc, char** argv)  {    INIT_TRACE(); -  /* -   * Load localisation strings. Most examples I have seen load QTranslator -   * in main(). As a result the translator object lingers around till the end -   * of the program. I tried the same thing here and all i got was translations -   * for usage(). You dont want to know about the sleepless night i spent -   * trying to figure this out (yup, the source helped) -   */ -  QTranslator *translator = new QTranslator(0); -  QString f = QString("kdocker_") + QTextCodec::locale(); - -  if (!translator->load(f, QString(TRANSLATIONS_PATH)) && -      !translator->load(f, applicationDirPath() + "/i18n") && -      !translator->load(f, QDir::currentDirPath() + "/i18n")) { -      qDebug("Sorry, your locale is not supported. If you are interested " -             "in providing translations for your locale, contact " -             "gramakri@uiuc.edu\n"); -  } -  installTranslator(translator); -     // Attempt doing anything only if the CLI arguments were good    opterr = 0; // suppress the warning    int option; @@ -108,32 +90,32 @@ void KDocker::printVersion(void)  // Prints the CLI arguments. Does not return  void KDocker::printUsage(char optopt)  { -  if (optopt != 'h') qDebug(tr("kdocker: invalid option -- %1").arg(optopt)); - -  qDebug(tr("Usage: KDocker [options] command\n")); -  qDebug(tr("Docks any application into the system tray\n")); -  qDebug(tr("command \tCommand to execute\n")); -  qDebug(tr("Options")); -  qDebug(tr("-a     \tShow author information")); -  qDebug(tr("-b     \tDont warn about non-normal windows (blind mode)")); -  qDebug(tr("-d     \tDisable session management")); -  qDebug(tr("-e     \tEnable session management")); -  qDebug(tr("-f     \tDock window that has the focus(active window)")); -  qDebug(tr("-h     \tDisplay this help")); -  qDebug(tr("-i icon\tCustom dock Icon")); -  qDebug(tr("-l     \tLaunch on startup")); -  qDebug(tr("-m     \tKeep application window mapped (dont hide on dock)")); -  qDebug(tr("-o     \tDock when obscured")); -	qDebug(tr("-p secs\tSet ballooning timeout (popup time)")); -  qDebug(tr("-q     \tDisable ballooning title changes (quiet)")); -  qDebug(tr("-t     \tRemove this application from the task bar")); -  qDebug(tr("-v     \tDisplay version")); -  qDebug(tr("-w wid \tWindow id of the application to dock\n")); +  if (optopt != 'h') qDebug(i18n("kdocker: invalid option -- %1").arg(optopt).local8Bit()); + +  qDebug(i18n("Usage: KDocker [options] command\n").local8Bit()); +  qDebug(i18n("Docks any application into the system tray\n").local8Bit()); +  qDebug(i18n("command \tCommand to execute\n").local8Bit()); +  qDebug(i18n("Options").local8Bit()); +  qDebug(i18n("-a     \tShow author information").local8Bit()); +  qDebug(i18n("-b     \tDont warn about non-normal windows (blind mode)").local8Bit()); +  qDebug(i18n("-d     \tDisable session management").local8Bit()); +  qDebug(i18n("-e     \tEnable session management").local8Bit()); +  qDebug(i18n("-f     \tDock window that has the focus(active window)").local8Bit()); +  qDebug(i18n("-h     \tDisplay this help").local8Bit()); +  qDebug(i18n("-i icon\tCustom dock Icon").local8Bit()); +  qDebug(i18n("-l     \tLaunch on startup").local8Bit()); +  qDebug(i18n("-m     \tKeep application window mapped (dont hide on dock)").local8Bit()); +  qDebug(i18n("-o     \tDock when obscured").local8Bit()); +	qDebug(i18n("-p secs\tSet ballooning timeout (popup time)").local8Bit()); +  qDebug(i18n("-q     \tDisable ballooning title changes (quiet)").local8Bit()); +  qDebug(i18n("-t     \tRemove this application from the task bar").local8Bit()); +  qDebug(i18n("-v     \tDisplay version").local8Bit()); +  qDebug(i18n("-w wid \tWindow id of the application to dock\n").local8Bit()); -  qDebug(tr("NOTE: Use -d for all startup scripts.\n")); +  qDebug(i18n("NOTE: Use -d for all startup scripts.\n").local8Bit()); -  qDebug(tr("Bugs and wishes to gramakri@uiuc.edu")); -  qDebug(tr("Project information at http://kdocker.sourceforge.net")); +  qDebug(i18n("Bugs and wishes to gramakri@uiuc.edu").local8Bit()); +  qDebug(i18n("Project information at http://kdocker.sourceforge.net").local8Bit());  }  void KDocker::notifyPreviousInstance(Window prevInstance) @@ -197,7 +179,7 @@ bool KDocker::x11EventFilter(XEvent * event)            client->data.l[1], (unsigned) mSelectionOwner);      char tmp[50];      struct stat buf; -    sprintf(tmp, TMPFILE_PREFIX "%ld", client->data.l[1]); +    sprintf(tmp, QString(TMPFILE_PREFIX "%ld").local8Bit(), client->data.l[1]);      if (stat(tmp, &buf) || (getuid()!=buf.st_uid))      {       /* | 
