summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clients/tde/src/app/main.cpp')
-rw-r--r--clients/tde/src/app/main.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/clients/tde/src/app/main.cpp b/clients/tde/src/app/main.cpp
new file mode 100644
index 0000000..65e83ad
--- /dev/null
+++ b/clients/tde/src/app/main.cpp
@@ -0,0 +1,61 @@
+//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
+//Copyright: See COPYING file that comes with this distribution
+
+#include "define.h"
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <kconfig.h>
+#include "remotemdi.h"
+
+static const KCmdLineOptions options[] =
+{
+ { "+[server]", I18N_NOOP( "Connect to remote server 'server'" ), 0 },
+ { 0, 0, 0 }
+};
+
+static KAboutData about(
+ APP_NAME, I18N_NOOP( APP_PRETTYNAME ), APP_VERSION,
+ I18N_NOOP("Graphical remote laboratory client"), KAboutData::License_GPL_V2,
+ I18N_NOOP("(C) 2012 Timothy Pearson"), 0,
+ "http://remotefpga.pearsoncomputing.net/", "kb9vqf@pearsoncomputing.net" );
+
+
+int main( int argc, char *argv[] )
+{
+ about.addAuthor( "Timothy Pearson", I18N_NOOP("Author, maintainer"), "kb9vqf@pearsoncomputing.net", "http://remotefpga.pearsoncomputing.net/" );
+
+ KCmdLineArgs::init( argc, argv, &about );
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KApplication app;
+
+ // Read MDI mode
+ KConfig *c = app.config();
+ TQString strMode = c->readEntry("MDIMode", "ideal");
+ KMdi::MdiMode mode = KMdi::IDEAlMode;
+ if (strMode == "toplevel") {
+ mode = KMdi::ToplevelMode;
+ }
+ else if (strMode == "childframe") {
+ mode = KMdi::ChildframeMode;
+ }
+ else if (strMode == "tabpage") {
+ mode = KMdi::TabPageMode;
+ }
+
+ // Create main window
+ RemoteMDI *mainWin = new RemoteMDI(mode);
+ app.setMainWidget(mainWin);
+
+ KCmdLineArgs* const args = KCmdLineArgs::parsedArgs();
+ if (args->count() > 0) mainWin->setServerHost(args->arg(0));
+ args->clear();
+
+ mainWin->show();
+
+ // mainWin has WDestructiveClose flag by default, so it will delete itself.
+ return app.exec();
+}