]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Add command line option ( --mlt-path ) to give location of the MLT install
[kdenlive] / src / mainwindow.cpp
index 80b52314b1dcf46ba61e659eba007c6d86cdbc3e..d73d5ea859daebe5576cf042b43e812950fd7a90 100644 (file)
@@ -96,12 +96,12 @@ EffectsList MainWindow::audioEffects;
 EffectsList MainWindow::customEffects;
 EffectsList MainWindow::transitions;
 
-MainWindow::MainWindow(QWidget *parent)
+MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
         : KXmlGuiWindow(parent),
         m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL), m_jogProcess(NULL), m_findActivated(false), m_initialized(false) {
     setlocale(LC_NUMERIC, "POSIX");
     setFont(KGlobalSettings::toolBarFont());
-    parseProfiles();
+    parseProfiles(MltPath);
     m_commandStack = new QUndoGroup;
     m_timelineArea = new KTabWidget(this);
     m_timelineArea->setTabReorderingEnabled(true);
@@ -119,7 +119,7 @@ MainWindow::MainWindow(QWidget *parent)
     m_findTimer.setSingleShot(true);
 
     initEffects::parseEffectFiles();
-    initEffects::parseCustomEffectsFile();
+    //initEffects::parseCustomEffectsFile();
 
     m_monitorManager = new MonitorManager();
 
@@ -223,17 +223,22 @@ MainWindow::MainWindow(QWidget *parent)
     }
     m_customEffectsMenu = static_cast<QMenu*>(factory()->container("custom_effects_menu", this));
     effects = customEffects.effectNames();
-    if (effects.isEmpty()) {
-       action = new QAction(i18n("No Custom Effects"), this);
-       action->setEnabled(false);
-       m_customEffectsMenu->addAction(action);
-    }
+    if (effects.isEmpty()) m_customEffectsMenu->setEnabled(false);
+    else m_customEffectsMenu->setEnabled(true);
+
     foreach(const QString &name, effects) {
         action = new QAction(name, this);
         action->setData(name);
         m_customEffectsMenu->addAction(action);
     }
 
+    QMenu *newEffect = new QMenu(this);
+    newEffect->addMenu(videoEffectsMenu);
+    newEffect->addMenu(audioEffectsMenu);
+    newEffect->addMenu(m_customEffectsMenu);
+    effectStack->setMenu(newEffect);
+
+
     QMenu *viewMenu = static_cast<QMenu*>(factory()->container("dockwindows", this));
     const QList<QAction *> viewActions = createPopupMenu()->actions();
     viewMenu->insertActions(NULL, viewActions);
@@ -345,11 +350,9 @@ void MainWindow::slotReloadEffects() {
     m_customEffectsMenu->clear();
     const QStringList effects = customEffects.effectNames();
     QAction *action;
-    if (effects.isEmpty()) {
-       action = new QAction(i18n("No Custom Effects"), this);
-       action->setEnabled(false);
-       m_customEffectsMenu->addAction(action);
-    }
+    if (effects.isEmpty()) m_customEffectsMenu->setEnabled(false);
+    else m_customEffectsMenu->setEnabled(true);
+
     foreach(const QString &name, effects) {
         action = new QAction(name, this);
         action->setData(name);
@@ -977,10 +980,15 @@ void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles) {
 }
 
 
-void MainWindow::parseProfiles() {
+void MainWindow::parseProfiles(const QString &mltPath) {
     //kdDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
 
     //KdenliveSettings::setDefaulttmpfolder();
+    if (!mltPath.isEmpty()) {
+        KdenliveSettings::setMltpath(mltPath + "/share/mlt/profiles/");
+        KdenliveSettings::setRendererpath(mltPath + "/bin/inigo");
+    }
+
     if (KdenliveSettings::mltpath().isEmpty()) {
         KdenliveSettings::setMltpath(QString(MLT_PREFIX) + QString("/share/mlt/profiles/"));
     }
@@ -1318,7 +1326,8 @@ void MainWindow::slotSwitchSnap() {
 
 
 void MainWindow::slotDeleteTimelineClip() {
-    if (m_activeTimeline) {
+    if (projectListDock->isActiveWindow()) m_projectList->slotRemoveClip();
+    else if (m_activeTimeline) {
         m_activeTimeline->projectView()->deleteSelectedClips();
     }
 }