]> git.sesse.net Git - kdenlive/commitdiff
Save rendered file url in document:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 26 Jun 2009 10:57:01 +0000 (10:57 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 26 Jun 2009 10:57:01 +0000 (10:57 +0000)
http://kdenlive.org/mantis/view.php?id=862

svn path=/trunk/kdenlive/; revision=3671

src/mainwindow.cpp
src/mainwindow.h
src/renderwidget.cpp
src/renderwidget.h

index 95a20907095d09f9acf9d32d4411b4de83aab1d0..0cb8ea2664cf99befaa9c6aedf7f87f471d7bf42 100644 (file)
@@ -1612,15 +1612,15 @@ void MainWindow::slotRenderProject()
     if (!m_renderWidget) {
         QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
         m_renderWidget = new RenderWidget(projectfolder, this);
-        connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &)));
+        connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &, const QString&)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &, const QString&)));
         connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
         connect(m_renderWidget, SIGNAL(abortProcess(const QString &)), this, SIGNAL(abortRenderJob(const QString &)));
         connect(m_renderWidget, SIGNAL(openDvdWizard(const QString &, const QString &)), this, SLOT(slotDvdWizard(const QString &, const QString &)));
         if (m_activeDocument) {
             m_renderWidget->setProfile(m_activeDocument->mltProfile());
             m_renderWidget->setGuides(m_activeDocument->guidesXml(), m_activeDocument->projectDuration());
-            m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("renderprofile"));
             m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
+            m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"));
         }
     }
     /*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
@@ -1791,7 +1791,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
         m_renderWidget->setProfile(doc->mltProfile());
         m_renderWidget->setGuides(doc->guidesXml(), doc->projectDuration());
         m_renderWidget->setDocumentPath(doc->projectFolder().path(KUrl::AddTrailingSlash));
-        m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"));
+        m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"));
     }
     //doc->setRenderer(m_projectMonitor->render);
     m_commandStack->setActiveStack(doc->commandStack());
@@ -2677,11 +2677,12 @@ void MainWindow::slotTranscodeClip()
     slotTranscode(urls);
 }
 
-void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &name)
+void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &name, const QString &file)
 {
     if (m_activeDocument == NULL) return;
     m_activeDocument->setDocumentProperty("renderdestination", dest);
     m_activeDocument->setDocumentProperty("renderprofile", name);
+    m_activeDocument->setDocumentProperty("renderurl", file);
     m_activeDocument->setModified(true);
 }
 
index 0c58546d9425dce9545fafbcba582df66077f9f3..d031f0b21a5227cd3dcdb30920a873dea8c5190f 100644 (file)
@@ -301,7 +301,7 @@ private slots:
     void slotMaximizeCurrent(bool show);
     void slotTranscode(KUrl::List urls = KUrl::List());
     void slotTranscodeClip();
-    void slotSetDocumentRenderProfile(const QString &dest, const QString &name);
+    void slotSetDocumentRenderProfile(const QString &dest, const QString &name, const QString &file);
     void slotPrepareRendering(bool scriptExport, bool zoneOnly, const QString &chapterFile);
 
 signals:
index afd745ef13384bc884af2b78a2ed8907ea3a29f2..5906ea68c65cc81eaa058fef38dff8724148510d 100644 (file)
@@ -200,10 +200,13 @@ void RenderWidget::showInfoPanel()
 
 void RenderWidget::setDocumentPath(const QString path)
 {
+    if (m_view.out_file->url().directory() == KUrl(m_projectFolder).directory()) {
+        const QString fileName = m_view.out_file->url().fileName();
+        m_view.out_file->setUrl(KUrl(path + fileName));
+    }
     m_projectFolder = path;
-    const QString fileName = m_view.out_file->url().fileName();
-    m_view.out_file->setUrl(KUrl(m_projectFolder + fileName));
     parseScriptFiles();
+
 }
 
 void RenderWidget::slotUpdateGuideBox()
@@ -741,7 +744,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
     m_view.tabWidget->setCurrentIndex(1);
 
     // Save rendering profile to document
-    emit selectedRenderProfile(m_view.size_list->currentItem()->data(MetaGroupRole).toString(), m_view.size_list->currentItem()->text());
+    emit selectedRenderProfile(m_view.size_list->currentItem()->data(MetaGroupRole).toString(), m_view.size_list->currentItem()->text(), dest);
 
     // insert item in running jobs list
     QTreeWidgetItem *renderItem;
@@ -1519,11 +1522,14 @@ void RenderWidget::slotHideLog()
     m_view.error_box->setVisible(false);
 }
 
-void RenderWidget::setRenderProfile(const QString &dest, const QString &name)
+void RenderWidget::setRenderProfile(const QString &dest, const QString &name, const QString &url)
 {
     m_view.destination_list->blockSignals(true);
     m_view.format_list->blockSignals(true);
     m_view.size_list->blockSignals(true);
+
+    if (!url.isEmpty()) m_view.out_file->setUrl(KUrl(url));
+
     for (int i = 0; i < m_view.destination_list->count(); i++) {
         if (m_view.destination_list->itemData(i, Qt::UserRole) == dest) {
             m_view.destination_list->setCurrentIndex(i);
index ad4330cfdd0f817390c131d973f602e4a60821a4..064664e6fbd7fdac802eccbf7d9351ee0b6600e8 100644 (file)
@@ -107,7 +107,7 @@ public:
     void setRenderStatus(const QString &dest, int status, const QString &error);
     void setDocumentPath(const QString path);
     void reloadProfiles();
-    void setRenderProfile(const QString &dest, const QString &name);
+    void setRenderProfile(const QString &dest, const QString &name, const QString &url);
     int waitingJobsCount() const;
     QString getFreeScriptName(const QString &prefix = QString());
     bool startWaitingRenderJobs();
@@ -154,7 +154,9 @@ private:
 signals:
     void abortProcess(const QString &url);
     void openDvdWizard(const QString &url, const QString &profile);
-    void selectedRenderProfile(const QString &category, const QString &name);
+    /** Send the infos about rendering that will be saved in the document:
+    (profile destination, profile name and url of rendered file */
+    void selectedRenderProfile(const QString &, const QString &, const QString &);
     void prepareRenderingData(bool scriptExport, bool zoneOnly, const QString &chapterFile);
 };