keduca
main.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <kcmdlineargs.h>
00019 #include <kapplication.h>
00020 #include <kaboutdata.h>
00021 #include <kdebug.h>
00022
00023 #include <qfileinfo.h>
00024 #include "keducabuilder.h"
00025
00026 static const char description[] = I18N_NOOP("Form-based tests and exams builder");
00027 static const char version[] = "1.2.0";
00028
00029 static KCmdLineOptions options[] =
00030 {
00031 { "+file", I18N_NOOP("File to load"), 0 },
00032 KCmdLineLastOption
00033 };
00034
00035 int main(int argc, char *argv[])
00036 {
00037 KAboutData aboutData( "keduca", I18N_NOOP("KEducaBuilder"),
00038 version, description, KAboutData::License_GPL,
00039 "(c) 2001, Javier Campos", 0, "http://keduca.sourceforge.net", "submit@bugs.kde.org");
00040 aboutData.addAuthor("Javier Campos",I18N_NOOP("Original Author"), "javi@asyris.org");
00041 aboutData.addAuthor("Klas Kalass",I18N_NOOP("Maintainer 2002-2004"), "klas@kde.org");
00042 aboutData.addAuthor("Anne-Marie Mahfouf",I18N_NOOP("Various fixes and cleanups"), "annma@kde.org");
00043 aboutData.addCredit("Nenad Grujicic", I18N_NOOP("Icons"), "mengele@linuxo.org");
00044 KCmdLineArgs::init( argc, argv, &aboutData );
00045 KCmdLineArgs::addCmdLineOptions( options );
00046
00047 KApplication a;
00048 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00049
00050
00051 KEducaBuilder *keducaEditor = new KEducaBuilder();
00052 a.setMainWidget(keducaEditor);
00053 keducaEditor->show();
00054
00055 if ( args->count() > 0 ){
00056 if( QFileInfo( KURL(args->url(0)).url() ).extension() == "edugallery" )
00057 keducaEditor->initGallery( args->url(0) );
00058 else
00059 keducaEditor->slotFileOpenURL( args->url(0) );
00060 }else
00061 keducaEditor->startChooser();
00062
00063
00064 args->clear();
00065
00066 return a.exec();
00067 }