]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Allow users to force aspect ratio for a clip in clip properties->advanced,
[kdenlive] / src / mainwindow.cpp
index 891a391602c3a3eed71ed7811fc9dcaae54cb9ce..7da118524ac41057b84456042708e9362aa0aeae 100644 (file)
@@ -777,7 +777,7 @@ void MainWindow::setupActions() {
     collection->addAction("paste_effects", pasteEffects);
     connect(pasteEffects , SIGNAL(triggered()), this, SLOT(slotPasteEffects()));
 
-    KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
+    m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
 
     KStandardAction::quit(this, SLOT(queryQuit()), collection);
 
@@ -865,6 +865,7 @@ void MainWindow::newFile(bool showProjectSettings) {
         connectDocumentInfo(doc);
         connectDocument(trackView, doc);
     } else m_timelineArea->setTabBarHidden(false);
+    m_closeAction->setEnabled(m_timelineArea->count() > 1);
 }
 
 void MainWindow::activateDocument() {
@@ -897,7 +898,10 @@ void MainWindow::closeCurrentDocument() {
         }
     }
     m_timelineArea->removeTab(m_timelineArea->indexOf(w));
-    if (m_timelineArea->count() == 1) m_timelineArea->setTabBarHidden(true);
+    if (m_timelineArea->count() == 1) {
+        m_timelineArea->setTabBarHidden(true);
+        m_closeAction->setEnabled(false);
+    }
     delete docToClose;
     delete w;
     if (m_timelineArea->count() == 0) {
@@ -1202,6 +1206,7 @@ void MainWindow::connectDocumentInfo(KdenliveDoc *doc) {
 
 void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //changed
     //m_projectMonitor->stop();
+    m_closeAction->setEnabled(m_timelineArea->count() > 1);
     kDebug() << "///////////////////   CONNECTING DOC TO PROJECT VIEW ////////////////";
     if (m_activeDocument) {
         if (m_activeDocument == doc) return;