1 /***************************************************************************
2 * Copyright (C) 2007 by Marco Gittler (g.marco@freenet.de) *
3 * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
22 #include <KApplication>
25 #include <KCmdLineArgs>
28 #include "mainwindow.h"
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);
41 KCmdLineOptions options; //new
42 options.add("+[file]", ki18n("Document to open")); //new
43 KCmdLineArgs::addCmdLineOptions(options); //new
47 // see if we are starting with session management
48 if (app.isSessionRestored()) {
50 while (KMainWindow::canBeRestored(n)) {
51 const QString className = KXmlGuiWindow::classNameOfToplevel(n);
52 if (className == QLatin1String("MainWindow")) {
53 MainWindow* win = new MainWindow();
56 kWarning() << "Unknown class " << className << " in session saved data!";
61 MainWindow* window = new MainWindow();
64 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
65 if (args->count()) { //new
66 window->openFile(args->url(0)); //new