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 ***************************************************************************/
21 #include <KApplication>
24 #include <KCmdLineArgs>
27 #include "mainwindow.h"
29 int main(int argc, char *argv[]) {
30 KAboutData aboutData(QByteArray("kdenlive"), QByteArray("kdenlive"),
31 ki18n("Kdenlive"), QByteArray("0.7"),
32 ki18n("An open source video editor."),
33 KAboutData::License_GPL,
34 ki18n("Copyright (c) 2008 Development team"));
35 aboutData.addAuthor(ki18n("Jean-Baptiste Mardelle"), ki18n("Mlt porting, KDE4 porting, Main developer"), "jb@kdenlive.org");
36 aboutData.addAuthor(ki18n("Marco Gittler"), ki18n("Mlt Connection, Transition, Effect, Timeline Developer"), "g.marco@freenet.de");
37 aboutData.setHomepage("http://kdenlive.org");
38 aboutData.setCustomAuthorText(ki18n("Please report bugs to http://kdenlive.org/mantis"), ki18n("Please report bugs to <a href=\"http://kdenlive.org/mantis\">http://kdenlive.org/mantis</a>"));
39 aboutData.setTranslator(ki18n("NAME OF TRANSLATORS"), ki18n("EMAIL OF TRANSLATORS"));
41 KCmdLineArgs::init(argc, argv, &aboutData);
43 KCmdLineOptions options;
44 options.add("mlt-path <path>", ki18n("Set the path for MLT environnement"));
45 options.add("+[file]", ki18n("Document to open")); //new
46 KCmdLineArgs::addCmdLineOptions(options); //new
50 // see if we are starting with session management
51 if (app.isSessionRestored()) {
53 while (KMainWindow::canBeRestored(n)) {
54 const QString className = KXmlGuiWindow::classNameOfToplevel(n);
55 if (className == QLatin1String("MainWindow")) {
56 MainWindow* win = new MainWindow();
59 kWarning() << "Unknown class " << className << " in session saved data!";
64 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
66 QString mltPath = args->getOption("mlt-path");
67 MainWindow* window = new MainWindow(mltPath);
69 if (args->count()) { //new
70 window->openFile(args->url(0)); //new