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.15 2003/10/13 21:33:27 goossens 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 #ifdef DEBUG
00055     {"debug <level>", I18N_NOOP("Set debugging level"), "0"},
00056 #endif
00057     KCmdLineLastOption
00058 } ;
00059 
00060 int main(int argc, char **argv)
00061 {
00062     FUNCTIONSETUP;
00063 
00064     KAboutData about("kpilotConfig", I18N_NOOP("KPilot Configurator"),
00065         KPILOT_VERSION,
00066         "KPilot Configurator",
00067         KAboutData::License_GPL, "(c) 2001, Dan Pilone");
00068     about.addAuthor("Dan Pilone",
00069         I18N_NOOP("Project Leader"),
00070         "pilone@slac.com", "http://www.slac.com/pilone/kpilot_home/");
00071     about.addAuthor("Adriaan de Groot",
00072         I18N_NOOP("Maintainer"),
00073         "groot@kde.org", "http://www.cs.kun.nl/~adridg/kpilot/");
00074 
00075     KCmdLineArgs::init(argc, argv, &about);
00076     KCmdLineArgs::addCmdLineOptions(kpilotoptions,"kpilotconfig");
00077     KApplication::addCmdLineOptions();
00078     KCmdLineArgs *p = KCmdLineArgs::parsedArgs();
00079 
00080     KApplication a;
00081 
00082 #ifdef DEBUG
00083     KPilotConfig::getDebugLevel(p);
00084 #endif
00085 
00086     int r = 0;
00087 
00088     if (p->isSet("conduits"))
00089     {
00090         ConduitConfigDialog *d = new ConduitConfigDialog(0L,
00091             "conduitConfig",true);
00092         r = d->exec();
00093     }
00094     else
00095     {
00096         KDialogBase *d = new KPilotConfigDialog(0L, "configDialog", true);
00097         r = d->exec();
00098     }
00099 
00100     if (r)
00101     {
00102 #ifdef DEBUG
00103         DEBUGKPILOT << fname << ": Configuration was okayed." << endl;
00104 #endif
00105     }
00106     else
00107     {
00108 #ifdef DEBUG
00109         DEBUGKPILOT << fname
00110             << ": Configuration was canceled." << endl;
00111 #endif
00112     }
00113 
00114     return r;
00115 
00116     /* NOTREACHED */
00117     (void) config_id;
00118 }
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:48 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003