SVN_SILENT: revert stack indicator hot area position to original values.
[kphotoalbum.git] / main.cpp
blob457919a0bc49bb35ef01bd43f08a0b785d297a7c
1 /* Copyright (C) 2003-2006 Jesper K. Pedersen <blackie@kde.org>
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public
5 License as published by the Free Software Foundation; either
6 version 2 of the License, or (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #include <QTemporaryFile>
20 #include "Settings/SettingsData.h"
21 #include "MainWindow/Window.h"
22 #include <kapplication.h>
23 #include <kcmdlineargs.h>
24 #include <kaboutdata.h>
25 #include <kimageio.h>
26 #include "MainWindow/SplashScreen.h"
27 #include <config-kpa-sqldb.h>
28 #ifdef SQLDB_SUPPORT
29 #include "SQLDB/QueryErrors.h"
30 #endif
31 #include "Settings/SettingsData.h"
32 #include <klocale.h>
33 #include <kdebug.h>
35 extern QTemporaryFile* _tmpFileForThumbnailView;
37 int main( int argc, char** argv ) {
38 KAboutData aboutData( "kphotoalbum", 0, ki18n("KPhotoAlbum"), "SVN",
39 ki18n("KDE Photo Album"), KAboutData::License_GPL,
40 KLocalizedString(), KLocalizedString(), "http://www.kphotoalbum.org");
41 aboutData.addAuthor( ki18n("Jesper K. Pedersen"), ki18n("Development"), "blackie@kde.org" );
42 aboutData.addAuthor( ki18n("Hassan Ibraheem"),ki18n("Development"), "hasan.ibraheem@gmail.com");
43 aboutData.addAuthor( ki18n("Miika Turkia"),ki18n("Development"), "theBro@luukku.com");
44 aboutData.addAuthor( ki18n("Tuomas Suutari"), ki18n("SQL backend and numerous features"), "thsuut@utu.fi" );
45 aboutData.addAuthor( ki18n("Jan Kundrat"),ki18n("Development"), "jkt@gentoo.org");
46 aboutData.addAuthor( ki18n("Henner Zeller"),ki18n("Development"), "h.zeller@acm.org");
49 aboutData.addCredit( ki18n("Will Stephenson"), ki18n("Developing an Icon for KPhotoAlbum"), "will@stevello.free-online.co.uk" );
50 aboutData.addCredit( ki18n("Teemu Rytilahti"),
51 ki18n("Sending patches implementing (.) the \"Set As Wallpaper\" menu in the viewer."
52 "(.) Theme support for HTML generation"), "teemu.rytilahti@kde-fi.org" );
53 aboutData.addCredit( ki18n("Reimar Imhof"), ki18n("Patch to sort items in option listboxes"), "Reimar.Imhof@netCologne.de" );
54 aboutData.addCredit( ki18n("Thomas Schwarzgruber"), ki18n("Patch to sort images in the thumbnail view, plus reading time info out of EXIF images for existing images"), "possebaer@gmx.at" );
55 aboutData.addCredit( ki18n("Marcel Wiesweg"), ki18n("Patch which speed up loading of thumbnails plus preview in image property dialog."), "marcel.wiesweg@gmx.de" );
56 aboutData.addCredit( ki18n("Marco Caldarelli"), ki18n("Patch for making it possible to reread EXIF info using a nice dialog."), "caldarel@yahoo.it" );
57 aboutData.addCredit( ki18n("Jean-Michel FAYARD"), ki18n("(.) Patch with directory info made available through the browser. (.) Patch for adding a check box for \"and/or\" searches in the search page."), "jmfayard@gmail.com" );
58 aboutData.addCredit( ki18n("Robert L Krawitz"), ki18n("Numerous patches plus profiling KPhotoAlbum again and again."), "rlk@alum.mit.edu" );
59 aboutData.addCredit( ki18n("Christoph Moseler"), ki18n("Numerous patches for lots of bugs plus patches for a few new features"), "forums@moseler.net" );
60 aboutData.addCredit( ki18n("Clytie Siddall"), ki18n("Tremendous help with the English text in the application."), "clytie@riverland.net.au" );
62 KCmdLineArgs::init( argc, argv, &aboutData );
64 KCmdLineOptions options;
65 options.add("c ", ki18n("Config file"));
66 options.add("e ", ki18n("Database engine to use"));
67 options.add("demo", ki18n( "Starts KPhotoAlbum with a prebuilt set of demo images" ));
68 options.add("import ", ki18n( "Import file" ));
69 options.add("export-in-2.1-format", ki18n( "This will make an attempt at saving in a format understandable by KimDaBa 2.1" ));
70 KCmdLineArgs::addCmdLineOptions( options );
72 KApplication app;
74 new MainWindow::SplashScreen();
77 // FIXME: There is no point in using try here, because exceptions
78 // and Qt event loop don't mix. Rather exceptions should be
79 // catched earlier and not passed through Qt code.
80 try {
81 MainWindow::Window* view = new MainWindow::Window( 0 );
83 // qApp->setMainWidget( view );
84 view->setGeometry( Settings::SettingsData::instance()->windowGeometry( Settings::MainWindow ) );
86 int code = app.exec();
88 // To avoid filling /tmp up with temporary files from the thumbnail tooltips, we need to destruct this one.
89 delete _tmpFileForThumbnailView;
90 return code;
92 #ifdef SQLDB_SUPPORT
93 catch (SQLDB::Error& e) {
94 qFatal("Exception occured in SQLDB:\n%s", e.what());
96 #endif
97 catch (...) {
98 qFatal("Unknown exception caught");