]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Small cleanup in monitors
[kdenlive] / src / mainwindow.cpp
index 557689fa6fff666874e17e284cc832f592c508fd..9274d5af2e7e3df748cb181379cae1e56ab37e7e 100644 (file)
@@ -584,19 +584,24 @@ void MainWindow::readProperties(const KConfigGroup &config)
 
 void MainWindow::slotReloadEffects()
 {
-    kDebug() << "START RELOAD; COUNR: " << m_customEffectsMenu->actions().count();
     m_customEffectsMenu->clear();
-    kDebug() << "START RELOAD; CLR: " << m_customEffectsMenu->actions().count();
     initEffects::parseCustomEffectsFile();
-    const QStringList effects = customEffects.effectNames();
-    kDebug() << "NEW EFFS: " << effects;
     QAction *action;
-    if (effects.isEmpty()) m_customEffectsMenu->setEnabled(false);
-    else m_customEffectsMenu->setEnabled(true);
+    QStringList effectInfo;
+    QMap<QString, QStringList> effectsList;
 
-    foreach(const QString &name, effects) {
-        action = new QAction(name, this);
-        action->setData(name);
+    for (int ix = 0; ix < customEffects.count(); ix++) {
+        effectInfo = customEffects.effectIdInfo(ix);
+        effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
+    }
+    if (effectsList.isEmpty()) {
+        m_customEffectsMenu->setEnabled(false);
+        return;
+    } else m_customEffectsMenu->setEnabled(true);
+
+    foreach(const QStringList &value, effectsList) {
+        action = new QAction(value.at(0), this);
+        action->setData(value);
         m_customEffectsMenu->addAction(action);
     }
     m_effectList->reloadEffectList();
@@ -1494,6 +1499,7 @@ void MainWindow::closeCurrentDocument(bool saveChanges)
             break;
         }
     }
+    m_clipMonitor->slotSetXml(NULL);
     m_timelineArea->removeTab(m_timelineArea->indexOf(w));
     if (m_timelineArea->count() == 1) {
         m_timelineArea->setTabBarHidden(true);
@@ -1514,6 +1520,7 @@ void MainWindow::closeCurrentDocument(bool saveChanges)
 bool MainWindow::saveFileAs(const QString &outputFileName)
 {
     QString currentSceneList;
+    m_monitorManager->stopActiveMonitor();
     if (KdenliveSettings::dropbframes()) {
         KdenliveSettings::setDropbframes(false);
         m_activeDocument->clipManager()->updatePreviewSettings();
@@ -1632,7 +1639,7 @@ void MainWindow::openFile(const KUrl &url)
     }
     if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
     m_messageLabel->setMessage(i18n("Opening file %1", url.path()), InformationMessage);
-    qApp->processEvents();
+    m_messageLabel->repaint();
     doOpenFile(url, NULL);
 }
 
@@ -1668,9 +1675,9 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
 
     if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
     slotGotProgressInfo(QString(), -1);
-    m_clipMonitor->refreshMonitor(true);
     m_projectMonitor->adjustRulerSize(trackView->duration());
     m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
+    m_clipMonitor->refreshMonitor(true);
 }
 
 void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles)
@@ -1960,6 +1967,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
             disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
             disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
+            disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
             m_effectStack->clear();
         }
         //m_activeDocument->setRenderer(NULL);
@@ -1975,6 +1983,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
     connect(m_projectList, SIGNAL(refreshClip()), m_clipMonitor, SLOT(refreshMonitor()));
+    connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
+
     connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
     connect(m_projectList, SIGNAL(clipNameChanged(const QString, const QString)), trackView->projectView(), SLOT(clipNameChanged(const QString, const QString)));
 
@@ -2026,6 +2036,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
     connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
     connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
+    connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
     connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
 
     connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
@@ -2607,7 +2618,7 @@ void MainWindow::slotShowClipProperties(QList <DocClipBase *> cliplist, QMap<QSt
         command->setText(i18n("Edit clips"));
         for (int i = 0; i < cliplist.count(); i++) {
             DocClipBase *clip = cliplist.at(i);
-            new EditClipCommand(m_projectList, clip->getId(), commonproperties, dia.properties(), true, command);
+            new EditClipCommand(m_projectList, clip->getId(), clip->properties(), dia.properties(), true, command);
         }
         m_activeDocument->commandStack()->push(command);
         for (int i = 0; i < cliplist.count(); i++) {