kfloppy
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
00019
00020
00021
00022
00023
00024
00025 #include <kdeversion.h>
00026 #include <kapplication.h>
00027 #include <kcmdlineargs.h>
00028 #include <kaboutdata.h>
00029 #include <klocale.h>
00030 #include "floppy.h"
00031
00032
00033 static const char description[] =
00034 I18N_NOOP("KDE Floppy Disk Utility");
00035
00036 int main( int argc, char *argv[] )
00037 {
00038 KAboutData aboutData("kfloppy", 0,
00039 ki18n("KFloppy"),
00040 KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL,
00041 ki18n("(c) 1997, Bernd Johannes Wuebben\n"
00042 "(c) 2001, Chris Howells\n"
00043 "(c) 2002, Adriaan de Groot\n"
00044 "(c) 2004, 2005, Nicolas Goutte"),
00045 ki18n("KFloppy helps you format floppies with the filesystem of your choice.")
00046 );
00047
00048 aboutData.addAuthor(ki18n("Bernd Johannes Wuebben"), ki18n("Author and former maintainer"), "wuebben@kde.org");
00049 aboutData.addCredit(ki18n("Chris Howells"), ki18n("User interface re-design"), "howells@kde.org");
00050 aboutData.addCredit(ki18n("Adriaan de Groot"), ki18n("Add BSD support"), "groot@kde.org");
00051 aboutData.addCredit(ki18n("Nicolas Goutte"), ki18n("Make KFloppy work again for KDE 3.4"), "goutte@kde.org");
00052
00053 KCmdLineArgs::init( argc, argv, &aboutData );
00054
00055 KCmdLineOptions options;
00056 options.add("+[device]", ki18n("Default device"));
00057 KCmdLineArgs::addCmdLineOptions( options );
00058
00059 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00060 QString device;
00061 if (args->count()) {
00062 device = args->arg(0);
00063 }
00064 args->clear();
00065
00066 KApplication a;
00067
00068 FloppyData* floppy = new FloppyData();
00069 bool autoformat = floppy->setInitialDevice(device);
00070 floppy->show();
00071 if (autoformat)
00072 floppy->format();
00073 return a.exec();
00074 }
00075