Simple plugin system and added bibles docker to it
[kworship.git] / kworship / main.cpp
blob30cfca3a0b67f4d65834d320729374e97562b4ba
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #include "kworship.h"
22 #include <kapplication.h>
23 #include <kaboutdata.h>
24 #include <kcmdlineargs.h>
25 #include <kconfigdialogmanager.h>
26 #include <KDE/KLocale>
28 int main(int argc, char **argv)
30 KAboutData about("kworship", 0,
31 ki18n("KWorship"), "0.1",
32 ki18n("Free/Open source church worship & presentation software"),
33 KAboutData::License_GPL_V2,
34 ki18n("(C) 2008 James Hogan"),
35 KLocalizedString(),
36 "http://kworship.org",
37 "bugs@kworship.org");
38 about.addAuthor( ki18n("James Hogan"), KLocalizedString(), "james@albanarts.com" );
39 KCmdLineArgs::init(argc, argv, &about);
41 KCmdLineOptions options;
42 options.add("+[URL]", ki18n( "Document to open" ));
43 KCmdLineArgs::addCmdLineOptions(options);
44 KApplication app;
46 // Screen number can be managed by a DesktopView widget
47 KConfigDialogManager::changedMap()->insert("DesktopView", SIGNAL(screenChanged(int)));
48 KConfigDialogManager::propertyMap()->insert("DesktopView", "selectedScreen");
50 kworship *widget = new kworship;
52 // see if we are starting with session management
53 if (app.isSessionRestored())
55 RESTORE(kworship);
57 else
59 widget->show();
60 // no session.. just start up normally
61 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
62 if (args->count() > 0)
64 KUrl arg = args->arg(0);
65 KUrl url = KCmdLineArgs::cwd();
66 if (arg.isRelative())
68 url.addPath(arg.path());
70 else
72 url = arg;
74 widget->loadPlaylist(url);
76 args->clear();
79 return app.exec();