src/core/main.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2003-2005 by David Saxton                               *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #include "ktechlab.h"
00012 #include "config.h"
00013 
00014 #include <dcopclient.h>
00015 #include <kaboutdata.h>
00016 #include <kapplication.h>
00017 #include <kcmdlineargs.h>
00018 #include <kconfig.h>
00019 #include <klocale.h>
00020 
00021 static const char description[] =
00022     I18N_NOOP("An IDE for microcontrollers and electronics");
00023 
00024 static KCmdLineOptions options[] =
00025 {
00026     { "+[URL]", I18N_NOOP( "Document to open." ), 0 },
00027     KCmdLineLastOption
00028 };
00029 
00030 
00031 int main(int argc, char **argv)
00032 {
00033 /* FIXME: should use package names found in config.h provided by autoconf */
00034 
00035     KAboutData about("ktechlab", I18N_NOOP("KTechlab"), VERSION, description,
00036                                          KAboutData::License_GPL, "(C) 2003-2005, The KTechlab developers", "", "http://ktechlab.org", "ktechlab-devel@lists.sourceforge.net" );
00037     about.addAuthor( "David Saxton", 0, "david@bluehaze.org" );
00038         about.addAuthor( "Daniel Clarke", 0, "daniel.jc@gmail.com" );
00039         about.addCredit( "Couriousous", "JK flip-flop, asyncronous preset/reset in the D flip-flop." );
00040         about.addCredit( "John Myers", "Rotary Switch" );
00041         about.addCredit( "Ali Akcaagac", "Glib friendliness." );
00042         about.addCredit( "David Leggett", "Website hosting and feedback during early development." );
00043     KCmdLineArgs::init(argc, argv, &about);
00044     KCmdLineArgs::addCmdLineOptions(options);
00045     KApplication app;
00046         
00047     // register ourselves as a dcop client
00048         app.dcopClient()->registerAs(app.name(), false);
00049         
00050         KTechlab *ktechlab = new KTechlab();
00051         
00052         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00053         for ( int i=0; i < args->count(); ++i )
00054                 ktechlab->load( args->url(i) );
00055         
00056         ktechlab->show();
00057         args->clear(); // Free up some memory
00058         return app.exec();
00059 }

Generated on Tue May 8 17:05:31 2007 for KTechLab by  doxygen 1.5.1