koshell
koshell_main.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <kofficeversion.h>
00022 #include <kaboutdata.h>
00023 #include <kcmdlineargs.h>
00024 #include <kdebug.h>
00025 #include <klocale.h>
00026 #include <kuniqueapplication.h>
00027 #include <kwin.h>
00028
00029 #include <KoGlobal.h>
00030
00031 #include "koshell_shell.h"
00032
00033 static const char* description = I18N_NOOP("KOffice Workspace");
00034 static const char* version = KOFFICE_VERSION_STRING;
00035
00036 class KoShellApp : public KUniqueApplication {
00037 public:
00038 KoShellApp() : mMainWindow( 0 ) {}
00039 ~KoShellApp() {}
00040
00041 int newInstance();
00042
00043 private:
00044 KoShellWindow *mMainWindow;
00045 };
00046
00047
00048 int KoShellApp::newInstance()
00049 {
00050 if ( isRestored() ) {
00051
00052 if ( KMainWindow::canBeRestored( 1 ) ) {
00053 mMainWindow = new KoShellWindow();
00054 setMainWidget( mMainWindow );
00055 mMainWindow->show();
00056 mMainWindow->restore( 1 );
00057 }
00058 } else {
00059 if ( !mMainWindow ) {
00060 mMainWindow = new KoShellWindow();
00061 mMainWindow->show();
00062 setMainWidget( mMainWindow );
00063 }
00064 }
00065
00066
00067 return KUniqueApplication::newInstance();
00068 }
00069
00070 extern "C" KOSHELL_EXPORT int kdemain( int argc, char **argv )
00071 {
00072 KAboutData * aboutData = new KAboutData( "koshell", I18N_NOOP("KOffice Workspace"),
00073 version, description, KAboutData::License_GPL,
00074 "(c) 1998-2006, Torben Weis\n(c) 2002-2005, David Faure\n(c) 2005, Sven Lüppken");
00075 aboutData->addAuthor("Sven Lüppken", I18N_NOOP("Current Maintainer"), "sven@kde.org");
00076 aboutData->addAuthor("Torben Weis", 0, "weis@kde.org");
00077 aboutData->addAuthor("David Faure", 0, "faure@kde.org");
00078 KCmdLineArgs::init( argc, argv, aboutData );
00079
00080 if ( !KoShellApp::start() ) {
00081
00082 return 0;
00083 }
00084 KoShellApp app;
00085
00086 KoGlobal::initialize();
00087
00088 return app.exec();
00089 }
00090
|