File indexing completed on 2024-04-21 03:42:04
0001 /* 0002 SPDX-FileCopyrightText: 2001-2011 Anne-Marie Mahfouf <annma@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 /*****************************************************/ 0008 /* Please save with utf8 encoding, thanks */ 0009 /*****************************************************/ 0010 #include <QApplication> 0011 #include <QCommandLineParser> 0012 0013 #include <KLocalizedString> 0014 #include <KCrash> 0015 #include <KAboutData> 0016 #include "klettres.h" 0017 #include "klettres_version.h" 0018 0019 int main(int argc, char **argv) 0020 { 0021 QApplication app(argc, argv); 0022 KLocalizedString::setApplicationDomain(QByteArrayLiteral("klettres")); 0023 0024 KAboutData about(QStringLiteral("klettres"), i18n("KLettres"), QStringLiteral(KLETTRES_VERSION_STRING), i18n("KLettres helps a very young child or an adult learning \n" 0025 "a new language by associating sounds and \n" 0026 "letters in this language.\n\n" 0027 "25 languages are available."), 0028 KAboutLicense::GPL, i18n("(C) 2001-2011 Anne-Marie Mahfouf"),QString(), QStringLiteral("https://edu.kde.org/klettres"), QStringLiteral("submit@bugs.kde.org")); 0029 about.addAuthor( i18n("Anne-Marie Mahfouf"), QString(), QStringLiteral("annma AT kde DOT org"), QStringLiteral("https://annma.blogspot.com"), QStringLiteral("annma")); 0030 about.addCredit(i18n("Marc Cheng"), 0031 i18n("Kids and grown-up oxygen icons"), QStringLiteral("bdgraue AT web DOT de")); 0032 about.addCredit(i18n("Danny Allen"), 0033 i18n("SVG background pictures"), QStringLiteral("dannya40uk AT yahoo DOT co DOT uk")); 0034 about.addCredit(i18n("Robert Gogolok"), 0035 i18n("Support and coding guidance"), QStringLiteral("mail AT robert-gogolok DOT de")); 0036 about.addCredit(i18n("Peter Hedlund"), 0037 i18n("Code for generating special characters' icons"), QStringLiteral("peter DOT hedlund AT kdemail DOT net")); 0038 about.addCredit(i18n("Waldo Bastian"), 0039 i18n("Port to KConfig XT, coding help"), QStringLiteral("bastian AT kde DOT org")); 0040 about.addCredit(i18n("Pino Toscano"), 0041 i18n("Code cleaning, Theme class"), QStringLiteral("toscano DOT pino AT tiscali DOT it")); 0042 about.addCredit(i18n("Michael Goettsche"), 0043 i18n("Timer setting widgets"), QStringLiteral("michael.goettsche AT kdemail DOT net")); 0044 about.addCredit(i18n("Laurent Navet"), 0045 i18n("Port to KDE Frameworks 5"), QStringLiteral("laurent DOT navet+klettres AT gmail DOT com")); 0046 QCommandLineParser parser; 0047 KAboutData::setApplicationData(about); 0048 about.setupCommandLine(&parser); 0049 parser.process(app); 0050 about.processCommandLine(&parser); 0051 0052 app.setApplicationName(QStringLiteral("klettres")); 0053 app.setApplicationVersion(QStringLiteral(KLETTRES_VERSION_STRING)); 0054 app.setOrganizationDomain(QStringLiteral("kde.org")); 0055 0056 QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("klettres"))); 0057 KCrash::initialize(); 0058 0059 // see if we are starting with session management 0060 if (app.isSessionRestored()) { 0061 kRestoreMainWindows<KLettres>(); 0062 } else { 0063 // no session.. just start up normally 0064 if (parser.positionalArguments().isEmpty()) { 0065 KLettres *widget = new KLettres; 0066 widget->show(); 0067 } else { 0068 int i = 0; 0069 for (; i < parser.positionalArguments().count(); i++) { 0070 KLettres *widget = new KLettres; 0071 widget->show(); 0072 } 0073 } 0074 } 0075 0076 return app.exec(); 0077 } 0078