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 "http://utils.kde.org/projects/kfloppy"
00047 );
00048
00049 aboutData.addAuthor(ki18n("Bernd Johannes Wuebben"), ki18n("Author and former maintainer"), "wuebben@kde.org");
00050 aboutData.addCredit(ki18n("Chris Howells"), ki18n("User interface re-design"), "howells@kde.org");
00051 aboutData.addCredit(ki18n("Adriaan de Groot"), ki18n("Add BSD support"), "groot@kde.org");
00052 aboutData.addCredit(ki18n("Nicolas Goutte"), ki18n("Make KFloppy work again for KDE 3.4"), "goutte@kde.org");
00053
00054 KCmdLineArgs::init( argc, argv, &aboutData );
00055
00056 KCmdLineOptions options;
00057 options.add("+[device]", ki18n("Default device"));
00058 KCmdLineArgs::addCmdLineOptions( options );
00059
00060 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00061 QString device;
00062 if (args->count()) {
00063 device = args->arg(0);
00064 }
00065 args->clear();
00066
00067 KApplication a;
00068
00069 FloppyData* floppy = new FloppyData();
00070 bool autoformat = floppy->setInitialDevice(device);
00071 floppy->show();
00072 if (autoformat)
00073 floppy->format();
00074 return a.exec();
00075 }
00076