1/* This file is part of the KDE project
2 Copyright (C) 2001 Thomas zander <zander@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kptaboutdata.h"
21
22#include "about/hi256-app-calligraplan.xpm"
23#include <ksplashscreen.h>
24#include <QHideEvent>
25
26#include <kdemacros.h>
27#include <KoApplication.h>
28#include <kcmdlineargs.h>
29
30#include "kptmaindocument.h"
31
32#ifdef MAINTANER_WANTED_SPLASH
33class KoSplashScreen : public KSplashScreen
34{
35public:
36 explicit KoSplashScreen(const QPixmap& pixmap) : KSplashScreen(pixmap) {}
37
38 void hideEvent(QHideEvent *event)
39 {
40 event->accept();
41 deleteLater();
42 }
43};
44#endif
45
46
47extern "C" KDE_EXPORT int kdemain( int argc, char **argv ) {
48 KAboutData * aboutData=KPlato::newAboutData();
49
50 KCmdLineArgs::init( argc, argv, aboutData);
51 KCmdLineOptions options;
52 options.add("+[file]", ki18n("File to open"));
53 KCmdLineArgs::addCmdLineOptions( options );
54
55 KoApplication app(PLAN_MIME_TYPE);
56
57#ifdef MAINTANER_WANTED_SPLASH
58 // After creating the KApplication then create the pixmap from an xpm: we cannot get the
59 // location of our datadir before we've started our components,
60 // so use an xpm.
61 QSplashScreen *splashScreen = new KoSplashScreen(QPixmap(splash_screen_xpm));
62 splashScreen->show();
63 splashScreen->showMessage("<p style=\"color:black\">"
64 "<b>Calligra Plan is unmaintained!</b><br><br>"
65 "The Calligra community welcomes someone to take over.<br><br>"
66 "See community.kde.org/Calligra</p>");
67#endif
68
69 // This is disabled for now so the crude test below will run
70 if (!app.start())
71 return 1;
72
73 app.exec();
74
75 delete (aboutData);
76
77 return 0;
78}
79