1/***************************************************************************
2 main.cpp - description
3 -------------------
4 begin : Mon Aug 26 15:41:23 CEST 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.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
19#include <kcmdlineargs.h>
20#include <kaboutdata.h>
21#include <klocale.h>
22#include <kuniqueapplication.h>
23
24#include "kmouth.h"
25#include "version.h"
26
27static const char description[] =
28 I18N_NOOP("A type-and-say front end for speech synthesizers");
29// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
30
31
32int main(int argc, char *argv[])
33{
34
35 KAboutData aboutData( "kmouth", 0, ki18n("KMouth"),
36 KMOUTH_VERSION, ki18n(description), KAboutData::License_GPL,
37 ki18n("(c) 2002/2003, Gunnar Schmi Dt"), KLocalizedString(), "http://www.schmi-dt.de/kmouth/index.en.html", "kmouth@schmi-dt.de");
38 aboutData.addAuthor(ki18n("Gunnar Schmi Dt"),KLocalizedString(), "kmouth@schmi-dt.de");
39 KCmdLineArgs::init( argc, argv, &aboutData );
40
41 KCmdLineOptions options;
42 options.add("+[File]", ki18n("History file to open"));
43 KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
44
45 aboutData.addCredit(ki18n("Olaf Schmidt"), ki18n("Tips, extended phrase books"));
46 KApplication app;
47
48 if (app.isSessionRestored())
49 {
50 RESTORE(KMouthApp);
51 }
52 else
53 {
54 KMouthApp *kmouth = new KMouthApp();
55 if (!kmouth->configured())
56 return 0;
57
58 kmouth->show();
59
60 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
61
62 if (args->count())
63 {
64 kmouth->openDocumentFile(args->url(0));
65 }
66 args->clear();
67 }
68 return app.exec();
69}
70