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("MltConnection, Transition, Effect, Timeline Developer"), "g.marco@freenet.de");
37 aboutData.setHomepage("http://kdenlive.org");
38 //aboutData.setBugAddress("http://kdenlive.org/mantis");
39 KCmdLineArgs::init(argc, argv, &aboutData);
41 KCmdLineOptions options;
42 options.add("mlt-path <path>", ki18n("Set the path for MLT environnement"));
43 options.add("+[file]", ki18n("Document to open")); //new
44 KCmdLineArgs::addCmdLineOptions(options); //new
48 // see if we are starting with session management
49 if (app.isSessionRestored()) {
51 while (KMainWindow::canBeRestored(n)) {
52 const QString className = KXmlGuiWindow::classNameOfToplevel(n);
53 if (className == QLatin1String("MainWindow")) {
54 MainWindow* win = new MainWindow();
57 kWarning() << "Unknown class " << className << " in session saved data!";
62 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
64 QString mltPath = args->getOption("mlt-path");
65 MainWindow* window = new MainWindow(mltPath);
67 if (args->count()) { //new
68 window->openFile(args->url(0)); //new