• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
src/main.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  -----------------------------------------------------------------------
4 
5  begin : Thu Mar 11 20:50:53 MET 1999
6 
7  copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
8  (C) 2006 Peter Hedlund <peter.hedlund@kdemail.net>
9  (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
10 
11  -----------------------------------------------------------------------
12 
13  ***************************************************************************/
14 
15 /***************************************************************************
16  * *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or *
20  * (at your option) any later version. *
21  * *
22  ***************************************************************************/
23 
24 #include <kcmdlineargs.h>
25 #include <kaboutdata.h>
26 #include <klocale.h>
27 #include <kapplication.h>
28 
29 #include "parleymainwindow.h"
30 //#include "practice/parleypracticemainwindow.h"
31 #include "version.h"
32 
33 
34 int main(int argc, char* argv[])
35 {
36  static const char description[] = I18N_NOOP("Vocabulary Trainer");
37  static const char version[] = PARLEY_VERSION_STRING;
38 
39  KAboutData aboutData("parley", 0,
40  ki18n("Parley"),
41  version,
42  ki18n(description),
43  KAboutData::License_GPL,
44  ki18n("© 1999-2002\tEwald Arnold\n"
45  "© 2001-2002\tThe KDE team\n"
46  "© 2004-2007\tPeter Hedlund\n"
47  "© 2007-2010\tFrederik Gladhorn\n"),
48  ki18n("Helps you train your vocabulary"),
49  "http://edu.kde.org/parley",
50  "submit@bugs.kde.org");
51 
52  aboutData.addAuthor(ki18n("Frederik Gladhorn"),
53  ki18n("Developer and maintainer"),
54  "gladhorn@kde.org");
55 
56  aboutData.addAuthor(ki18n("Daniel Laidig"),
57  ki18n("Developer"),
58  "d.laidig@gmx.de");
59 
60  aboutData.addAuthor(ki18n("David Capel"),
61  ki18n("Practice Dialogs"),
62  "wot.narg@gmail.com");
63 
64  aboutData.addAuthor(ki18n("Avgoustinos Kadis"),
65  ki18n("Scripting"),
66  "avgoustinos.kadis@kdemail.net");
67 
68  aboutData.addAuthor(ki18n("Peter Hedlund"),
69  ki18n("Countless fixes, former maintainer, port to KDE4"),
70  "peter.hedlund@kdemail.net");
71 
72  aboutData.addAuthor(ki18n("Ewald Arnold"), ki18n("Original Author"),
73  "kvoctrain@ewald-arnold.de",
74  "http://www.ewald-arnold.de");
75 
76  aboutData.addCredit(ki18n("Lee Olson"),
77  ki18n("Artwork and Oxygen Icons"));
78 
79  aboutData.addCredit(ki18n("Anne-Marie Mahfouf"),
80  ki18n("Port to KConfig XT"));
81 
82  aboutData.addCredit(ki18n("Jeremy Whiting"),
83  ki18n("Rewriting the kvtml library for KDE4"));
84 
85  aboutData.addCredit(ki18n("Markus Büchele"),
86  ki18n("Bug reports and testing on the way to KDE4"));
87 
88  aboutData.addCredit(ki18n("Ramona Knapp"),
89  ki18n("Conceived the name Parley"));
90 
91  KCmdLineArgs::init(argc, argv, &aboutData);
92 
93  KCmdLineOptions options;
94 // options.add("e").add("edit", ki18n("Start the editor part of Parley"));
95  options.add("p").add("practice", ki18n("Start practice instead of editor"));
96  options.add(I18N_NOOP("+[file]"), ki18n("Document file to open"));
97 
98  KCmdLineArgs::addCmdLineOptions(options);
99 
100  KApplication app;
101  app.setQuitOnLastWindowClosed(false);
102 
103  // for i18n of the lib strings
104  KGlobal::locale()->insertCatalog("libkdeedu");
105 
106  if (app.isSessionRestored()) {
107  int n = 1;
108  while (KMainWindow::canBeRestored(n)){
109  (new ParleyMainWindow())->restore(n);
110  n++;
111  }
112  return app.exec();
113  } else {
114  KMainWindow *parleyApp;
115 
116  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
117 
118  bool practiceMode = false;
119 
120  if (args) {
121  practiceMode = args->isSet("p");
122  }
123 
124  if (args && args->count() > 0) {
126  parleyApp = new ParleyMainWindow(args->url(0));
127  args->clear();
128  } else {
129 // if (practiceMode) {
130 // parleyApp = new ParleyPracticeMainWindow();
131 // } else {
132  parleyApp = new ParleyMainWindow();
133 // }
134  }
135  if (args) {
136  args->clear();
137  }
138  parleyApp->show();
139  return app.exec();
140  }
141 }
142 
PARLEY_VERSION_STRING
#define PARLEY_VERSION_STRING
Definition: version.h:3
ParleyMainWindow
Definition: parleymainwindow.h:68
main
int main(int argc, char *argv[])
Definition: src/main.cpp:34
version.h
parleymainwindow.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal