1
2/*
3 Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28
29#include <kaboutdata.h>
30#include <kapplication.h>
31#include <kcmdlineargs.h>
32#include <kdebug.h>
33#include <kimageio.h>
34#include <klocale.h>
35#include <KMessageBox>
36
37#include <kpDefs.h>
38#include <kpMainWindow.h>
39
40#include <kolourpaintlicense.h>
41#include <kolourpaintversion.h>
42
43
44int main (int argc, char *argv [])
45{
46 KAboutData aboutData
47 (
48 "kolourpaint", 0,
49 ki18n ("KolourPaint"),
50 kpVersionText,
51 ki18n ("Paint Program for KDE"),
52 KAboutData::License_Custom,
53 ki18n (0/*copyright statement - see license instead*/),
54 ki18n ("To obtain support, please visit the website."),
55 "http://www.kolourpaint.org/"
56 );
57
58 // (this is _not_ the same as KAboutData::License_BSD)
59 aboutData.setLicenseText (ki18n (kpLicenseText));
60
61
62 // Please add yourself here if you feel you're missing.
63 // SYNC: with AUTHORS
64
65 aboutData.addAuthor (ki18n ("Clarence Dang"), ki18n ("Project Founder"), "dang@kde.org");
66 aboutData.addAuthor (ki18n ("Thurston Dang"), ki18n ("Chief Investigator"),
67 "thurston_dang@users.sourceforge.net");
68 aboutData.addAuthor (ki18n ("Martin Koller"), ki18n ("Scanning Support, Alpha Support, Current Maintainer"), "kollix@aon.at");
69 aboutData.addAuthor (ki18n ("Kristof Borrey"), ki18n ("Icons"), "borrey@kde.org");
70 aboutData.addAuthor (ki18n ("Tasuku Suzuki"), ki18n ("InputMethod Support"), "stasuku@gmail.com");
71 aboutData.addAuthor (ki18n ("Kazuki Ohta"), ki18n ("InputMethod Support"), "mover@hct.zaq.ne.jp");
72 aboutData.addAuthor (ki18n ("Nuno Pinheiro"), ki18n ("Icons"), "nf.pinheiro@gmail.com");
73 aboutData.addAuthor (ki18n ("Danny Allen"), ki18n ("Icons"), "dannya40uk@yahoo.co.uk");
74 aboutData.addAuthor (ki18n ("Mike Gashler"), ki18n ("Image Effects"), "gashlerm@yahoo.com");
75
76 aboutData.addAuthor (ki18n ("Laurent Montel"), ki18n ("KDE 4 Porting"), "montel@kde.org");
77
78 // TODO: missing a lot of people who helped with the KDE 4 port.
79
80 aboutData.addCredit (ki18n ("Thanks to the many others who have helped to make this program possible."));
81
82 KCmdLineArgs::init (argc, argv, &aboutData);
83
84 KCmdLineOptions cmdLineOptions;
85 cmdLineOptions.add ("+[file]", ki18n ("Image file to open"));
86 KCmdLineArgs::addCmdLineOptions (cmdLineOptions);
87
88 KApplication app;
89
90 if (app.isSessionRestored ())
91 {
92 // Creates a kpMainWindow using the default constructor and then
93 // calls kpMainWindow::readProperties().
94 RESTORE (kpMainWindow)
95 }
96 else
97 {
98 kpMainWindow *mainWindow;
99 KCmdLineArgs *args = KCmdLineArgs::parsedArgs ();
100
101 if (args->count () >= 1)
102 {
103 for (int i = 0; i < args->count (); i++)
104 {
105 mainWindow = new kpMainWindow (args->url (i));
106 mainWindow->show ();
107 }
108 }
109 else
110 {
111 mainWindow = new kpMainWindow ();
112 mainWindow->show ();
113 }
114
115 args->clear ();
116 }
117
118 return app.exec ();
119}
120