diff options
author | Timothy Pearson <[email protected]> | 2013-07-24 11:49:27 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-07-24 11:49:27 -0500 |
commit | c3f8ee64e905cdb103b5bfa07525fb4e85c31120 (patch) | |
tree | 46eabe44a1b3af79971dcafb743a104af8e18e69 /src/main.cpp | |
download | kasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.tar.gz kasablanca-c3f8ee64e905cdb103b5bfa07525fb4e85c31120.zip |
Initial import of kasablanca 0.4.0.2
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..834d499 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2004 Magnus Kulke <mkulke@magnusmachine> + */ + +#include "kasablanca.h" +#include <kapplication.h> +#include <dcopclient.h> +#include <kaboutdata.h> +#include <kcmdlineargs.h> +#include <klocale.h> + +static const char description[] = + I18N_NOOP("A KDE Ftp Client"); + +static const char version[] = "0.4.0.2"; + +static KCmdLineOptions options[] = +{ +// { "+[URL]", I18N_NOOP( "Document to open." ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KLocale::setMainCatalogue("kasablanca"); + + KAboutData about("kasablanca", I18N_NOOP("kasablanca"), version, description, + KAboutData::License_GPL, "(C) 2004 Magnus Kulke", 0, 0, + "[email protected]"); + about.addAuthor( "Magnus Kulke", 0, "[email protected]" ); + about.addAuthor( "Big Biff", 0, "[email protected]" ); + about.addCredit( "Stefan Bogner", 0, "[email protected]" ); + about.addCredit( "Christoph Thielecke", 0, "[email protected]" ); + about.addCredit( "Richard Stellingwerf", 0, "[email protected]" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + // register ourselves as a dcop client + app.dcopClient()->registerAs(app.name(), false); + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(Kasablanca); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + Kasablanca *widget = new Kasablanca; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + Kasablanca *widget = new Kasablanca; + widget->show(); +// TODO: Load the ftp url passed on the command line. +// widget->load(args->url(i)); + } + } + args->clear(); + } + + return app.exec(); +} + |