]> cloud.milkyroute.net Git - dolphin.git/blob - src/main.cpp
Use a KIO Job for applying the view properties recursively to sub directories.
[dolphin.git] / src / main.cpp
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
4 * *
5 * This program 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 * This program 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 this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21 #include "dolphinapplication.h"
22 #include "dolphinmainwindow.h"
23 #include <kapplication.h>
24 #include <kaboutdata.h>
25 #include <kcmdlineargs.h>
26 #include <klocale.h>
27 #include <krun.h>
28
29 static KCmdLineOptions options[] =
30 {
31 { "+[Url]", I18N_NOOP( "Document to open" ), 0 },
32 KCmdLineLastOption
33 };
34
35 int main(int argc, char **argv)
36 {
37 KAboutData about("dolphin",
38 I18N_NOOP("Dolphin"),
39 "0.8.0",
40 I18N_NOOP("File Manager"),
41 KAboutData::License_GPL,
42 "(C) 2006 Peter Penz");
43 about.setHomepage("http://enzosworld.gmxhome.de");
44 about.setBugAddress("peter.penz@gmx.at");
45 about.addAuthor("Peter Penz", I18N_NOOP("Maintainer and developer"), "peter.penz@gmx.at");
46 about.addAuthor("Cvetoslav Ludmiloff", I18N_NOOP("Developer"), "ludmiloff@gmail.com");
47 about.addAuthor("Stefan Monov", I18N_NOOP("Developer"), "logixoul@gmail.com");
48 about.addAuthor("Michael Austin", I18N_NOOP("Documentation"), "tuxedup@users.sourceforge.net");
49 about.addAuthor("Orville Bennett", I18N_NOOP("Documentation"), "obennett@hartford.edu");
50 about.addCredit("Aaron J. Seigo", I18N_NOOP("... for the great support and the amazing patches"));
51 about.addCredit("Patrice Tremblay and Gregor Kalisnik", I18N_NOOP("... for their patches"));
52 about.addCredit("Ain, Itai, Ivan, Stephane, Patrice, Piotr and Stefano",
53 I18N_NOOP("... for their translations"));
54
55 KCmdLineArgs::init(argc, argv, &about);
56 KCmdLineArgs::addCmdLineOptions(options);
57
58 DolphinApplication app;
59
60
61 #warning TODO, SessionManagement
62 #if 0
63 if (false /* KDE4-TODO: app.isSessionRestored() */) {
64 int n = 1;
65 while (KMainWindow::canBeRestored(n)){
66 Dolphin::mainWin().restore(n);
67 ++n;
68 }
69 } else {
70 #endif
71
72 KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
73 if (args->count() > 0) {
74 for (int i = 0; i < args->count(); ++i) {
75 DolphinMainWindow *win = app.createMainWindow();
76 win->activeView()->setUrl(args->url(i));
77 win->show();
78 }
79 } else {
80 DolphinMainWindow* mainWin = app.createMainWindow();
81 mainWin->show();
82 }
83 args->clear();
84
85 return app.exec();
86 }