1/***************************************************************************
2 main.cpp - description
3 -------------------
4 begin : Die Apr 10 19:46:49 CEST 2001
5 copyright : (C) 2001 by Jan Sch�er
6 email : j_schaef@informatik.uni-kl.de
7***************************************************************************/
8
9/***************************************************************************
10* *
11* This program is free software; you can redistribute it and/or modify *
12* it under the terms of the GNU General Public License as published by *
13* the Free Software Foundation; either version 2 of the License, or *
14* (at your option) any later version. *
15* *
16***************************************************************************/
17
18#include <kcmdlineargs.h>
19#include <kaboutdata.h>
20#include <klocale.h>
21#include <kapplication.h>
22
23#include "kimeshell.h"
24#include "version.h"
25
26static const char *description =
27 I18N_NOOP("An HTML imagemap editor");
28// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
29
30
31int main(int argc, char *argv[])
32{
33
34 KAboutData aboutData( "kimagemapeditor", 0, ki18n("KImageMapEditor"),
35 KIMAGEMAPEDITOR_VERSION, ki18n(description), KAboutData::License_GPL,
36 ki18n("(c) 2001-2007 Jan Schaefer"), KLocalizedString(), "http://kde.org/applications/development/kimagemapeditor/", "janschaefer@users.sourceforge.net");
37 aboutData.addAuthor(ki18n("Jan Schaefer"),KLocalizedString(), "janschaefer@users.sourceforge.net");
38 aboutData.addCredit(ki18n("Joerg Jaspert"),ki18n("For helping me with the Makefiles, and creating the Debian package"));
39 aboutData.addCredit(ki18n("Aaron Seigo and Michael"),ki18n("For helping me fixing --enable-final mode"));
40 aboutData.addCredit(ki18n("Antonio Crevillen"),ki18n("For the Spanish translation"));
41 aboutData.addCredit(ki18n("Fabrice Mous"),ki18n("For the Dutch translation"));
42 aboutData.addCredit(ki18n("Germain Chazot"),ki18n("For the French translation"));
43 KCmdLineArgs::init( argc, argv, &aboutData );
44
45 KCmdLineOptions options;
46 options.add("c");
47 options.add("stdout", ki18n("Write HTML-Code to stdout on exit"));
48 options.add("+[File]", ki18n("File to open"));
49 KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
50
51
52
53 KApplication a;
54
55 if (a.isSessionRestored())
56 {
57 RESTORE(KimeShell);
58 }
59 else
60 {
61 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
62 if ( args->count() == 0 )
63 {
64 KimeShell *kimeShell = new KimeShell();
65 kimeShell->setStdout(args->isSet("stdout"));
66 kimeShell->readConfig();
67 kimeShell->show();
68 kimeShell->openLastFile();
69 }
70 else
71 {
72 int i = 0;
73 for (; i < args->count(); i++ )
74 {
75 KimeShell *kimeShell = new KimeShell();
76 kimeShell->setStdout(args->isSet("stdout"));
77 kimeShell->readConfig();
78 kimeShell->show();
79 kimeShell->openFile(args->url(i));
80 }
81 }
82 args->clear();
83 }
84
85 return a.exec();
86}
87