if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
m_activeDocument->setProjectFolder(w->selectedFolder());
+ if (m_renderWidget) m_renderWidget->setDocumentPath(w->selectedFolder().path());
if (m_activeDocument->profilePath() != profile) {
// Profile was changed
m_activeDocument->setProfilePath(profile);
void MainWindow::slotRenderProject() {
if (!m_renderWidget) {
- m_renderWidget = new RenderWidget(this);
+ QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path() : KdenliveSettings::defaultprojectfolder();
+ m_renderWidget = new RenderWidget(projectfolder, this);
connect(m_renderWidget, SIGNAL(doRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool, double, double, bool)), this, SLOT(slotDoRender(const QString&, const QString&, const QStringList &, const QStringList &, bool, bool, double, double, bool)));
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 &)));
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu);
m_activeTimeline = trackView;
- if (m_renderWidget) m_renderWidget->setProfile(doc->mltProfile());
+ if (m_renderWidget) {
+ m_renderWidget->setProfile(doc->mltProfile());
+ m_renderWidget->setDocumentPath(doc->projectFolder().path());
+ }
//doc->setRenderer(m_projectMonitor->render);
m_commandStack->setActiveStack(doc->commandStack());
KdenliveSettings::setProject_display_ratio(doc->dar());
const int MetaGroupRole = GroupRole + 6;
const int ExtraRole = GroupRole + 7;
-RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
+RenderWidget::RenderWidget(const QString &projectfolder, QWidget * parent): QDialog(parent), m_projectFolder(projectfolder) {
m_view.setupUi(this);
setWindowTitle(i18n("Rendering"));
m_view.buttonDelete->setIcon(KIcon("trash-empty"));
}
}
+void RenderWidget::setDocumentPath(const QString path) {
+ m_projectFolder = path;
+ const QString fileName = m_view.out_file->url().fileName();
+ m_view.out_file->setUrl(KUrl(m_projectFolder + '/' + fileName));
+}
+
void RenderWidget::slotUpdateGuideBox() {
m_view.guides_box->setVisible(m_view.render_guide->isChecked());
}
else path = path.left(pos) + extension;
} else {
- path = QDir::homePath() + "/untitled." + extension;
+ path = m_projectFolder + "/untitled." + extension;
}
return KUrl(path);
}
Q_OBJECT
public:
- RenderWidget(QWidget * parent = 0);
+ RenderWidget(const QString &projectfolder, QWidget * parent = 0);
void setGuides(QDomElement guidesxml, double duration);
void focusFirstVisibleItem();
void setProfile(MltVideoProfile profile);
void setRenderJob(const QString &dest, int progress = 0);
void setRenderStatus(const QString &dest, int status, const QString &error);
+ void setDocumentPath(const QString path);
private slots:
void slotUpdateButtons(KUrl url);
private:
Ui::RenderWidget_UI m_view;
MltVideoProfile m_profile;
+ QString m_projectFolder;
void parseProfiles(QString group = QString(), QString profile = QString());
void parseFile(QString exportFile, bool editable);
void updateButtons();