Remember last folder for dvd projects

CCBUG: 96281
parent c2749e94
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <klocalizedstring.h> #include <klocalizedstring.h>
#include <KMessageBox> #include <KMessageBox>
#include <KRecentDirs>
#include <QFile> #include <QFile>
#include <QTimer> #include <QTimer>
...@@ -908,10 +909,12 @@ void DvdWizard::slotAbort() ...@@ -908,10 +909,12 @@ void DvdWizard::slotAbort()
void DvdWizard::slotSave() void DvdWizard::slotSave()
{ {
QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save DVD Project"), QUrl::fromLocalFile(QDir::homePath()), i18n("DVD project (*.kdvd)")); QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
QUrl url = QFileDialog::getSaveFileUrl(this, i18n("Save DVD Project"), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid()) if (!url.isValid())
return; return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
if (currentId() == 0) if (currentId() == 0)
m_pageChapters->setVobFiles(m_pageVob->dvdFormat(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters()); m_pageChapters->setVobFiles(m_pageVob->dvdFormat(), m_pageVob->selectedUrls(), m_pageVob->durations(), m_pageVob->chapters());
...@@ -945,9 +948,12 @@ void DvdWizard::slotSave() ...@@ -945,9 +948,12 @@ void DvdWizard::slotSave()
void DvdWizard::slotLoad() void DvdWizard::slotLoad()
{ {
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl::fromLocalFile(QDir::homePath()), i18n("DVD project (*.kdvd)")); QString projectFolder = KRecentDirs::dir(":KdenliveDvdFolder");
if (projectFolder.isEmpty()) projectFolder = QDir::homePath();
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl::fromLocalFile(projectFolder), i18n("DVD project (*.kdvd)"));
if (!url.isValid()) if (!url.isValid())
return; return;
KRecentDirs::add(":KdenliveDvdFolder", url.adjusted(QUrl::RemoveFilename).path());
QDomDocument doc; QDomDocument doc;
QFile file(url.path()); QFile file(url.path());
doc.setContent(&file, false); doc.setContent(&file, false);
......
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