File indexing completed on 2024-09-15 03:28:21
0001 /* 0002 This file is part of Kiten, a KDE Japanese Reference Tool 0003 SPDX-FileCopyrightText: 2006 Joseph Kerian <jkerian@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include <QApplication> 0009 #include <QCommandLineParser> 0010 #include <QIcon> 0011 0012 #include <KAboutData> 0013 #include <KLocalizedString> 0014 0015 #include "radselect.h" 0016 0017 int main(int argc, char **argv) 0018 { 0019 QApplication app(argc, argv); 0020 app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kiten"), app.windowIcon())); 0021 KLocalizedString::setApplicationDomain("kiten"); 0022 0023 KAboutData about(QStringLiteral("kitenradselect"), 0024 i18n("Radical Selector"), 0025 QStringLiteral("0.1"), 0026 i18n("A KDE Application"), 0027 KAboutLicense::GPL, 0028 i18n("(C) 2005 Joseph Kerian"), 0029 QString(), 0030 QString(), 0031 QStringLiteral("jkerian@gmail.com")); 0032 about.addAuthor(i18n("Joseph Kerian"), QString(), QStringLiteral("jkerian@gmail.com")); 0033 about.addCredit(i18n("Electronic Dictionary Research and Development Group"), 0034 i18n("This program uses the KANJIDIC and RADKFILE dictionary files. These files are the property of the Electronic Dictionary Research and " 0035 "Development Group, and are used in conformance with the Group's licence."), 0036 QString(), 0037 QStringLiteral("https://www.edrdg.org/")); 0038 about.setOrganizationDomain("kde.org"); // For DBus domain 0039 0040 QCommandLineParser parser; 0041 KAboutData::setApplicationData(about); 0042 0043 about.setupCommandLine(&parser); 0044 parser.addPositionalArgument(QStringLiteral("Search_String"), i18n("Initial Search String from Kiten")); 0045 parser.process(app); 0046 about.processCommandLine(&parser); 0047 0048 #ifdef Q_OS_WIN 0049 QApplication::setStyle(QStringLiteral("breeze")); 0050 #endif 0051 0052 // see if we are starting with session management 0053 if (app.isSessionRestored()) { 0054 kRestoreMainWindows<RadSelect>(); 0055 } else { 0056 // no session.. just start up normally 0057 0058 auto widget = new RadSelect(); 0059 widget->show(); 0060 0061 if (parser.positionalArguments().count() >= 1) { 0062 const QStringList args = parser.positionalArguments(); 0063 widget->loadSearchString(args.first()); 0064 } 0065 } 0066 0067 return app.exec(); 0068 }