1 | /* This file is part of the KDE project |
2 | Copyright (C) 2001-2002 Lennart Kudling <kudling@kde.org> |
3 | Copyright (C) 2002,2004 David Faure <faure@kde.org> |
4 | Copyright (C) 2003,2005 Laurent Montel <montel@kde.org> |
5 | Copyright (C) 2003,2007 Rob Buis <buis@kde.org> |
6 | Copyright (C) 2003 Stephan Binner <binner@kde.org> |
7 | Copyright (C) 2004 Waldo Bastian <bastian@kde.org> |
8 | Copyright (C) 2005 Thomas Zander <zander@kde.org> |
9 | Copyright (C) 2006 Inge Wallin <inge@lysator.liu.se> |
10 | Copyright (C) 2006 Jan Hambrecht <jaham@gmx.net> |
11 | Copyright (C) 2007 Chusslove Illich <caslav.ilic@gmx.net> |
12 | |
13 | This library is free software; you can redistribute it and/or |
14 | modify it under the terms of the GNU Library General Public |
15 | License as published by the Free Software Foundation; either |
16 | version 2 of the License, or (at your option) any later version. |
17 | |
18 | This library is distributed in the hope that it will be useful, |
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
21 | Library General Public License for more details. |
22 | |
23 | You should have received a copy of the GNU Library General Public License |
24 | along with this library; see the file COPYING.LIB. If not, write to |
25 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 | * Boston, MA 02110-1301, USA. |
27 | */ |
28 | |
29 | #include "ui/splash/hi256-app-calligrakarbon.xpm" |
30 | #include <ksplashscreen.h> |
31 | #include <QHideEvent> |
32 | |
33 | #include <kaboutdata.h> |
34 | #include <kcmdlineargs.h> |
35 | #include <klocale.h> |
36 | #include <KoApplication.h> |
37 | |
38 | #include <KarbonFactory.h> |
39 | #include <KarbonDocument.h> |
40 | |
41 | #ifdef MAINTANER_WANTED_SPLASH |
42 | class KoSplashScreen : public KSplashScreen |
43 | { |
44 | public: |
45 | explicit KoSplashScreen(const QPixmap& pixmap) : KSplashScreen(pixmap) {} |
46 | |
47 | void hideEvent(QHideEvent *event) |
48 | { |
49 | event->accept(); |
50 | deleteLater(); |
51 | } |
52 | }; |
53 | #endif |
54 | |
55 | extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] ) |
56 | { |
57 | KCmdLineArgs::init( argc, argv, KarbonFactory::aboutData() ); |
58 | |
59 | KCmdLineOptions options; |
60 | options.add("+[file]" , ki18n( "File to open" )); |
61 | KCmdLineArgs::addCmdLineOptions( options ); |
62 | |
63 | KoApplication app(KARBON_MIME_TYPE); |
64 | |
65 | #ifdef MAINTANER_WANTED_SPLASH |
66 | // After creating the KApplication then create the pixmap from an xpm: we cannot get the |
67 | // location of our datadir before we've started our components, |
68 | // so use an xpm. |
69 | QSplashScreen *splashScreen = new KoSplashScreen(QPixmap(splash_screen_xpm)); |
70 | splashScreen->show(); |
71 | splashScreen->showMessage("<p style=\"color:black\">" |
72 | "<b>Calligra Karbon is unmaintained!</b><br><br>" |
73 | "The Calligra community welcomes someone to take over.<br><br>" |
74 | "See community.kde.org/Calligra</p>" ); |
75 | #endif |
76 | |
77 | if( !app.start() ) // parses command line args, create initial docs and mainwindows |
78 | return 1; |
79 | |
80 | return app.exec(); |
81 | } |
82 | |