]> git.sesse.net Git - kdenlive/blob - src/main.cpp
Set correct address for Kdenlive bug tracker
[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 #include "kdenlive-config.h"
22 #include "mainwindow.h"
23
24 #include <KApplication>
25 #include <KAboutData>
26 #include <KDebug>
27 #include <KCmdLineArgs>
28 #include <KUrl> //new
29
30
31 #if defined(__APPLE_KDE__) || defined(__DARWIN__)
32 #include <SDL/SDL.h>
33 #endif
34
35 int main(int argc, char *argv[])
36 {
37     KAboutData aboutData(QByteArray("kdenlive"), QByteArray("kdenlive"),
38                          ki18n("Kdenlive"), VERSION,
39                          ki18n("An open source video editor."),
40                          KAboutData::License_GPL,
41                          ki18n("Copyright (c) 2009 Development team"));
42     aboutData.addAuthor(ki18n("Jean-Baptiste Mardelle"), ki18n("MLT porting, KDE 4 porting, Main developer"), "jb@kdenlive.org");
43     aboutData.addAuthor(ki18n("Marco Gittler"), ki18n("MLT Connection, Transition, Effect, Timeline Developer"), "g.marco@freenet.de");
44     aboutData.addAuthor(ki18n("Jean-Michel Poure"), ki18n("Rendering profiles customisation"), "jm@poure.com");
45     aboutData.addAuthor(ki18n("Ray Lehtiniemi"), ki18n("Bug fixing etc."), "rayl@mail.com");
46     aboutData.addAuthor(ki18n("Jason Wood"), ki18n("Original KDE 3 version author (not active anymore)"), "jasonwood@blueyonder.co.uk");
47     aboutData.setHomepage("http://kdenlive.org");
48     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>"));
49     aboutData.setTranslator(ki18n("NAME OF TRANSLATORS"), ki18n("EMAIL OF TRANSLATORS"));
50     aboutData.setBugAddress("http://kdenlive.org/mantis");
51
52     KCmdLineArgs::init(argc, argv, &aboutData);
53
54     KCmdLineOptions options;
55     options.add("mlt-path <path>", ki18n("Set the path for MLT environnement"));
56     options.add("+[file]", ki18n("Document to open")); //new
57     KCmdLineArgs::addCmdLineOptions(options); //new
58
59     KApplication app;
60
61     // see if we are starting with session management
62     if (app.isSessionRestored()) {
63         int n = 1;
64         while (KMainWindow::canBeRestored(n)) {
65             const QString className = KXmlGuiWindow::classNameOfToplevel(n);
66             if (className == QLatin1String("MainWindow")) {
67                 MainWindow* win = new MainWindow();
68                 win->restore(n);
69             } else {
70                 kWarning() << "Unknown class " << className << " in session saved data!";
71             }
72             ++n;
73         }
74     } else {
75         KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
76
77         QString mltPath = args->getOption("mlt-path");
78         KUrl url;
79         if (args->count()) {
80             url = args->url(0);
81         }
82         MainWindow* window = new MainWindow(mltPath, url);
83         window->show();
84
85         args->clear();
86     }
87
88     return app.exec();
89 }