diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 00bb99ac80741fc50ef8a289719373032f2391eb (patch) | |
tree | 3a5a9bf72f942784b38bf77dd66c534662fab5f2 /kmousetool/kmousetool/main.cpp | |
download | tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.tar.gz tdeaccessibility-00bb99ac80741fc50ef8a289719373032f2391eb.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmousetool/kmousetool/main.cpp')
-rw-r--r-- | kmousetool/kmousetool/main.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/kmousetool/kmousetool/main.cpp b/kmousetool/kmousetool/main.cpp new file mode 100644 index 0000000..29c5e30 --- /dev/null +++ b/kmousetool/kmousetool/main.cpp @@ -0,0 +1,79 @@ +/*************************************************************************** + main.cpp - description + ------------------- + begin : Sun Jan 20 23:27:58 PST 2002 + copyright : (C) 2002 by Jeff Roush + email : jeff@mousetool.com + copyright : (C) 2003 by Olaf Schmidt + email : ojschmidt@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program 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. * + * * + ***************************************************************************/ + +#include <kcmdlineargs.h> +#include <kaboutdata.h> +#include <klocale.h> +#include <kstandarddirs.h> +#include <kuniqueapplication.h> +#include <dcopclient.h> +#include <qmessagebox.h> +#include <kconfig.h> + +#include "kmousetool.h" + +static const char description[] = + I18N_NOOP("KMouseTool"); +// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE + + +static KCmdLineOptions options[] = +{ + KCmdLineLastOption + // INSERT YOUR COMMANDLINE OPTIONS HERE +}; + +int main(int argc, char *argv[]) +{ + KAboutData aboutData( "kmousetool", I18N_NOOP("KMouseTool"), + KMOUSETOOL_VERSION, description, KAboutData::License_GPL, + "(c) 2002-2003, Jeff Roush\n(c) 2003, Gunnar Schmi Dt", 0, "http://www.mousetool.com", "gunnar@schmi-dt.de"); + + aboutData.addAuthor("Gunnar Schmi Dt", I18N_NOOP("Current maintainer"), "gunnar@schmi-dt.de", "http://www.schmi-dt.de"); + aboutData.addAuthor("Olaf Schmidt", I18N_NOOP("Usability improvements"), "ojschmidt@kde.org"); + aboutData.addAuthor("Jeff Roush", I18N_NOOP("Original author"), "jeff@mousetool.com", "http://www.mousetool.com"); + + aboutData.addCredit("Joe Betts"); + KCmdLineArgs::init( argc, argv, &aboutData ); + KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. + KUniqueApplication::addCmdLineOptions(); + + if (!KUniqueApplication::start()) { + DCOPClient *client = new DCOPClient(); + client->attach(); + QByteArray data; + QCString replyType; + QByteArray replyData; + if ( !client->call("kmousetool", "qt/KMouseToolUI", "show()", + data, replyType, replyData, true) || + !client->call("kmousetool", "qt/KMouseToolUI", "raise()", + data, replyType, replyData, true) ) + fprintf(stderr, "The DCOP calls failed\n"); + delete client; + exit(0); + } + KUniqueApplication a; + + KMouseTool *kmousetool = new KMouseTool(); + + if (!kapp->config()->readBoolEntry("IsMinimized", false)) + kmousetool->show(); + + return a.exec(); +} |