]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Fix dropframe timecode, patch from John T. Mertz
[kdenlive] / src / mainwindow.cpp
index 8dc36617608d20851ae19deb06d9d7dc3fde9e60..84a74679bf9758b9cf77adef707b036920e96b52 100644 (file)
@@ -426,7 +426,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
 
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
     slotConnectMonitors();
-    
+
     // Disable drop B frames, see Kdenlive issue #1330, see also kdenlivesettingsdialog.cpp
     KdenliveSettings::setDropbframes(false);
 
@@ -705,6 +705,7 @@ void MainWindow::slotConnectMonitors()
 
     m_projectList->setRenderer(m_projectMonitor->render);
     //connect(m_projectList, SIGNAL(receivedClipDuration(const QString &)), this, SLOT(slotUpdateClip(const QString &)));
+    connect(m_projectList, SIGNAL(deleteProjectClips(QStringList, QMap<QString, QString>)), this, SLOT(slotDeleteProjectClips(QStringList, QMap<QString, QString>)));
     connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
     connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
     connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool)));
@@ -955,6 +956,8 @@ void MainWindow::setupActions()
 
     KNS3::standardAction(i18n("Download New Project Profiles..."), this, SLOT(slotGetNewMltProfileStuff()), actionCollection(), "get_new_mlt_profiles");
 
+    KNS3::standardAction(i18n("Download New Title Templates..."), this, SLOT(slotGetNewTitleStuff()), actionCollection(), "get_new_titles");
+
     KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
     collection->addAction("run_wizard", wizAction);
     connect(wizAction, SIGNAL(triggered(bool)), this, SLOT(slotRunWizard()));
@@ -1841,6 +1844,7 @@ void MainWindow::slotEditProjectSettings()
 
             m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
             m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
+            m_projectList->updateProjectFormat(m_activeDocument->timecode());
             if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
             m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
             //m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
@@ -1848,6 +1852,8 @@ void MainWindow::slotEditProjectSettings()
             if (updateFps) m_activeTimeline->updateProjectFps();
             m_activeDocument->setModified(true);
             m_commandStack->activeStack()->clear();
+            //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
+            slotUpdateMousePosition(0);
             // We need to desactivate & reactivate monitors to get a refresh
             //m_monitorManager->switchMonitors();
         }
@@ -2079,7 +2085,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_activeTimeline->updateProjectFps();
     m_activeDocument->checkProjectClips();
     if (KdenliveSettings::dropbframes()) slotUpdatePreviewSettings();
-
+    //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
+    slotUpdateMousePosition(0);
     // set tool to select tool
     m_buttonSelectTool->setChecked(true);
 }
@@ -2929,6 +2936,13 @@ int MainWindow::getNewStuff(const QString &configFile)
     return entries.size();
 }
 
+void MainWindow::slotGetNewTitleStuff()
+{
+    if (getNewStuff("kdenlive_titles.knsrc") > 0) {
+        TitleWidget::refreshTitleTemplates();
+    }
+}
+
 void MainWindow::slotGetNewLumaStuff()
 {
     if (getNewStuff("kdenlive_wipes.knsrc") > 0) {
@@ -3164,6 +3178,7 @@ void MainWindow::slotUpdateTimecodeFormat(int ix)
     KdenliveSettings::setFrametimecode(ix == 1);
     m_clipMonitor->updateTimecodeFormat();
     m_projectMonitor->updateTimecodeFormat();
+    m_activeTimeline->projectView()->clearSelection();
 }
 
 void MainWindow::slotRemoveFocus()
@@ -3189,6 +3204,9 @@ void MainWindow::slotShutdown()
     if (interface && interface->isServiceRegistered("org.kde.ksmserver")) {
         QDBusInterface smserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
         smserver.call("logout", 1, 2, 2);
+    } else if (interface && interface->isServiceRegistered("org.gnome.SessionManager")) {
+        QDBusInterface smserver("org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager");
+        smserver.call("Shutdown");
     }
 }
 
@@ -3290,5 +3308,16 @@ void MainWindow::slotInsertZoneToTimeline()
     m_activeTimeline->projectView()->insertClipCut(m_clipMonitor->activeClip(), info.at(1).toInt(), info.at(2).toInt());
 }
 
+
+void MainWindow::slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids)
+{
+    for (int i = 0; i < ids.size(); ++i) {
+        m_activeTimeline->slotDeleteClip(ids.at(i));
+    }
+    m_activeDocument->clipManager()->slotDeleteClips(ids);
+    if (!folderids.isEmpty()) m_projectList->deleteProjectFolder(folderids);
+
+}
+
 #include "mainwindow.moc"