summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
11717c7)
svn path=/branches/KDE4/; revision=2563
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
QString mltPath = args->getOption("mlt-path");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
QString mltPath = args->getOption("mlt-path");
- MainWindow* window = new MainWindow(mltPath);
- window->show();
- if (args->count()) { //new
- window->openFile(args->url(0)); //new
+ KUrl url;
+ if (args->count()) {
+ url = args->url(0);
+ MainWindow* window = new MainWindow(mltPath, url);
+ window->show();
EffectsList MainWindow::customEffects;
EffectsList MainWindow::transitions;
EffectsList MainWindow::customEffects;
EffectsList MainWindow::transitions;
-MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
+MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent)
: KXmlGuiWindow(parent),
m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL),
#ifndef NO_JOGSHUTTLE
: KXmlGuiWindow(parent),
m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL),
#ifndef NO_JOGSHUTTLE
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
slotConnectMonitors();
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
slotConnectMonitors();
- if (KdenliveSettings::openlastproject()) {
- openLastFile();
+ // Open or create a file. Command line argument passed in Url has
+ // precedence, then "openlastproject", then just a plain empty file.
+ // If opening Url fails, openlastproject will _not_ be used.
+ if (!Url.isEmpty()) {
+ openFile(Url);
- /*QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::allStaleFiles();
- if (!staleFiles.isEmpty()) {
- if (KMessageBox::questionYesNo(this, i18n("Auto-saved files exist. Do you want to recover them now?"), i18n("File Recovery"), KGuiItem(i18n("Recover")), KGuiItem(i18n("Don't recover"))) == KMessageBox::Yes) {
- recoverFiles(staleFiles);
- }
- else newFile();
+ if (KdenliveSettings::openlastproject()) {
+ openLastFile();
+ }
+ if (m_timelineArea->count() == 0) {
- MainWindow(const QString &MltPath = QString(), QWidget *parent = 0);
+ /** Constructor
+ * \param MltPath path to MLT environment
+ * \param Url Url to open
+ * \param parent Std. widget parent
+ *
+ * The constructor inits the main window. If Url is present, it will be opened.
+ * If Url is not present, and openLastproject is set, last project will be set
+ * If no file is open after trying this, a default "newfile" will be created. */
+ MainWindow(const QString &MltPath = QString(), const KUrl & Url = KUrl(), QWidget *parent = 0);
void parseProfiles(const QString &mltPath = QString());
static EffectsList videoEffects;
void parseProfiles(const QString &mltPath = QString());
static EffectsList videoEffects;