From: Jean-Baptiste Mardelle Date: Fri, 26 Jun 2009 10:57:01 +0000 (+0000) Subject: Save rendered file url in document: X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1c51f31008501d8268b1eb3fef2688433a3624c8;p=kdenlive Save rendered file url in document: http://kdenlive.org/mantis/view.php?id=862 svn path=/trunk/kdenlive/; revision=3671 --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 95a20907..0cb8ea26 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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); } diff --git a/src/mainwindow.h b/src/mainwindow.h index 0c58546d..d031f0b2 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -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: diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index afd745ef..5906ea68 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -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); diff --git a/src/renderwidget.h b/src/renderwidget.h index ad4330cf..064664e6 100644 --- a/src/renderwidget.h +++ b/src/renderwidget.h @@ -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); };