From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksplashml/main.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 ksplashml/main.cpp (limited to 'ksplashml/main.cpp') diff --git a/ksplashml/main.cpp b/ksplashml/main.cpp new file mode 100644 index 000000000..c1208cc3b --- /dev/null +++ b/ksplashml/main.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright Brian Ledbetter 2001-2003 * + * Copyright Ravikiran Rajagopal 2003 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License (version 2) as * + * published by the Free Software Foundation. (The original KSplash/ML * + * codebase (upto version 0.95.3) is BSD-licensed.) * + * * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "wndmain.h" + +static KCmdLineOptions options[] = { + { "managed", I18N_NOOP("Execute KSplash in MANAGED mode"),0 }, + { "test", I18N_NOOP("Run in test mode"), 0 }, + { "nofork", I18N_NOOP("Do not fork into the background"), 0 }, + { "theme ", I18N_NOOP("Override theme"), "" }, + { "nodcop", I18N_NOOP("Do not attempt to start DCOP server"),0 }, + { "steps ", I18N_NOOP("Number of steps"), "7" }, + KCmdLineLastOption +}; + +int main( int argc, char **argv ) +{ + KAboutData about( + "ksplash", + I18N_NOOP("KSplash"), + VERSION, + I18N_NOOP("KDE splash screen"), + KAboutData::License_GPL, + I18N_NOOP("(c) 2001 - 2003, Flaming Sword Productions\n (c) 2003 KDE developers"), + "http://www.kde.org"); + about.addAuthor( "Ravikiran Rajagopal", I18N_NOOP("Author and maintainer"), "ravi@ee.eng.ohio-state.edu" ); + about.addAuthor( "Brian Ledbetter", I18N_NOOP("Original author"), "brian@shadowcom.net" ); + + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KCmdLineArgs *arg = KCmdLineArgs::parsedArgs(); + + if( arg->isSet( "fork" ) ) + { + if (fork()) + exit(0); + } + + if ( !( arg->isSet( "dcop" ) ) ) + KApplication::disableAutoDcopRegistration(); + else if ( KApplication::dcopClient()->attach() ) + KApplication::dcopClient()->registerAs( "ksplash", false ); + + KApplication app; + + KSplash wndMain("ksplash"); + if ( arg->isSet( "steps" ) ) + { + int steps = QMAX( arg->getOption( "steps" ).toInt(), 0 ); + if ( steps ) + wndMain.setStartupItemCount( steps ); + } + + app.setMainWidget(&wndMain); + app.setTopWidget(&wndMain); + return(app.exec()); +} -- cgit v1.2.1