summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 09:39:37 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 09:39:37 -0500
commit191c434271e705161fbd01ed83b6d043a275bffc (patch)
tree0919a0a91d56167a9d36bca3881c513006b68a9b /src/main.cpp
downloadksensors-191c434271e705161fbd01ed83b6d043a275bffc.tar.gz
ksensors-191c434271e705161fbd01ed83b6d043a275bffc.zip
Initial import of ksensors 0.7.3 sources
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..ac442cf
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,74 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : dom ago 19 02:10:35 EDT 2001
+ copyright : (C) 2001 by Miguel Novas
+ email : michaell@teleline.es
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 <kuniqueapp.h>
+#include "ksensorssplash.h"
+#include "lmsensorsdock.h"
+
+static const char *description =
+ I18N_NOOP("KSensors - A nice lmsensors frontend for KDE");
+// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
+
+
+static KCmdLineOptions options[] =
+{
+ { "nodock", I18N_NOOP("Don't dock in KDE system tray."), 0 },
+ { "splash", I18N_NOOP("Show splash screen."), 0 },
+ { 0, 0, 0 }
+ // INSERT YOUR COMMANDLINE OPTIONS HERE
+};
+
+
+int main(int argc, char *argv[])
+{
+
+ KAboutData aboutData( "ksensors", I18N_NOOP("KSensors"),
+ VERSION, description, KAboutData::License_GPL,
+ "(c) 2001, Miguel Novas", 0, 0, "michaell@teleline.es");
+ aboutData.addAuthor("Miguel Novas",0, "michaell@teleline.es");
+
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KUniqueApplication::addCmdLineOptions();
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ bool noDock= !args->isSet("dock");
+ bool showSplash= args->isSet("splash");
+ args->clear();
+
+ if(!KUniqueApplication::start()) return 0;
+ KUniqueApplication a;
+
+ KConfig *cfg= kapp->config();
+ cfg->setGroup("General");
+ if( cfg->readEntry("Version")!=aboutData.version() ) {
+ cfg->writeEntry("Version",aboutData.version());
+ showSplash= true;
+ }
+
+ if(showSplash) (void)new KSensorsSplash();
+
+ LMSensorsDock *ksensors= new LMSensorsDock(noDock);
+ QObject::connect( ksensors, SIGNAL(destroyed()), kapp, SLOT(quit()) );
+ QObject::connect( kapp, SIGNAL(saveYourself()), ksensors, SLOT(saveConfig()) );
+
+ return a.exec();
+}