kpilot Library API Documentation

main-config.cc

00001 /* main-config.cc                  KPilot
00002 **
00003 ** Copyright (C) 1998-2001 by Dan Pilone
00004 **
00005 ** This is a non-installed application that exercises the
00006 ** configuration dialog and config code for KPilot.
00007 */
00008 
00009 /*
00010 ** This program is free software; you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation; either version 2 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018 ** GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program in a file called COPYING; if not, write to
00022 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00023 ** MA 02111-1307, USA.
00024 */
00025 
00026 /*
00027 ** Bug reports and questions can be sent to kde-pim@kde.org
00028 */
00029 
00030 
00031 static const char *config_id =
00032         "$Id: main-config.cc,v 1.9.4.2 2003/03/12 23:31:14 adridg Exp $";
00033 
00034 
00035 #include "options.h"
00036 
00037 #include <stdlib.h>
00038 
00039 #include <qcombobox.h>
00040 #include <qvbox.h>
00041 
00042 
00043 #include <kapplication.h>
00044 #include <kcmdlineargs.h>
00045 #include <kaboutdata.h>
00046 
00047 #include "kpilotConfigDialog.h"
00048 #include "conduitConfigDialog.h"
00049 #include "kpilotConfig.h"
00050 
00051 static KCmdLineOptions kpilotoptions[] = {
00052         { "c",0,0 },
00053         { "conduits", I18N_NOOP("Configure conduits instead."), 0},
00054         { 0,0,0 }
00055 } ;
00056 
00057 int main(int argc, char **argv)
00058 {
00059         FUNCTIONSETUP;
00060 
00061         KAboutData about("kpilotConfig", I18N_NOOP("KPilot Configurator"),
00062                 KPILOT_VERSION,
00063                 "KPilot Configurator",
00064                 KAboutData::License_GPL, "(c) 2001, Dan Pilone");
00065         about.addAuthor("Dan Pilone",
00066                 I18N_NOOP("Project Leader"),
00067                 "pilone@slac.com", "http://www.slac.com/pilone/kpilot_home/");
00068         about.addAuthor("Adriaan de Groot",
00069                 I18N_NOOP("Maintainer"),
00070                 "groot@kde.org", "http://www.cs.kun.nl/~adridg/kpilot/");
00071 
00072         KCmdLineArgs::init(argc, argv, &about);
00073 #ifdef DEBUG
00074         KCmdLineArgs::addCmdLineOptions(debug_options, "debug", "debug");
00075 #endif
00076         KCmdLineArgs::addCmdLineOptions(kpilotoptions,"kpilotconfig",0L,"debug");
00077         KApplication::addCmdLineOptions();
00078         KCmdLineArgs *p = KCmdLineArgs::parsedArgs();
00079 
00080         KApplication a;
00081 
00082         KPilotConfig::getDebugLevel(true);
00083 
00084         int r = 0;
00085 
00086         if (p->isSet("conduits"))
00087         {
00088                 ConduitConfigDialog *d = new ConduitConfigDialog(0L,
00089                         "conduitConfig",true);
00090                 r = d->exec();
00091         }
00092         else
00093         {
00094                 KDialogBase *d = new KPilotConfigDialog(0L, "configDialog", true);
00095                 r = d->exec();
00096         }
00097 
00098         if (r)
00099         {
00100 #ifdef DEBUG
00101                 DEBUGKPILOT << fname << ": Configuration was okayed." << endl;
00102 #endif
00103         }
00104         else
00105         {
00106 #ifdef DEBUG
00107                 DEBUGKPILOT << fname
00108                         << ": Configuration was cancelled." << endl;
00109 #endif
00110         }
00111 
00112         return r;
00113 
00114         /* NOTREACHED */
00115         (void) config_id;
00116 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:44 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001