summaryrefslogtreecommitdiffstats
path: root/kbugbuster/main.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /kbugbuster/main.cpp
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.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/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbugbuster/main.cpp')
-rw-r--r--kbugbuster/main.cpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/kbugbuster/main.cpp b/kbugbuster/main.cpp
new file mode 100644
index 00000000..456d9dc6
--- /dev/null
+++ b/kbugbuster/main.cpp
@@ -0,0 +1,83 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : zo mrt 18 17:12:24 CET 2001
+ copyright : (C) 2001 by Martijn Klingens
+ email : klingens@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. *
+ * *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <dcopclient.h>
+
+#include "gui/kbbmainwindow.h"
+#include "bugsystem.h"
+#include "kbbprefs.h"
+
+static const char description[] =
+ I18N_NOOP("KBugBuster");
+// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
+
+static const KCmdLineOptions options[] =
+{
+ {"d", 0, 0},
+ {"disconnected", I18N_NOOP("Start in disconnected mode"), 0},
+ {"pkg", 0, 0},
+ {"package <pkg>", I18N_NOOP("Start with the buglist for <package>"), 0},
+ {"bug <br>", I18N_NOOP("Start with bug report <br>"), 0},
+ KCmdLineLastOption
+};
+
+int main(int argc, char *argv[])
+{
+ KAboutData aboutData( "kbugbuster", I18N_NOOP( "KBugBuster" ),
+ VERSION, description, KAboutData::License_GPL,
+ I18N_NOOP("(c) 2001,2002,2003 the KBugBuster authors") );
+ aboutData.addAuthor( "Martijn Klingens", 0, "klingens@kde.org" );
+ aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
+ aboutData.addAuthor( "Simon Hausmann", 0, "hausmann@kde.org" );
+ aboutData.addAuthor( "David Faure", 0, "faure@kde.org" );
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KApplication app;
+
+ app.dcopClient()->attach();
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->isSet("disconnected")) {
+ BugSystem::self()->setDisconnected( true );
+ }
+
+ if ( app.isRestored() )
+ {
+ RESTORE( KBBMainWindow );
+ }
+ else
+ {
+ KBBMainWindow *mainWin = new KBBMainWindow(args->getOption("package"), args->getOption("bug"));
+
+ // Since all background jobs remaing running after closing the
+ // main window we force a quit here
+ QObject::connect( &app, SIGNAL( lastWindowClosed() ),
+ &app, SLOT( quit() ) );
+ mainWin->show();
+ return app.exec();
+ }
+}
+
+/* vim: set et ts=4 sw=4 softtabstop=4: */