Save rendered file url in document:

http://kdenlive.org/mantis/view.php?id=862

svn path=/trunk/kdenlive/; revision=3671
parent 94f0464b
......@@ -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);
}
......
......@@ -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:
......
......@@ -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);
......
......@@ -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);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment