summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:17:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-19 18:17:02 +0000
commitf867212c1762e156553d039319b904a17f7b563d (patch)
tree461c1a743b3ff8291e03360742dbbfb4cc0087e4 /src/main.cpp
downloadknutclient-f867212c1762e156553d039319b904a17f7b563d.tar.gz
knutclient-f867212c1762e156553d039319b904a17f7b563d.zip
Added KDE3 version of knutclient
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1092914 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..d3dabec
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,78 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : Út srp 21 19:12:20 CEST 2001
+ copyright : (C) 2001 by Daniel Prynych
+ email : Daniel.Prynych@alo.cz
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 <kcmdlineargs.h>
+#include <klocale.h>
+#include <kapp.h>
+#include <kuniqueapplication.h>
+
+#include "knutclient.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static const char *description =
+ I18N_NOOP("Client for Network UPS Tool");
+// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
+
+
+static KCmdLineOptions options[] =
+{
+ {"nodock",I18N_NOOP("Don't dock in Kicker"),0},
+ { 0, 0, 0 }
+ // INSERT YOUR COMMANDLINE OPTIONS HERE
+};
+
+
+
+int main(int argc, char *argv[])
+{
+
+ KAboutData aboutData( "knutclient", I18N_NOOP("KNutClient"),
+ VERSION, description, KAboutData::License_GPL,
+ "(c) 2002 - 2009 Daniel Prynych", "Zajecov, Czech Republic", 0, "Daniel@prynych.cz");
+ aboutData.addAuthor("Daniel Prynych",0, "Daniel@prynych.cz","http://www.knut.noveradsl.cz/knutclient/");
+ aboutData.addCredit("Arnaud Quette",0,"arnaud.quette@free.fr","http://www.networkupstools.org/");
+ aboutData.addCredit("MGE",0,0,"http://opensource.mgeups.com");
+
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+ KUniqueApplication::addCmdLineOptions();
+
+ KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+ bool noDock = args->isSet("dock");
+ args->clear();
+
+ // main KUApp this is remark
+ if (!KUniqueApplication::start()) {
+ fprintf(stderr,"Sorry : KNutClient is already running!\n");
+ exit(0);
+ }
+ KUniqueApplication a;
+
+// next line is for testing only.
+// I don't debug KUniqueApplication
+
+// KApplication a;
+//
+ KNutClient *knutclient = new KNutClient(!noDock);
+ int returnCode = a.exec();
+ delete knutclient;
+ return returnCode;
+}