File indexing completed on 2022-09-27 12:25:39

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 <QIcon>
0010 #include <QCommandLineParser>
0011 
0012 #include <KAboutData>
0013 #include <KLocalizedString>
0014 
0015 #include "radselect.h"
0016 
0017 static const char version[] = "0.1";
0018 
0019 int main( int argc, char **argv )
0020 {
0021   QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
0022   QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
0023 
0024   QApplication app(argc, argv);
0025   app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kiten"), app.windowIcon()));
0026   KLocalizedString::setApplicationDomain("kiten");
0027   
0028   KAboutData about( QStringLiteral("kitenradselect"), i18n("Radical Selector"), version,
0029                     i18n("A KDE Application"), KAboutLicense::GPL,
0030                     i18n("(C) 2005 Joseph Kerian"), QString(), QString(), QStringLiteral("jkerian@gmail.com") );
0031   about.addAuthor( i18n("Joseph Kerian"), QString(), QStringLiteral("jkerian@gmail.com") );
0032   about.addCredit( i18n("Electronic Dictionary Research and Development Group"), i18n("This program uses the KANJIDIC and RADKFILE dictionary files. These files are the property of the Electronic Dictionary Research and Development Group, and are used in conformance with the Group's licence."), QString(), QStringLiteral("https://www.edrdg.org/") );
0033   about.setOrganizationDomain("kde.org"); //For DBus domain
0034 
0035   QCommandLineParser parser;
0036   KAboutData::setApplicationData(about);
0037   
0038   about.setupCommandLine(&parser);
0039   parser.addPositionalArgument(QStringLiteral("Search_String"), i18n( "Initial Search String from Kiten" ));
0040   parser.process(app);
0041   about.processCommandLine(&parser);
0042 
0043 #ifdef Q_OS_WIN
0044   QApplication::setStyle(QStringLiteral("breeze"));
0045 #endif
0046 
0047   // see if we are starting with session management
0048   if ( app.isSessionRestored() )
0049   {
0050     kRestoreMainWindows<RadSelect>();
0051   }
0052   else
0053   {
0054     // no session.. just start up normally
0055 
0056     RadSelect *widget = new RadSelect();
0057     widget->show();
0058 
0059     if ( parser.positionalArguments().count() >=  1 )
0060     {
0061       const QStringList args = parser.positionalArguments();
0062       widget->loadSearchString( args.first() );
0063     }
0064 
0065     
0066   }
0067 
0068   return app.exec();
0069 }