]> git.sesse.net Git - kdenlive/blob - src/main.cpp
Fix version number (now 0.7), add myself as author
[kdenlive] / src / main.cpp
1 /***************************************************************************
2  *   Copyright (C) 2007 by Marco Gittler (g.marco@freenet.de)              *
3  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
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  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
19  ***************************************************************************/
20
21
22 #include <KApplication>
23 #include <KAboutData>
24 #include <KDebug>
25 #include <KCmdLineArgs>
26 #include <KUrl> //new
27
28 #include "mainwindow.h"
29
30 int main(int argc, char *argv[]) {
31     KAboutData aboutData("kdenlive", "kdenlive",
32                          ki18n("Kdenlive"), "0.7",
33                          ki18n("An open source video editor."),
34                          KAboutData::License_GPL,
35                          ki18n("Copyright (c) 2008 Development team"));
36     aboutData.addAuthor(ki18n("Jean-Baptiste Mardelle"), ki18n("Mlt porting, KDE4 porting, Main developer"), "jb@kdenlive.org");
37     aboutData.addAuthor(ki18n("Marco Gittler"), ki18n("MltConnection, Transition, Effect, Timeline Developer"), "g.marco@freenet.de");
38     aboutData.setHomepage("http://kdenlive.org");
39     KCmdLineArgs::init(argc, argv, &aboutData);
40
41     KCmdLineOptions options; //new
42     options.add("+[file]", ki18n("Document to open")); //new
43     KCmdLineArgs::addCmdLineOptions(options); //new
44
45     KApplication app;
46
47     // see if we are starting with session management
48     if (app.isSessionRestored()) {
49         int n = 1;
50         while (KMainWindow::canBeRestored(n)) {
51             const QString className = KXmlGuiWindow::classNameOfToplevel(n);
52             if (className == QLatin1String("MainWindow")) {
53                 MainWindow* win = new MainWindow();
54                 win->restore(n);
55             } else {
56                 kWarning() << "Unknown class " << className << " in session saved data!";
57             }
58             ++n;
59         }
60     } else {
61         MainWindow* window = new MainWindow();
62         window->show();
63
64         KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
65         if (args->count()) { //new
66             window->openFile(args->url(0)); //new
67         }
68
69         args->clear();
70     }
71
72     return app.exec();
73 }