File indexing completed on 2024-04-28 13:43:55

0001 /***************************************************************************
0002                           main.cpp  -  main program
0003                              -------------------
0004     begin                : sam déc  1 23:40:19 CET 2001
0005     copyright            : (C) 2001-2022 by Éric Bischoff
0006     email                : bischoff@kde.org
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #include <unistd.h>
0019 
0020 #include <QStandardPaths>
0021 #include <QSplashScreen>
0022 
0023 #include <KAboutData>
0024 #include <KLocalizedString>
0025 
0026 #include "keurocalc.h"
0027 
0028 int main(int argc, char *argv[])
0029 {
0030     QApplication a(argc, argv);
0031     KLocalizedString::setApplicationDomain("keurocalc");
0032 
0033     const QString copyright = i18n("(c) 2001-2022, the KEuroCalc developers");
0034     const QString description = i18n("Cash converter and calculator");
0035     KAboutData aboutData("keurocalc", i18n("KEuroCalc"), "1.3.2", description,
0036                  KAboutLicense::GPL, copyright, i18n("A program by Éric Bischoff <bischoff@kde.org>\n\nThis program is dedicated to all who know that money does not justify anything.\n\nTime Genie exchange rates courtesy of <a href='http://www.timegenie.com/' title='foreign exchange rates courtesy of Time Genie'>Time Genie</a>\n"));
0037 
0038     aboutData.addAuthor(i18n("Éric Bischoff"), i18n("Design and implementation"), "bischoff@kde.org");
0039     aboutData.addAuthor(i18n("Gil Gross"), i18n("Additional functionality"), "ptit.ours@gmail.com");
0040     aboutData.addCredit(i18n("Melchior Franz"), i18n("Design and testing"), "a8603365@unet.univie.ac.at");
0041     aboutData.addCredit(i18n("Bas Willems"), i18n("Graphical artwork"), "cybersurfer@euronet.nl");
0042     aboutData.setOrganizationDomain("kde.org");
0043     aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"),
0044                                 i18nc("EMAIL OF TRANSLATORS", "Your emails"));
0045 
0046     KAboutData::setApplicationData(aboutData);
0047 
0048     a.setWindowIcon(QIcon::fromTheme("keurocalc", a.windowIcon()));
0049 
0050     QSplashScreen *splash;
0051     KEuroCalc *keurocalc;
0052     bool splashScreen;
0053 
0054     splash = new QSplashScreen( QPixmap( QStandardPaths::locate(QStandardPaths::AppDataLocation, "splash.png" ) ) );
0055     splash->showMessage(description + '\n' + copyright, Qt::AlignBottom);
0056 
0057     keurocalc = new KEuroCalc();
0058 
0059     splashScreen = keurocalc->readSplashScreen();
0060     if ( splashScreen )
0061     {
0062         splash->show();
0063         splash->repaint();
0064         for (int i = 0; i < 8; i++)
0065         {   // Something less idiotic to propose?
0066             a.processEvents();
0067             usleep(100000);
0068         }
0069         splash->finish(keurocalc);
0070     }
0071     delete splash;
0072 
0073     keurocalc->show();
0074     keurocalc->repaint();
0075     return a.exec();
0076 }