]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Warn before overwriting stabilized clip
[kdenlive] / src / mainwindow.cpp
index 693ba5f2aaccc9382f4df8305a91b597d2c1ea9a..acb2d2d4ee31fb9bb58d0bbf7c1eaaac259af247 100644 (file)
@@ -2111,13 +2111,23 @@ void MainWindow::openFile(const KUrl &url)
         // Opening a compressed project file, we need to process it
         kDebug()<<"Opening archive, processing";
         QPointer<ArchiveWidget> ar = new ArchiveWidget(url);
-        if (ar->exec() == QDialog::Accepted) openFile(KUrl(ar->extractedProjectFile()));
+        if (ar->exec() == QDialog::Accepted) {
+           openFile(KUrl(ar->extractedProjectFile()));
+       }
+       else if (!m_startUrl.isEmpty()) {
+           // we tried to open an invalid file from command line, init new project
+           newFile(false);
+       }
         delete ar;
         return;
     }
     if (!url.fileName().endsWith(".kdenlive")) {
         // This is not a Kdenlive project file, abort loading
         KMessageBox::sorry(this, i18n("File %1 is not a Kdenlive project file", url.path()));
+       if (!m_startUrl.isEmpty()) {
+           // we tried to open an invalid file from command line, init new project
+           newFile(false);
+       }
         return;
     }
 
@@ -3362,14 +3372,25 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
         //m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
         return;
     }
+    
+    // Check if we already have a properties dialog opened for that clip
+    QList <ClipProperties *> list = findChildren<ClipProperties *>();
+    for (int i = 0; i < list.size(); ++i) {
+        if (list.at(i)->clipId() == clip->getId()) {
+           // We have one dialog, show it
+           list.at(i)->raise();
+           return;
+       }
+    }
 
     // any type of clip but a title
     ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
 
     if (clip->clipType() == AV || clip->clipType() == VIDEO || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW) {
        // request clip thumbnails
-       m_activeDocument->clipManager()->requestThumbs(QString('?' + clip->getId()), QList<int>() << clip->getClipThumbFrame());
        connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(const QString&,QImage)), dia, SLOT(slotGotThumbnail(const QString&,QImage)));
+       connect(dia, SIGNAL(requestThumb(const QString, QList <int>)), m_activeDocument->clipManager(), SLOT(slotRequestThumbs(QString,QList<int>)));
+       m_activeDocument->clipManager()->slotRequestThumbs(QString('?' + clip->getId()), QList<int>() << clip->getClipThumbFrame());
     }
     
     connect(dia, SIGNAL(addMarkers(const QString &, QList <CommentedTime>)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, QList <CommentedTime>)));
@@ -4037,22 +4058,6 @@ void MainWindow::slotStartClipAction()
         filtername=action->data().toString();
     }
     m_projectList->startClipFilterJob(filtername, condition);
-    /*
-    if (ids.isEmpty()) {
-        m_messageLabel->setMessage(i18n("No clip to transcode"), ErrorMessage);
-        return;
-    }
-    QString destination;
-    ProjectItem *item = m_projectList->getClipById(ids.at(0));
-    if (ids.count() == 1) {
-
-    }
-    ClipStabilize *d = new ClipStabilize(destination, ids.count(), filtername);
-    //connect(d, SIGNAL(addClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
-    if (d->exec() == QDialog::Accepted) {
-        m_projectList->slotStabilizeClipJob(ids, d->autoAddClip(), d->params(), d->desc());
-    }
-    delete d;*/
 }
 
 void MainWindow::slotTranscode(KUrl::List urls)