summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-28 13:51:36 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-10-28 13:51:36 (GMT)
commit8996c30e56b5ff6126adf828fdd7681320a5f7af (patch)
tree8e2d53f9e0889e17f045976c1974cfb6fd41c82b
parentaa9251299969aff2ffaaeae0edb81def5239a680 (diff)
* First steps towards using custom project folder to store tmp data (wip)
* First steps towards "portable" projects (using relative paths)
-rw-r--r--src/bin/bin.cpp11
-rw-r--r--src/bin/bin.h2
-rw-r--r--src/dialogs/clipcreationdialog.cpp11
-rw-r--r--src/dialogs/kdenlivesettingsdialog.cpp8
-rw-r--r--src/doc/documentchecker.cpp47
-rw-r--r--src/doc/documentchecker.h1
-rw-r--r--src/doc/kdenlivedoc.cpp96
-rw-r--r--src/doc/kdenlivedoc.h6
-rw-r--r--src/effectslist/initeffects.cpp7
-rw-r--r--src/kdenlivesettings.kcfg7
-rw-r--r--src/mainwindow.cpp59
-rw-r--r--src/monitor/monitor.cpp10
-rw-r--r--src/monitor/monitor.h4
-rw-r--r--src/monitor/monitormanager.cpp2
-rw-r--r--src/project/clipmanager.cpp2
-rw-r--r--src/project/dialogs/projectsettings.cpp25
-rw-r--r--src/project/dialogs/projectsettings.h1
-rw-r--r--src/project/dialogs/temporarydata.cpp19
-rw-r--r--src/project/projectmanager.cpp29
-rw-r--r--src/project/projectmanager.h2
-rw-r--r--src/renderer.cpp35
-rw-r--r--src/renderer.h5
-rw-r--r--src/timeline/managers/previewmanager.cpp15
-rw-r--r--src/timeline/timeline.cpp1
-rw-r--r--src/ui/configenv_ui.ui32
-rw-r--r--src/ui/configproject_ui.ui193
-rw-r--r--src/ui/projectsettings_ui.ui232
27 files changed, 514 insertions, 348 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index 20a4516..3125ce5 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -934,7 +934,7 @@ ProjectFolder *Bin::rootFolder()
return m_rootFolder;
}
-QUrl Bin::projectFolder() const
+QString Bin::projectFolder() const
{
return m_doc->projectFolder();
}
@@ -3003,7 +3003,7 @@ void Bin::slotLoadClipMarkers(const QString &id)
}
cbox->setCurrentIndex(KdenliveSettings::default_marker_type());
//TODO KF5 how to add custom cbox to Qfiledialog
- QPointer<QFileDialog> fd = new QFileDialog(this, i18n("Load Clip Markers"), m_doc->projectFolder().path());
+ QPointer<QFileDialog> fd = new QFileDialog(this, i18n("Load Clip Markers"), m_doc->projectFolder());
fd->setMimeTypeFilters(QStringList()<<QStringLiteral("text/plain"));
fd->setFileMode(QFileDialog::ExistingFile);
if (fd->exec() != QDialog::Accepted) return;
@@ -3085,7 +3085,7 @@ void Bin::slotSaveClipMarkers(const QString &id)
}
cbox->setCurrentIndex(0);
//TODO KF5 how to add custom cbox to Qfiledialog
- QPointer<QFileDialog> fd = new QFileDialog(this, i18n("Save Clip Markers"), m_doc->projectFolder().path());
+ QPointer<QFileDialog> fd = new QFileDialog(this, i18n("Save Clip Markers"), m_doc->projectFolder());
fd->setMimeTypeFilters(QStringList() << QStringLiteral("text/plain"));
fd->setFileMode(QFileDialog::AnyFile);
fd->setAcceptMode(QFileDialog::AcceptSave);
@@ -3160,8 +3160,9 @@ void Bin::slotGetCurrentProjectImage(bool request)
void Bin::showTitleWidget(ProjectClip *clip)
{
QString path = clip->getProducerProperty(QStringLiteral("resource"));
- QString titlepath = m_doc->projectFolder().path() + QDir::separator() + "titles/";
- TitleWidget dia_ui(QUrl(), m_doc->timecode(), titlepath, pCore->monitorManager()->projectMonitor()->render, pCore->window());
+ QDir titleFolder(m_doc->projectFolder() + QStringLiteral("/titles"));
+ titleFolder.mkpath(QStringLiteral("."));
+ TitleWidget dia_ui(QUrl(), m_doc->timecode(), titleFolder.absolutePath(), pCore->monitorManager()->projectMonitor()->render, pCore->window());
connect(&dia_ui, SIGNAL(requestBackgroundFrame(bool)), pCore->monitorManager()->projectMonitor(), SLOT(slotGetCurrentImage(bool)));
QDomDocument doc;
QString xmldata = clip->getProducerProperty(QStringLiteral("xmldata"));
diff --git a/src/bin/bin.h b/src/bin/bin.h
index 0a3c489..e2dcf86 100644
--- a/src/bin/bin.h
+++ b/src/bin/bin.h
@@ -496,7 +496,7 @@ public:
/** @brief An effect setting was changed, update stack if displayed. */
void updateMasterEffect(ClipController *ctl);
/** @brief Returns current project's folder for storing items. */
- QUrl projectFolder() const;
+ QString projectFolder() const;
/** @brief Display a message about an operation in status bar. */
void emitMessage(const QString &, int, MessageType);
void rebuildMenu();
diff --git a/src/dialogs/clipcreationdialog.cpp b/src/dialogs/clipcreationdialog.cpp
index 8666409..6d8fef0 100644
--- a/src/dialogs/clipcreationdialog.cpp
+++ b/src/dialogs/clipcreationdialog.cpp
@@ -263,10 +263,9 @@ void ClipCreationDialog::createSlideshowClip(KdenliveDoc *doc, QStringList group
void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin)
{
// Make sure the titles folder exists
- QDir dir(doc->projectFolder().path());
- dir.mkdir(QStringLiteral("titles"));
- dir.cd(QStringLiteral("titles"));
- QPointer<TitleWidget> dia_ui = new TitleWidget(QUrl::fromLocalFile(templatePath), doc->timecode(), dir.path(), doc->renderer(), bin);
+ QDir dir(doc->projectFolder() + QStringLiteral("/titles"));
+ dir.mkpath(QStringLiteral("."));
+ QPointer<TitleWidget> dia_ui = new TitleWidget(QUrl::fromLocalFile(templatePath), doc->timecode(), dir.absolutePath(), doc->renderer(), bin);
QObject::connect(dia_ui, SIGNAL(requestBackgroundFrame(bool)), bin, SLOT(slotGetCurrentProjectImage(bool)));
if (dia_ui->exec() == QDialog::Accepted) {
// Ready, create clip xml
@@ -298,7 +297,7 @@ void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, QStringList groupInfo
void ClipCreationDialog::createTitleTemplateClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
{
- QPointer<TitleTemplateDialog> dia = new TitleTemplateDialog(doc->projectFolder().path(), QApplication::activeWindow());
+ QPointer<TitleTemplateDialog> dia = new TitleTemplateDialog(doc->projectFolder(), QApplication::activeWindow());
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia->selectedTemplate();
@@ -456,7 +455,7 @@ void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QList<QUrl>
for (int i = 0; i < items.count() ; ++i) {
QDomElement content = items.item(i).toElement();
if (content.hasAttribute(QStringLiteral("base64"))) {
- QString titlesFolder = doc->projectFolder().path() + QDir::separator() + "titles/";
+ QString titlesFolder = doc->projectFolder()+ QStringLiteral("/titles/");
QString path = TitleDocument::extractBase64Image(titlesFolder, content.attribute(QStringLiteral("base64")));
if (!path.isEmpty()) {
content.setAttribute(QStringLiteral("url"), path);
diff --git a/src/dialogs/kdenlivesettingsdialog.cpp b/src/dialogs/kdenlivesettingsdialog.cpp
index aed884b..bc94613 100644
--- a/src/dialogs/kdenlivesettingsdialog.cpp
+++ b/src/dialogs/kdenlivesettingsdialog.cpp
@@ -83,6 +83,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
m_page8->setIcon(KoIconUtils::themedIcon(QStringLiteral("project-defaults")));
connect(m_configProject.kcfg_generateproxy, SIGNAL(toggled(bool)), m_configProject.kcfg_proxyminsize, SLOT(setEnabled(bool)));
m_configProject.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
+ m_configProject.projecturl->setMode(KFile::Directory);
+ m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
connect(m_configProject.kcfg_generateimageproxy, SIGNAL(toggled(bool)), m_configProject.kcfg_proxyimageminsize, SLOT(setEnabled(bool)));
m_configProject.kcfg_proxyimageminsize->setEnabled(KdenliveSettings::generateimageproxy());
@@ -103,8 +105,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
m_configEnv.kcfg_mltthreads->setMaximum(maxThreads > 2 ? maxThreads : 8);
m_configEnv.tmppathurl->setMode(KFile::Directory);
m_configEnv.tmppathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_currenttmpfolder"));
- m_configEnv.projecturl->setMode(KFile::Directory);
- m_configEnv.projecturl->lineEdit()->setObjectName(QStringLiteral("kcfg_defaultprojectfolder"));
m_configEnv.capturefolderurl->setMode(KFile::Directory);
m_configEnv.capturefolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_capturefolder"));
m_configEnv.capturefolderurl->setEnabled(!KdenliveSettings::capturetoprojectfolder());
@@ -707,6 +707,10 @@ void KdenliveSettingsDialog::updateSettings()
updateCapturePath = true;
}
+ if (m_configProject.projecturl->url().path() != KdenliveSettings::defaultprojectfolder()) {
+ KdenliveSettings::setDefaultprojectfolder(m_configProject.projecturl->url().path());
+ }
+
if (m_configEnv.capturefolderurl->url().path() != KdenliveSettings::capturefolder()) {
KdenliveSettings::setCapturefolder(m_configEnv.capturefolderurl->url().path());
updateCapturePath = true;
diff --git a/src/doc/documentchecker.cpp b/src/doc/documentchecker.cpp
index a9bffdf..8b8098c 100644
--- a/src/doc/documentchecker.cpp
+++ b/src/doc/documentchecker.cpp
@@ -68,10 +68,21 @@ bool DocumentChecker::hasErrorInClips()
QDomElement e;
QString resource;
int max;
- QString root = m_doc.documentElement().attribute(QStringLiteral("root"));
- if (!root.isEmpty()) root = QDir::cleanPath(root) + QDir::separator();
+ QDomElement baseElement = m_doc.documentElement();
+ QString root = baseElement.attribute(QStringLiteral("root"));
+ if (!root.isEmpty()) {
+ QDir dir(root);
+ if (!dir.exists()) {
+ // Looks like project was moved, try recovering root from current project url
+ m_rootReplacement.first = root;
+ root = m_url.adjusted(QUrl::RemoveFilename).path();
+ baseElement.setAttribute(QStringLiteral("root"), root);
+ m_rootReplacement.second = root;
+ }
+ root = QDir::cleanPath(root) + QDir::separator();
+ }
QDomNodeList documentProducers = m_doc.elementsByTagName(QStringLiteral("producer"));
- QDomElement profile = m_doc.documentElement().firstChildElement(QStringLiteral("profile"));
+ QDomElement profile = baseElement.firstChildElement(QStringLiteral("profile"));
bool hdProfile = true;
if (!profile.isNull()) {
if (profile.attribute(QStringLiteral("width")).toInt() < 1000) {
@@ -270,24 +281,44 @@ bool DocumentChecker::hasErrorInClips()
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.treeWidget, QStringList() << clipType);
item->setData(0, statusRole, CLIPMISSING);
+ item->setData(0, clipTypeRole, type);
+ item->setData(0, idRole, e.attribute(QStringLiteral("id")));
+ item->setToolTip(0, i18n("Missing item"));
+
if (status == TITLE_IMAGE_ELEMENT) {
item->setIcon(0, KoIconUtils::themedIcon("dialog-warning"));
item->setToolTip(1, e.attribute("name"));
- item->setText(1, e.attribute("resource"));
+ QString imageResource = e.attribute("resource");
item->setData(0, typeRole, status);
item->setData(0, typeOriginalResource, e.attribute("resource"));
+ if (!m_rootReplacement.first.isEmpty()) {
+ if (imageResource.startsWith(m_rootReplacement.first)) {
+ imageResource.replace(m_rootReplacement.first, m_rootReplacement.second);
+ if (QFile::exists(imageResource)) {
+ item->setData(0, statusRole, CLIPOK);
+ item->setToolTip(0, i18n("Relocated item"));
+ }
+ }
+ }
+ item->setText(1, imageResource);
} else {
item->setIcon(0, KoIconUtils::themedIcon("dialog-close"));
if (!resource.startsWith("/")) {
resource.prepend(root);
}
- item->setText(1, resource);
item->setData(0, hashRole, EffectsList::property(e, QStringLiteral("kdenlive:file_hash")));
item->setData(0, sizeRole, EffectsList::property(e, QStringLiteral("kdenlive:file_size")));
+ if (!m_rootReplacement.first.isEmpty()) {
+ if (resource.startsWith(m_rootReplacement.first)) {
+ resource.replace(m_rootReplacement.first, m_rootReplacement.second);
+ if (QFile::exists(resource)) {
+ item->setData(0, statusRole, CLIPOK);
+ item->setToolTip(0, i18n("Relocated item"));
+ }
+ }
+ }
+ item->setText(1, resource);
}
- item->setData(0, clipTypeRole, type);
- item->setData(0, idRole, e.attribute(QStringLiteral("id")));
- item->setToolTip(0, i18n("Missing item"));
}
foreach(const QString font, m_missingFonts) {
diff --git a/src/doc/documentchecker.h b/src/doc/documentchecker.h
index 500a603..f27449e 100644
--- a/src/doc/documentchecker.h
+++ b/src/doc/documentchecker.h
@@ -64,6 +64,7 @@ private:
QDomDocument m_doc;
Ui::MissingClips_UI m_ui;
QDialog *m_dialog;
+ QPair <QString, QString>m_rootReplacement;
QString searchPathRecursively(const QDir &dir, const QString &fileName, ClipType type = Unknown) const;
QString searchFileRecursively(const QDir &dir, const QString &matchSize, const QString &matchHash, const QString &fileName) const;
void checkStatus();
diff --git a/src/doc/kdenlivedoc.cpp b/src/doc/kdenlivedoc.cpp
index f4cacc5..5ad59bb 100644
--- a/src/doc/kdenlivedoc.cpp
+++ b/src/doc/kdenlivedoc.cpp
@@ -85,7 +85,7 @@ void DocUndoStack::push(QUndoCommand *cmd)
const double DOCUMENTVERSION = 0.95;
-KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent) :
+KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent) :
QObject(parent),
m_autosave(NULL),
m_url(url),
@@ -153,7 +153,6 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
j.next();
m_documentMetadata[j.key()] = j.value();
}
-
if (QLocale().decimalPoint() != QLocale::system().decimalPoint()) {
setlocale(LC_NUMERIC, "");
QLocale systemLocale = QLocale::system();
@@ -257,7 +256,6 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
}
}
}
- initCacheDirs();
// Something went wrong, or a new file was requested: create a new project
if (!success) {
@@ -267,28 +265,22 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
updateProjectProfile(false);
}
- // Ask to create the project directory if it does not exist
- QFileInfo checkProjectFolder(m_projectFolder.toString(QUrl::RemoveFilename | QUrl::RemoveScheme));
- if (!QFile::exists(m_projectFolder.path()) && checkProjectFolder.isWritable()) {
- int create = KMessageBox::questionYesNo(parent, i18n("Project directory %1 does not exist. Create it?", m_projectFolder.path()));
- if (create == KMessageBox::Yes) {
- QDir projectDir(m_projectFolder.path());
- bool ok = projectDir.mkpath(m_projectFolder.path());
- if (!ok) {
- KMessageBox::sorry(parent, i18n("The directory %1, could not be created.\nPlease make sure you have the required permissions.", m_projectFolder.path()));
+ if (!m_projectFolder.isEmpty()) {
+ // Ask to create the project directory if it does not exist
+ QDir folder(m_projectFolder);
+ if (!folder.mkpath(QStringLiteral("."))) {
+ // Project folder is not writable
+ m_projectFolder = m_url.toString(QUrl::RemoveFilename | QUrl::RemoveScheme);
+ folder.setPath(m_projectFolder);
+ if (folder.exists()) {
+ KMessageBox::sorry(parent, i18n("The project directory %1, could not be created.\nPlease make sure you have the required permissions.\nDefaulting to system folders", m_projectFolder));
+ } else {
+ KMessageBox::information(parent, i18n("Document project folder is invalid, using system default folders"));
}
+ m_projectFolder.clear();
}
}
-
- // Make sure the project folder is usable
- if (m_projectFolder.isEmpty() || !QFile::exists(m_projectFolder.path())) {
- KMessageBox::information(parent, i18n("Document project folder is invalid, setting it to the default one: %1", KdenliveSettings::defaultprojectfolder()));
- m_projectFolder = QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder());
- }
-
- // Make sure that the necessary folders exist
- QDir dir(m_projectFolder.path());
- dir.mkdir(QStringLiteral("titles"));
+ initCacheDirs();
updateProjectFolderPlacesEntry();
}
@@ -307,10 +299,9 @@ KdenliveDoc::~KdenliveDoc()
bool ok;
documentId.toLong(&ok);
if (ok && !documentId.isEmpty()) {
- QString kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
- QDir cacheDir(kdenliveCacheDir + "/" + documentId);
- if (cacheDir.exists() && cacheDir.dirName() == documentId) {
- cacheDir.removeRecursively();
+ QDir baseCache = getCacheDir(CacheBase, &ok);
+ if (baseCache.dirName() == documentId && baseCache.entryList(QDir::Files).count() == 0) {
+ baseCache.removeRecursively();
}
}
}
@@ -573,7 +564,7 @@ void KdenliveDoc::slotAutoSave()
qDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE";
}
//qDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName();
- QDomDocument sceneList = xmlSceneList(m_render->sceneList());
+ QDomDocument sceneList = xmlSceneList(m_render->sceneList(m_url.adjusted(QUrl::RemoveFilename).path()));
if (sceneList.isNull()) {
//Make sure we don't save if scenelist is corrupted
KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file %1, scene list is corrupted.", m_autosave->fileName()));
@@ -731,23 +722,25 @@ QString KdenliveDoc::groupsXml() const
return m_clipManager->groupsXml();
}
-QUrl KdenliveDoc::projectFolder() const
+QString KdenliveDoc::projectFolder() const
{
- //if (m_projectFolder.isEmpty()) return QUrl(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "//projects/");
+ if (m_projectFolder.isEmpty()) {
+ return QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ }
return m_projectFolder;
}
void KdenliveDoc::setProjectFolder(QUrl url)
{
- if (url == m_projectFolder) return;
+ if (url == QUrl::fromLocalFile(m_projectFolder)) return;
setModified(true);
QDir dir(url.toLocalFile());
if (!dir.exists()) {
dir.mkpath(dir.absolutePath());
}
dir.mkdir(QStringLiteral("titles"));
- if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?", m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url);
- m_projectFolder = url;
+ if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?", m_projectFolder, url.path())) == KMessageBox::Yes) moveProjectData(url);
+ m_projectFolder = url.path();
updateProjectFolderPlacesEntry();
}
@@ -974,7 +967,7 @@ ClipController *KdenliveDoc::getClipController(const QString &clipId)
void KdenliveDoc::slotCreateTextTemplateClip(const QString &group, const QString &groupId, QUrl path)
{
- QString titlesFolder = QDir::cleanPath(projectFolder().path() + QDir::separator() + "titles/");
+ QString titlesFolder = QDir::cleanPath(m_projectFolder + "/titles/");
if (path.isEmpty()) {
QPointer<QFileDialog> d = new QFileDialog(QApplication::activeWindow(), i18n("Enter Template Path"), titlesFolder);
d->setMimeTypeFilters(QStringList() << QStringLiteral("application/x-kdenlivetitle"));
@@ -1076,7 +1069,7 @@ void KdenliveDoc::updateProjectFolderPlacesEntry()
KBookmark bookmark = root.first();
QString kdenliveName = QCoreApplication::applicationName();
- QUrl documentLocation = m_projectFolder;
+ QUrl documentLocation = QUrl::fromLocalFile(m_projectFolder);
bool exists = false;
@@ -1389,7 +1382,7 @@ QMap <QString, QString> KdenliveDoc::documentProperties()
{
m_documentProperties.insert(QStringLiteral("version"), QString::number(DOCUMENTVERSION));
m_documentProperties.insert(QStringLiteral("kdenliveversion"), QStringLiteral(KDENLIVE_VERSION));
- m_documentProperties.insert(QStringLiteral("projectfolder"), m_projectFolder.path());
+ m_documentProperties.insert(QStringLiteral("storagefolder"), m_projectFolder);
m_documentProperties.insert(QStringLiteral("profile"), profilePath());
m_documentProperties.insert(QStringLiteral("position"), QString::number(m_render->seekPosition().frames(m_render->fps())));
return m_documentProperties;
@@ -1416,12 +1409,11 @@ void KdenliveDoc::loadDocumentProperties()
}
}
}
- QString path = m_documentProperties.value(QStringLiteral("projectfolder"));
- if (!path.startsWith('/')) {
- QDir dir = QDir::home();
- path = dir.absoluteFilePath(path);
+ QString path = m_documentProperties.value(QStringLiteral("storagefolder"));
+ if (!path.isEmpty()) {
+ m_projectFolder = path;
}
- m_projectFolder = QUrl::fromLocalFile(path);
+
QString profile = m_documentProperties.value(QStringLiteral("profile"));
if (!profile.isEmpty())
m_profile = ProfilesDialog::getVideoProfile(profile);
@@ -1647,9 +1639,14 @@ void KdenliveDoc::saveMltPlaylist(const QString fileName)
void KdenliveDoc::initCacheDirs()
{
bool ok = false;
- QString kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QString kdenliveCacheDir;
QString documentId = QDir::cleanPath(getDocumentProperty(QStringLiteral("documentid")));
documentId.toLong(&ok);
+ if (m_projectFolder.isEmpty()) {
+ kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ } else {
+ kdenliveCacheDir = m_projectFolder;
+ }
if (!ok || documentId.isEmpty() || kdenliveCacheDir.isEmpty()) {
return;
}
@@ -1665,14 +1662,21 @@ void KdenliveDoc::initCacheDirs()
QDir KdenliveDoc::getCacheDir(CacheType type, bool *ok) const
{
- QString kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QString basePath;
+ QString kdenliveCacheDir;
QString documentId = QDir::cleanPath(getDocumentProperty(QStringLiteral("documentid")));
documentId.toLong(ok);
- if (!*ok || documentId.isEmpty() || kdenliveCacheDir.isEmpty()) {
- *ok = false;
- return QDir(kdenliveCacheDir);
+ if (m_projectFolder.isEmpty()) {
+ kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ if (!*ok || documentId.isEmpty() || kdenliveCacheDir.isEmpty()) {
+ *ok = false;
+ return QDir(kdenliveCacheDir);
+ }
+ } else {
+ // Use specified folder to store all files
+ kdenliveCacheDir = m_projectFolder;
}
- QString basePath = kdenliveCacheDir + "/" + documentId;
+ basePath = kdenliveCacheDir + QStringLiteral("/") + documentId;
switch (type) {
case CacheRoot:
basePath = kdenliveCacheDir;
diff --git a/src/doc/kdenlivedoc.h b/src/doc/kdenlivedoc.h
index 1ec2839..bde4065 100644
--- a/src/doc/kdenlivedoc.h
+++ b/src/doc/kdenlivedoc.h
@@ -75,7 +75,7 @@ class KdenliveDoc: public QObject
Q_OBJECT
public:
- KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent = 0);
+ KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap <QString, QString>& properties, const QMap <QString, QString>& metadata, const QPoint &tracks, Render *render, NotesPlugin *notes, bool *openBackup, MainWindow *parent = 0);
~KdenliveDoc();
QDomNodeList producersList();
double fps() const;
@@ -109,7 +109,7 @@ public:
bool isModified() const;
/** @brief Returns the project folder, used to store project files. */
- QUrl projectFolder() const;
+ QString projectFolder() const;
void setZoom(int horizontal, int vertical);
QPoint zoom() const;
double dar() const;
@@ -196,7 +196,7 @@ private:
bool m_modified;
/** @brief The project folder, used to store project files (titles, effects...). */
- QUrl m_projectFolder;
+ QString m_projectFolder;
QList <int> m_undoChunks;
QMap <QString, QString> m_documentProperties;
QMap <QString, QString> m_documentMetadata;
diff --git a/src/effectslist/initeffects.cpp b/src/effectslist/initeffects.cpp
index 95ff151..82cf4f1 100644
--- a/src/effectslist/initeffects.cpp
+++ b/src/effectslist/initeffects.cpp
@@ -181,13 +181,6 @@ bool initEffects::parseEffectFiles(Mlt::Repository* repository, const QString &l
consumersList << consumers->get_name(i);
delete consumers;
movit = true;
- // Seems like with latest changes, SDL works fine with movit
- /*if (consumersList.contains(QStringLiteral("rtaudio"))) {
- // enable movit GPU effects / display. Currently, Movit crashes with sdl_audio,
- // So enable only when rtaudio is available
- movit = true;
- }
- else KdenliveSettings::setGpu_accel(false);*/
}
else KdenliveSettings::setGpu_accel(false);
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index c7fa515..8e30602 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -381,7 +381,12 @@
<entry name="defaultprojectfolder" type="Path">
<label>Default folder for project files.</label>
- <default>$HOME/kdenlive</default>
+ <default></default>
+ </entry>
+
+ <entry name="customprojectfolder" type="Bool">
+ <label>Don't use default XDG folders to store project files.</label>
+ <default>false</default>
</entry>
<entry name="capturetoprojectfolder" type="Bool">
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d98f8c1..54738bc 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1573,13 +1573,9 @@ bool MainWindow::readOptions()
pCore->projectManager()->recentFilesAction()->loadEntries(KConfigGroup(config, "Recent Files"));
if (KdenliveSettings::defaultprojectfolder().isEmpty()) {
- QDir dir(QDir::homePath());
- if (!dir.mkdir(QStringLiteral("kdenlive"))) {
- qDebug() << "/// ERROR CREATING PROJECT FOLDER: ";
- } else {
- dir.cd("kdenlive");
- KdenliveSettings::setDefaultprojectfolder(dir.absolutePath());
- }
+ QDir dir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+ dir.mkpath(QStringLiteral("."));
+ KdenliveSettings::setDefaultprojectfolder(dir.absolutePath());
}
if (KdenliveSettings::trackheight() == 0) {
QFontMetrics metrics(font());
@@ -1605,6 +1601,13 @@ bool MainWindow::readOptions()
delete w;
::exit(1);
}
+ } else if (!KdenliveSettings::ffmpegpath().isEmpty() && !QFile::exists(KdenliveSettings::ffmpegpath())) {
+ // Invalid entry for FFmpeg, check system
+ QPointer<Wizard> w = new Wizard(true);
+ if (w->exec() == QDialog::Accepted && w->isOk()) {
+ w->adjustSettings();
+ }
+ delete w;
}
initialGroup.writeEntry("version", version);
return firstRun;
@@ -1632,7 +1635,7 @@ void MainWindow::slotEditProjectSettings()
KdenliveDoc *project = pCore->projectManager()->current();
QPoint p = pCore->projectManager()->currentTimeline()->getTracksCount();
- QPointer<ProjectSettings> w = new ProjectSettings(project, project->metadata(), pCore->projectManager()->currentTimeline()->projectView()->extractTransitionsLumas(), p.x(), p.y(), project->projectFolder().path(), true, !project->isModified(), this);
+ QPointer<ProjectSettings> w = new ProjectSettings(project, project->metadata(), pCore->projectManager()->currentTimeline()->projectView()->extractTransitionsLumas(), p.x(), p.y(), project->projectFolder(), true, !project->isModified(), this);
connect(w, SIGNAL(disableProxies()), this, SLOT(slotDisableProxies()));
connect(w, SIGNAL(disablePreview()), pCore->projectManager()->currentTimeline(), SLOT(invalidateRange()));
connect(w, SIGNAL(refreshProfiles()), this, SLOT(slotRefreshProfiles()));
@@ -1642,11 +1645,21 @@ void MainWindow::slotEditProjectSettings()
project->setProjectFolder(w->selectedFolder());
pCore->projectManager()->currentTimeline()->updatePreviewSettings(w->selectedPreview());
bool modified = false;
+ if (w->storageFolder() != project->projectFolder()) {
+ if (w->storageFolder().isEmpty() && project->projectFolder() == QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) {
+ // Ok, we continue to use system folders
+ } else {
+ // Project folder changed:
+ if (KMessageBox::warningContinueCancel(this, i18n("This will move all temporary files from <b>%1</b> to <b>%2</b>", project->projectFolder(), w->storageFolder().isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::CacheLocation) : w->storageFolder())) == KMessageBox::Continue) {
+ // Proceeed with move
+ }
+ }
+ }
if (m_recMonitor) {
- m_recMonitor->slotUpdateCaptureFolder(project->projectFolder().path() + QDir::separator());
+ m_recMonitor->slotUpdateCaptureFolder(project->projectFolder() + QDir::separator());
}
if (m_renderWidget) {
- m_renderWidget->setDocumentPath(project->projectFolder().path() + QDir::separator());
+ m_renderWidget->setDocumentPath(project->projectFolder() + QDir::separator());
}
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) {
slotSwitchVideoThumbs();
@@ -1716,7 +1729,7 @@ void MainWindow::slotRenderProject()
KdenliveDoc *project = pCore->projectManager()->current();
if (!m_renderWidget) {
- QString projectfolder = project ? project->projectFolder().path() + QDir::separator() : KdenliveSettings::defaultprojectfolder();
+ QString projectfolder = project ? project->projectFolder() + QDir::separator() : KdenliveSettings::defaultprojectfolder();
MltVideoProfile profile;
if (project) {
profile = project->mltProfile();
@@ -1728,7 +1741,7 @@ void MainWindow::slotRenderProject()
connect(m_renderWidget, SIGNAL(openDvdWizard(QString)), this, SLOT(slotDvdWizard(QString)));
m_renderWidget->setProfile(project->mltProfile());
m_renderWidget->setGuides(pCore->projectManager()->currentTimeline()->projectView()->guidesData(), project->projectDuration());
- m_renderWidget->setDocumentPath(project->projectFolder().path() + QDir::separator());
+ m_renderWidget->setDocumentPath(project->projectFolder() + QDir::separator());
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
if (m_compositeAction->currentAction())
@@ -1932,7 +1945,7 @@ void MainWindow::connectDocument()
slotCheckRenderStatus();
m_renderWidget->setProfile(project->mltProfile());
m_renderWidget->setGuides(pCore->projectManager()->currentTimeline()->projectView()->guidesData(), project->projectDuration());
- m_renderWidget->setDocumentPath(project->projectFolder().path() + QDir::separator());
+ m_renderWidget->setDocumentPath(project->projectFolder() + QDir::separator());
m_renderWidget->setRenderProfile(project->getRenderProperties());
}
m_zoomSlider->setValue(project->zoom().x());
@@ -1947,7 +1960,7 @@ void MainWindow::connectDocument()
pCore->monitorManager()->setDocument(project);
trackView->updateProfile(1.0);
if (m_recMonitor) {
- m_recMonitor->slotUpdateCaptureFolder(project->projectFolder().path() + QDir::separator());
+ m_recMonitor->slotUpdateCaptureFolder(project->projectFolder() + QDir::separator());
}
//Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
slotUpdateMousePosition(0);
@@ -2061,7 +2074,7 @@ void MainWindow::slotUpdateCaptureFolder()
{
if (m_recMonitor) {
if (pCore->projectManager()->current())
- m_recMonitor->slotUpdateCaptureFolder(pCore->projectManager()->current()->projectFolder().path() + QDir::separator());
+ m_recMonitor->slotUpdateCaptureFolder(pCore->projectManager()->current()->projectFolder() + QDir::separator());
else
m_recMonitor->slotUpdateCaptureFolder(KdenliveSettings::defaultprojectfolder());
}
@@ -2948,8 +2961,7 @@ void MainWindow::slotGetNewTitleStuff()
{
if (getNewStuff(QStringLiteral("kdenlive_titles.knsrc")) > 0) {
// get project title path
- QString titlePath = pCore->projectManager()->current()->projectFolder().path();
- titlePath.append(QStringLiteral("/titles/"));
+ QString titlePath = pCore->projectManager()->current()->projectFolder() + QStringLiteral("/titles/");
TitleWidget::refreshTitleTemplates(titlePath);
}
}
@@ -3273,7 +3285,7 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
playlistPath = temp.fileName();
}
- QString playlistContent = pCore->projectManager()->projectSceneList();
+ QString playlistContent = pCore->projectManager()->projectSceneList(project->url().adjusted(QUrl::RemoveFilename).path());
if (!chapterFile.isEmpty()) {
int in = 0;
int out;
@@ -3581,7 +3593,7 @@ void MainWindow::slotMonitorRequestRenderFrame(bool request)
void MainWindow::slotOpenStopmotion()
{
if (m_stopmotion == NULL) {
- m_stopmotion = new StopmotionWidget(pCore->monitorManager(), pCore->projectManager()->current()->projectFolder(), m_stopmotion_actions->actions(), this);
+ //m_stopmotion = new StopmotionWidget(pCore->monitorManager(), pCore->projectManager()->current()->projectFolder(), m_stopmotion_actions->actions(), this);
//TODO
//connect(m_stopmotion, SIGNAL(addOrUpdateSequence(QString)), m_projectList, SLOT(slotAddOrUpdateSequence(QString)));
//for (int i = 0; i < m_gfxScopesList.count(); ++i) {
@@ -3604,9 +3616,10 @@ void MainWindow::slotUpdateProxySettings()
void MainWindow::slotArchiveProject()
{
QList <ClipController*> list = pCore->binController()->getControllerList();
- pCore->binController()->saveDocumentProperties(pCore->projectManager()->currentTimeline()->documentProperties(), pCore->projectManager()->current()->metadata(), pCore->projectManager()->currentTimeline()->projectView()->guidesData());
- QDomDocument doc = pCore->projectManager()->current()->xmlSceneList(m_projectMonitor->sceneList());
- QPointer<ArchiveWidget> d = new ArchiveWidget(pCore->projectManager()->current()->url().fileName(), doc, list, pCore->projectManager()->currentTimeline()->projectView()->extractTransitionsLumas(), this);
+ KdenliveDoc *doc = pCore->projectManager()->current();
+ pCore->binController()->saveDocumentProperties(pCore->projectManager()->currentTimeline()->documentProperties(), doc->metadata(), pCore->projectManager()->currentTimeline()->projectView()->guidesData());
+ QDomDocument xmlDoc = doc->xmlSceneList(m_projectMonitor->sceneList(doc->url().adjusted(QUrl::RemoveFilename).path()));
+ QPointer<ArchiveWidget> d = new ArchiveWidget(doc->url().fileName(), xmlDoc, list, pCore->projectManager()->currentTimeline()->projectView()->extractTransitionsLumas(), this);
if (d->exec()) {
m_messageLabel->setMessage(i18n("Archiving project"), OperationCompletedMessage);
}
@@ -3617,7 +3630,7 @@ void MainWindow::slotDownloadResources()
{
QString currentFolder;
if (pCore->projectManager()->current())
- currentFolder = pCore->projectManager()->current()->projectFolder().path();
+ currentFolder = pCore->projectManager()->current()->projectFolder();
else
currentFolder = KdenliveSettings::defaultprojectfolder();
ResourceWidget *d = new ResourceWidget(currentFolder);
diff --git a/src/monitor/monitor.cpp b/src/monitor/monitor.cpp
index f3cf13e..987e6ef 100644
--- a/src/monitor/monitor.cpp
+++ b/src/monitor/monitor.cpp
@@ -1381,7 +1381,7 @@ void Monitor::slotOpenDvdFile(const QString &file)
void Monitor::slotSaveZone()
{
- render->saveZone(m_ruler->zone());
+ render->saveZone(pCore->projectManager()->current()->projectFolder(), m_ruler->zone());
}
void Monitor::setCustomProfile(const QString &profile, const Timecode &tc)
@@ -1408,16 +1408,16 @@ void Monitor::resetProfile(MltVideoProfile profile)
m_qmlManager->setProperty(QStringLiteral("fps"), QString::number(fps, 'g', 2));
}
-void Monitor::saveSceneList(const QString &path, const QDomElement &info)
+/*void Monitor::saveSceneList(const QString &path, const QDomElement &info)
{
if (render == NULL) return;
render->saveSceneList(path, info);
-}
+}*/
-const QString Monitor::sceneList()
+const QString Monitor::sceneList(const QString root)
{
if (render == NULL) return QString();
- return render->sceneList();
+ return render->sceneList(root);
}
void Monitor::setClipZone(const QPoint &pos)
diff --git a/src/monitor/monitor.h b/src/monitor/monitor.h
index f156abb..d8469e3 100644
--- a/src/monitor/monitor.h
+++ b/src/monitor/monitor.h
@@ -92,7 +92,7 @@ public:
void resetProfile(MltVideoProfile profile);
void setCustomProfile(const QString &profile, const Timecode &tc);
void setupMenu(QMenu *goMenu, QMenu *overlayMenu, QAction *playZone, QAction *loopZone, QMenu *markerMenu = NULL, QAction *loopClip = NULL);
- const QString sceneList();
+ const QString sceneList(const QString root);
const QString activeClipId();
GenTime position();
/** @brief Check current position to show relevant infos in qml view (markers, zone in/out, etc). */
@@ -292,7 +292,7 @@ public slots:
void slotRewind(double speed = 0);
void slotRewindOneFrame(int diff = 1);
void slotForwardOneFrame(int diff = 1);
- void saveSceneList(const QString &path, const QDomElement &info = QDomElement());
+ //void saveSceneList(const QString &path, const QDomElement &info = QDomElement());
void slotStart();
void slotEnd();
void slotSetZoneStart();
diff --git a/src/monitor/monitormanager.cpp b/src/monitor/monitormanager.cpp
index f2072de..6a8a76f 100644
--- a/src/monitor/monitormanager.cpp
+++ b/src/monitor/monitormanager.cpp
@@ -295,7 +295,7 @@ QString MonitorManager::getProjectFolder() const
//qDebug()<<" + + +NULL DOC!!";
return QString();
}
- return m_document->projectFolder().path() + QDir::separator();
+ return m_document->projectFolder() + QDir::separator();
}
BinController *MonitorManager::binController()
diff --git a/src/project/clipmanager.cpp b/src/project/clipmanager.cpp
index cf9640d..5efc11b 100644
--- a/src/project/clipmanager.cpp
+++ b/src/project/clipmanager.cpp
@@ -292,7 +292,7 @@ void ClipManager::slotAddTextTemplateClip(QString titleName, const QUrl &path, c
QString ClipManager::projectFolder() const
{
- return m_doc->projectFolder().path();
+ return m_doc->projectFolder();
}
diff --git a/src/project/dialogs/projectsettings.cpp b/src/project/dialogs/projectsettings.cpp
index cb5bb18..30fac17 100644
--- a/src/project/dialogs/projectsettings.cpp
+++ b/src/project/dialogs/projectsettings.cpp
@@ -63,6 +63,7 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
,m_lumas(lumas)
{
setupUi(this);
+ tabWidget->setTabBarAutoHide(true);
QVBoxLayout *vbox = new QVBoxLayout;
m_pw = new ProfileWidget(this);
vbox->addWidget(m_pw);
@@ -70,7 +71,6 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
list_search->setTreeWidget(files_list);
project_folder->setMode(KFile::Directory);
- project_folder->setUrl(QUrl(projectPath));
m_buttonOk = buttonBox->button(QDialogButtonBox::Ok);
//buttonOk->setEnabled(false);
@@ -93,6 +93,14 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
m_proxyextension = doc->getDocumentProperty(QStringLiteral("proxyextension"));
m_previewparams = doc->getDocumentProperty(QStringLiteral("previewparameters"));
m_previewextension = doc->getDocumentProperty(QStringLiteral("previewextension"));
+ QString storageFolder = doc->getDocumentProperty(QStringLiteral("storagefolder"));
+ if (!storageFolder.isEmpty()) {
+ custom_folder->setChecked(true);
+ project_folder->setUrl(QUrl::fromLocalFile(storageFolder));
+ } else {
+ xdg_folder->setChecked(true);
+ project_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
+ }
TemporaryData *cacheWidget = new TemporaryData(doc, true, this);
connect(cacheWidget, SIGNAL(disableProxies()), this, SIGNAL(disableProxies()));
connect(cacheWidget, SIGNAL(disablePreview()), this, SIGNAL(disablePreview()));
@@ -109,6 +117,9 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
m_proxyextension = KdenliveSettings::proxyextension();
m_previewparams = KdenliveSettings::previewparams();
m_previewextension = KdenliveSettings::previewextension();
+ xdg_folder->setChecked(!KdenliveSettings::customprojectfolder());
+ custom_folder->setChecked(KdenliveSettings::customprojectfolder());
+ project_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
}
// Select profile
@@ -216,7 +227,10 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
if (doc != NULL) {
slotUpdateFiles();
connect(delete_unused, SIGNAL(clicked()), this, SLOT(slotDeleteUnused()));
- } else tabWidget->widget(1)->setEnabled(false);
+ } else {
+ tabWidget->removeTab(2);
+ tabWidget->removeTab(1);
+ }
connect(project_folder, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateButton(QString)));
connect(button_export, SIGNAL(clicked()), this, SLOT(slotExportToText()));
// Delete unused files is not implemented
@@ -726,3 +740,10 @@ void ProjectSettings::loadPreviewProfiles()
slotUpdatePreviewParams();
}
+const QString ProjectSettings::storageFolder() const
+{
+ if (custom_folder->isChecked()) {
+ return project_folder->url().path();
+ }
+ return QString();
+}
diff --git a/src/project/dialogs/projectsettings.h b/src/project/dialogs/projectsettings.h
index d4841f5..f65a6aa 100644
--- a/src/project/dialogs/projectsettings.h
+++ b/src/project/dialogs/projectsettings.h
@@ -51,6 +51,7 @@ public:
static QStringList extractPlaylistUrls(const QString &path);
static QStringList extractSlideshowUrls(const QUrl &url);
const QString selectedPreview() const;
+ const QString storageFolder() const;
public slots:
virtual void accept();
diff --git a/src/project/dialogs/temporarydata.cpp b/src/project/dialogs/temporarydata.cpp
index 0a1ee21..25c2542 100644
--- a/src/project/dialogs/temporarydata.cpp
+++ b/src/project/dialogs/temporarydata.cpp
@@ -94,10 +94,10 @@ TemporaryData::TemporaryData(KdenliveDoc *doc, bool currentProjectOnly, QWidget
QVBoxLayout *lay = new QVBoxLayout;
m_currentPage = new QWidget(this);
- m_currentPage->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ m_currentPage->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
m_grid = new QGridLayout;
m_currentPie = new ChartWidget(this);
- m_grid->addWidget(m_currentPie, 0, 0, 4, 1);
+ m_grid->addWidget(m_currentPie, 0, 0, 5, 1);
QPalette pal(palette());
QFontMetrics ft(font());
int minHeight = ft.height() / 2;
@@ -169,22 +169,27 @@ TemporaryData::TemporaryData(KdenliveDoc *doc, bool currentProjectOnly, QWidget
connect(del, &QToolButton::clicked, this, &TemporaryData::deleteThumbs);
del->setEnabled(false);
m_grid->addWidget(del, 3, 4);
+ m_grid->setRowStretch(4, 10);
QFrame *sep = new QFrame(this);
sep->setFrameShape(QFrame::HLine);
- m_grid->addWidget(sep, 4, 0, 1, 5);
+ m_grid->addWidget(sep, 5, 0, 1, 5);
// Current total
- preview = new QLabel(QString("<a href='#'>") + i18n("Project total cache data") + QString("</a>"), this);
+ preview = new QLabel(i18n("Project total cache data"), this);
+ m_grid->addWidget(preview, 6, 0, 1, 3);
+ bool ok;
+ QDir dir = m_doc->getCacheDir(CacheBase, &ok);
+ preview = new QLabel(QString("<a href='#'>") + dir.absolutePath() + QString("</a>"), this);
preview->setToolTip(i18n("Click to open cache folder"));
connect(preview, SIGNAL(linkActivated(const QString &)), this, SLOT(openCacheFolder()));
- m_grid->addWidget(preview, 5, 0, 1, 3);
+ m_grid->addWidget(preview, 7, 0, 1, 5);
m_currentSize = new QLabel(this);
- m_grid->addWidget(m_currentSize, 5, 3);
+ m_grid->addWidget(m_currentSize, 6, 3);
del = new QToolButton(this);
del->setIcon(KoIconUtils::themedIcon(QStringLiteral("trash-empty")));
connect(del, &QToolButton::clicked, this, &TemporaryData::deleteCurrentCacheData);
del->setEnabled(false);
- m_grid->addWidget(del, 5, 4);
+ m_grid->addWidget(del, 6, 4);
m_currentPage->setLayout(m_grid);
m_proxies = m_doc->getProxyHashList();
diff --git a/src/project/projectmanager.cpp b/src/project/projectmanager.cpp
index c92fa00..f112874 100644
--- a/src/project/projectmanager.cpp
+++ b/src/project/projectmanager.cpp
@@ -122,7 +122,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
return;
}
// fix mantis#3160
- QUrl startFile = QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder() + "/_untitled.kdenlive");
+ QUrl startFile = QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder() + QStringLiteral("/_untitled.kdenlive"));
if (checkForBackupFile(startFile)) {
return;
}
@@ -131,7 +131,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
if (profileName.isEmpty()) {
profileName = KdenliveSettings::current_profile();
}
- QUrl projectFolder = QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder());
+ QString projectFolder;
QMap <QString, QString> documentProperties;
QMap <QString, QString> documentMetadata;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
@@ -140,6 +140,10 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
if (!closeCurrentDocument()) {
return;
}
+ if (KdenliveSettings::customprojectfolder()) {
+ projectFolder = KdenliveSettings::defaultprojectfolder();
+ documentProperties.insert(QStringLiteral("storagefolder"), projectFolder);
+ }
} else {
QPointer<ProjectSettings> w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, pCore->window());
connect(w, SIGNAL(refreshProfiles()), pCore->window(), SLOT(slotRefreshProfiles()));
@@ -158,7 +162,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
pCore->window()->slotSwitchAudioThumbs();
}
profileName = w->selectedProfile();
- projectFolder = w->selectedFolder();
+ projectFolder = w->storageFolder();
projectTracks = w->tracks();
documentProperties.insert(QStringLiteral("enableproxy"), QString::number((int) w->useProxy()));
documentProperties.insert(QStringLiteral("generateproxy"), QString::number((int) w->generateProxy()));
@@ -172,6 +176,9 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
documentProperties.insert(QStringLiteral("previewextension"), preview.section(";", 1, 1));
}
documentProperties.insert(QStringLiteral("proxyimageminsize"), QString::number(w->proxyImageMinSize()));
+ if (!projectFolder.isEmpty()) {
+ documentProperties.insert(QStringLiteral("storagefolder"), projectFolder);
+ }
documentMetadata = w->metadata();
delete w;
}
@@ -265,8 +272,8 @@ bool ProjectManager::saveFileAs(const QString &outputFileName)
pCore->monitorManager()->pauseActiveMonitor();
// Sync document properties
prepareSave();
-
- QString scene = projectSceneList();
+ QString saveFolder = QFileInfo(outputFileName).absolutePath();
+ QString scene = projectSceneList(saveFolder);
if (m_project->saveSceneList(outputFileName, scene) == false) {
return false;
}
@@ -290,7 +297,7 @@ bool ProjectManager::saveFileAs(const QString &outputFileName)
m_project->setModified(false);
m_recentFilesAction->addUrl(url);
// remember folder for next project opening
- KRecentDirs::add(QStringLiteral(":KdenliveProjectsFolder"), url.adjusted(QUrl::RemoveFilename).path());
+ KRecentDirs::add(QStringLiteral(":KdenliveProjectsFolder"), saveFolder);
saveRecentFiles();
m_fileRevert->setEnabled(true);
pCore->window()->m_undoView->stack()->setClean();
@@ -319,7 +326,7 @@ bool ProjectManager::hasSelection() const
bool ProjectManager::saveFileAs()
{
QFileDialog fd(pCore->window());
- fd.setDirectory(m_project->url().isValid() ? m_project->url().adjusted(QUrl::RemoveFilename).path() : m_project->projectFolder().path());
+ fd.setDirectory(m_project->url().isValid() ? m_project->url().adjusted(QUrl::RemoveFilename).path() : m_project->projectFolder());
fd.setMimeTypeFilters(QStringList()<<QStringLiteral("application/x-kdenlive"));
fd.setAcceptMode(QFileDialog::AcceptSave);
fd.setFileMode(QFileDialog::AnyFile);
@@ -512,7 +519,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
m_progressDialog->show();
bool openBackup;
m_notesPlugin->clear();
- KdenliveDoc *doc = new KdenliveDoc(stale ? QUrl::fromLocalFile(stale->fileName()) : url, QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()), pCore->window()->m_commandStack, KdenliveSettings::default_profile().isEmpty() ? KdenliveSettings::current_profile() : KdenliveSettings::default_profile(), QMap <QString, QString> (), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), pCore->monitorManager()->projectMonitor()->render, m_notesPlugin, &openBackup, pCore->window());
+ KdenliveDoc *doc = new KdenliveDoc(stale ? QUrl::fromLocalFile(stale->fileName()) : url, QString(), pCore->window()->m_commandStack, KdenliveSettings::default_profile().isEmpty() ? KdenliveSettings::current_profile() : KdenliveSettings::default_profile(), QMap <QString, QString> (), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), pCore->monitorManager()->projectMonitor()->render, m_notesPlugin, &openBackup, pCore->window());
if (stale == NULL) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = stale;
@@ -613,7 +620,7 @@ void ProjectManager::slotOpenBackup(const QUrl& url)
projectFolder = QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder());
projectFile = url;
} else {
- projectFolder = m_project->projectFolder();
+ projectFolder = QUrl::fromLocalFile(m_project->projectFolder());
projectFile = m_project->url();
projectId = m_project->getDocumentProperty(QStringLiteral("documentid"));
}
@@ -675,7 +682,7 @@ void ProjectManager::slotAutoSave()
m_lastSave.start();
}
-QString ProjectManager::projectSceneList()
+QString ProjectManager::projectSceneList(const QString outputFolder)
{
bool multitrackEnabled = m_trackView->multitrackView;
if (multitrackEnabled) {
@@ -683,7 +690,7 @@ QString ProjectManager::projectSceneList()
m_trackView->slotMultitrackView(false);
}
m_trackView->connectOverlayTrack(false);
- QString scene = pCore->monitorManager()->projectMonitor()->sceneList();
+ QString scene = pCore->monitorManager()->projectMonitor()->sceneList(outputFolder);
m_trackView->connectOverlayTrack(true);
if (multitrackEnabled) {
// Multitrack view was enabled, re-enable for auto save
diff --git a/src/project/projectmanager.h b/src/project/projectmanager.h
index 8db84d0..93d9c4d 100644
--- a/src/project/projectmanager.h
+++ b/src/project/projectmanager.h
@@ -59,7 +59,7 @@ public:
/** @brief Returns true if there is a selected item in timeline */
bool hasSelection() const;
/** @brief Returns current project's xml scene */
- QString projectSceneList();
+ QString projectSceneList(const QString outputFolder);
/** @brief returns a default hd profile depending on timezone*/
static QString getDefaultProjectFormat();
void saveZone(QStringList info, QDir dir);
diff --git a/src/renderer.cpp b/src/renderer.cpp
index fae654f..ca9e32b 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -554,15 +554,18 @@ void Render::checkMaxThreads()
}
-const QString Render::sceneList()
+const QString Render::sceneList(const QString root)
{
QString playlist;
+ qDebug()<<" * * *Setting document xml root: "<<root;
Mlt::Consumer xmlConsumer(*m_qmlView->profile(), "xml:kdenlive_playlist");
//qDebug()<<" ++ + READY TO SAVE: "<<m_qmlView->profile()->width()<<" / "<<m_qmlView->profile()->description();
if (!xmlConsumer.is_valid()) return QString();
m_mltProducer->optimise();
xmlConsumer.set("terminate_on_pause", 1);
xmlConsumer.set("store", "kdenlive");
+ if (!root.isEmpty())
+ xmlConsumer.set("root", root.toUtf8().constData());
// Disabling meta creates cleaner files, but then we don't have access to metadata on the fly (meta channels, etc)
// And we must use "avformat" instead of "avformat-novalidate" on project loading which causes a big delay on project opening
//xmlConsumer.set("no_meta", 1);
@@ -574,31 +577,7 @@ const QString Render::sceneList()
return playlist;
}
-bool Render::saveSceneList(QString path, QDomElement kdenliveData)
-{
- QFile file(path);
- QDomDocument doc;
- doc.setContent(sceneList(), false);
- if (doc.isNull()) return false;
- QDomElement root = doc.documentElement();
- if (!kdenliveData.isNull() && !root.isNull()) {
- // add Kdenlive specific tags
- root.appendChild(doc.importNode(kdenliveData, true));
- }
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- qWarning() << "////// ERROR writing to file: " << path;
- return false;
- }
- file.write(doc.toString().toUtf8());
- if (file.error() != QFile::NoError) {
- file.close();
- return false;
- }
- file.close();
- return true;
-}
-
-void Render::saveZone(QPoint zone)
+void Render::saveZone(const QString projectFolder, QPoint zone)
{
QString clipFolder = KRecentDirs::dir(QStringLiteral(":KdenliveClipFolder"));
if (clipFolder.isEmpty()) {
@@ -608,10 +587,10 @@ void Render::saveZone(QPoint zone)
Mlt::Consumer xmlConsumer(*m_qmlView->profile(), ("xml:" + url).toUtf8().constData());
xmlConsumer.set("terminate_on_pause", 1);
m_mltProducer->optimise();
- qDebug()<<" - - -- - SAVE ZONE SEVICE: "<<m_mltProducer->get("mlt_type");
+ qDebug()<<" - - -- - SAVE ZONE SERVICE: "<<m_mltProducer->get("mlt_type");
if (QString(m_mltProducer->get("mlt_type")) != QLatin1String("producer")) {
// TODO: broken
- QString scene = sceneList();
+ QString scene = sceneList(projectFolder);
Mlt::Producer duplicate(*m_mltProducer->profile(), "xml-string", scene.toUtf8().constData());
duplicate.set_in_and_out(zone.x(), zone.y());
qDebug()<<"/// CUT: "<<zone.x()<<"x"<< zone.y()<<" / "<<duplicate.get_length();
diff --git a/src/renderer.h b/src/renderer.h
index f634a11..ef3d865 100644
--- a/src/renderer.h
+++ b/src/renderer.h
@@ -133,8 +133,7 @@ class Render: public AbstractRender
/** @brief Get the current MLT producer playlist.
* @return A string describing the playlist */
- const QString sceneList();
- bool saveSceneList(QString path, QDomElement kdenliveData = QDomElement());
+ const QString sceneList(const QString root);
/** @brief Tells the renderer to play the scene at the specified speed,
* @param speed speed to play the scene to
@@ -369,7 +368,7 @@ public slots:
void doRefresh();
/** @brief Save a part of current timeline to an xml file. */
- void saveZone(QPoint zone);
+ void saveZone(const QString projectFolder, QPoint zone);
/** @brief Renderer moved to a new frame, check seeking */
bool checkFrameNumber(int pos);
diff --git a/src/timeline/managers/previewmanager.cpp b/src/timeline/managers/previewmanager.cpp
index 6b20cb8..a04e34f 100644
--- a/src/timeline/managers/previewmanager.cpp
+++ b/src/timeline/managers/previewmanager.cpp
@@ -59,24 +59,21 @@ PreviewManager::~PreviewManager()
bool PreviewManager::initialize()
{
// Make sure our document id does not contain .. tricks
- QString documentId = QDir::cleanPath(m_doc->getDocumentProperty(QStringLiteral("documentid")));
bool ok;
+ QString documentId = QDir::cleanPath(m_doc->getDocumentProperty(QStringLiteral("documentid")));
documentId.toLong(&ok);
if (!ok || documentId.isEmpty()) {
// Something is wrong, documentId should be a number (ms since epoch), abort
m_doc->displayMessage(i18n("Wrong document ID, cannot create temporary folder"), ErrorMessage);
return false;
}
- qDebug()<<"* * * INIT PREVIEW CACHE: "<<documentId;
- QString kdenliveCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
- documentId.append(QStringLiteral("/preview"));
- m_cacheDir = QDir(kdenliveCacheDir + "/" + documentId);
- if (!m_cacheDir.exists()) {
+ m_cacheDir = m_doc->getCacheDir(CachePreview, &ok);
+ if (!m_cacheDir.exists() || !ok) {
m_doc->displayMessage(i18n("Cannot create folder %1", m_cacheDir.absolutePath()), ErrorMessage);
return false;
}
- if (kdenliveCacheDir.isEmpty() || m_cacheDir.dirName() != QLatin1String("preview") || m_cacheDir == QDir() || (!m_cacheDir.exists("undo") && !m_cacheDir.mkdir("undo"))) {
- m_doc->displayMessage(i18n("Something is wrong with cache folder %1", m_cacheDir.absoluteFilePath(documentId)), ErrorMessage);
+ if (m_cacheDir.dirName() != QLatin1String("preview") || m_cacheDir == QDir() || (!m_cacheDir.exists("undo") && !m_cacheDir.mkdir("undo")) || !m_cacheDir.absolutePath().contains(documentId)) {
+ m_doc->displayMessage(i18n("Something is wrong with cache folder %1", m_cacheDir.absolutePath()), ErrorMessage);
return false;
}
if (!loadParams()) {
@@ -86,7 +83,7 @@ bool PreviewManager::initialize()
m_undoDir = QDir(m_cacheDir.absoluteFilePath("undo"));
// Make sure our cache dirs are inside the temporary folder
- if (!m_cacheDir.makeAbsolute() || !m_undoDir.makeAbsolute() || !m_cacheDir.absolutePath().startsWith(kdenliveCacheDir) || !m_undoDir.absolutePath().startsWith(kdenliveCacheDir)) {
+ if (!m_cacheDir.makeAbsolute() || !m_undoDir.makeAbsolute() || !m_undoDir.mkpath(QStringLiteral("."))) {
m_doc->displayMessage(i18n("Something is wrong with cache folders"), ErrorMessage);
return false;
}
diff --git a/src/timeline/timeline.cpp b/src/timeline/timeline.cpp
index 402ea67..dcccfba 100644
--- a/src/timeline/timeline.cpp
+++ b/src/timeline/timeline.cpp
@@ -1932,7 +1932,6 @@ void Timeline::initializePreview()
m_ruler->hidePreview(true);
delete m_timelinePreview;
m_timelinePreview = NULL;
- qDebug()<<" * * * *TL PREVIEW NOT INITIALIZED!!!";
} else {
m_ruler->hidePreview(false);
}
diff --git a/src/ui/configenv_ui.ui b/src/ui/configenv_ui.ui
index 564dd0c..af559b5 100644
--- a/src/ui/configenv_ui.ui
+++ b/src/ui/configenv_ui.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>440</width>
- <height>434</height>
+ <width>446</width>
+ <height>438</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
@@ -166,17 +166,14 @@
<string>Default folders</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="4" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Library folder</string>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2">
- <widget class="KUrlRequester" name="projecturl"/>
- </item>
- <item row="6" column="2">
+ <item row="5" column="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -189,48 +186,41 @@
</property>
</spacer>
</item>
- <item row="2" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Capture folder</string>
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Temporary files</string>
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Project folder</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
+ <item row="3" column="1">
<widget class="QCheckBox" name="kcfg_librarytodefaultfolder">
<property name="text">
<string>Use default folder</string>
</property>
</widget>
</item>
- <item row="5" column="1" colspan="2">
+ <item row="4" column="1" colspan="2">
<widget class="KUrlRequester" name="libraryfolderurl"/>
</item>
- <item row="1" column="1" colspan="2">
+ <item row="0" column="1" colspan="2">
<widget class="KUrlRequester" name="tmppathurl"/>
</item>
- <item row="2" column="1" colspan="2">
+ <item row="1" column="1" colspan="2">
<widget class="QCheckBox" name="kcfg_capturetoprojectfolder">
<property name="text">
<string>Use project folder</string>
</property>
</widget>
</item>
- <item row="3" column="1" colspan="2">
+ <item row="2" column="1" colspan="2">
<widget class="KUrlRequester" name="capturefolderurl"/>
</item>
</layout>
diff --git a/src/ui/configproject_ui.ui b/src/ui/configproject_ui.ui
index 667189f..3d6183d 100644
--- a/src/ui/configproject_ui.ui
+++ b/src/ui/configproject_ui.ui
@@ -6,18 +6,17 @@
<rect>
<x>0</x>
<y>0</y>
- <width>505</width>
- <height>654</height>
+ <width>499</width>
+ <height>532</height>
</rect>
</property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0" colspan="5">
- <widget class="QGroupBox" name="profile_box">
- <property name="title">
- <string>Default Profile</string>
- </property>
- </widget>
- </item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
@@ -25,8 +24,62 @@
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="kcfg_videotracks"/>
+ <item row="5" column="0" colspan="5">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_25">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Timeline Preview</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KComboBox" name="kcfg_preview_profile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="preview_showprofileinfo">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="preview_manageprofile">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="6" column="0" colspan="5">
+ <widget class="QPlainTextEdit" name="previewparams">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_7">
@@ -35,6 +88,9 @@
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="kcfg_videotracks"/>
+ </item>
<item row="1" column="3">
<widget class="QSpinBox" name="kcfg_audiotracks"/>
</item>
@@ -51,7 +107,27 @@
</property>
</spacer>
</item>
- <item row="2" column="0" colspan="5">
+ <item row="0" column="0" colspan="5">
+ <widget class="QGroupBox" name="profile_box">
+ <property name="title">
+ <string>Default Profile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0" colspan="5">
<widget class="QGroupBox" name="kcfg_enableproxy">
<property name="title">
<string>Pro&amp;xy clips</string>
@@ -162,85 +238,52 @@
</layout>
</widget>
</item>
- <item row="3" column="0" colspan="5">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="label_25">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Timeline Preview</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KComboBox" name="kcfg_preview_profile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
+ <item row="4" column="0" colspan="5">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <widget class="QToolButton" name="preview_showprofileinfo">
+ <widget class="QCheckBox" name="kcfg_customprojectfolder">
<property name="text">
- <string>...</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
+ <string>Custom project folder</string>
</property>
</widget>
</item>
<item>
- <widget class="QToolButton" name="preview_manageprofile">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
+ <widget class="KUrlRequester" name="projecturl"/>
</item>
</layout>
</item>
- <item row="4" column="0" colspan="5">
- <widget class="QPlainTextEdit" name="previewparams">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<customwidgets>
<customwidget>
+ <class>KUrlRequester</class>
+ <extends>QWidget</extends>
+ <header>kurlrequester.h</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
- <connections/>
+ <connections>
+ <connection>
+ <sender>kcfg_customprojectfolder</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>projecturl</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>112</x>
+ <y>98</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>363</x>
+ <y>98</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
diff --git a/src/ui/projectsettings_ui.ui b/src/ui/projectsettings_ui.ui
index f498e3a..731449d 100644
--- a/src/ui/projectsettings_ui.ui
+++ b/src/ui/projectsettings_ui.ui
@@ -6,15 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
- <width>519</width>
- <height>696</height>
+ <width>591</width>
+ <height>746</height>
</rect>
</property>
<property name="windowTitle">
<string>Project Settings</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
@@ -26,25 +26,47 @@
<attribute name="title">
<string>Settings</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_4">
<property name="text">
- <string>Project folder</string>
+ <string>Project folder to store proxy clips, thumbnails, previews</string>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="3">
- <widget class="KUrlRequester" name="project_folder"/>
- </item>
<item row="1" column="0" colspan="4">
+ <widget class="QRadioButton" name="xdg_folder">
+ <property name="text">
+ <string>Standard system fo&amp;lders</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="4">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QRadioButton" name="custom_folder">
+ <property name="text">
+ <string>C&amp;ustom Folder</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KUrlRequester" name="project_folder">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" colspan="4">
<widget class="QGroupBox" name="profile_box">
<property name="title">
<string>Video Profile</string>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="4">
+ <item row="4" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_7">
@@ -81,28 +103,28 @@
</item>
</layout>
</item>
- <item row="3" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Thumbnails:</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="5" column="1">
<widget class="QCheckBox" name="video_thumbs">
<property name="text">
<string>Video</string>
</property>
</widget>
</item>
- <item row="3" column="2">
+ <item row="5" column="2">
<widget class="QCheckBox" name="audio_thumbs">
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
- <item row="3" column="3">
+ <item row="5" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -115,7 +137,7 @@
</property>
</spacer>
</item>
- <item row="4" column="0" colspan="4">
+ <item row="6" column="0" colspan="4">
<widget class="QGroupBox" name="enable_proxy">
<property name="title">
<string>Prox&amp;y clips</string>
@@ -127,6 +149,16 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
+ <item row="2" column="1" colspan="3">
+ <widget class="KComboBox" name="proxy_profile">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="generate_proxy">
<property name="text">
@@ -134,10 +166,10 @@
</property>
</widget>
</item>
- <item row="1" column="0" colspan="2">
- <widget class="QCheckBox" name="generate_imageproxy">
+ <item row="2" column="5">
+ <widget class="QToolButton" name="proxy_manageprofile">
<property name="text">
- <string>Generate for images larger than</string>
+ <string>...</string>
</property>
</widget>
</item>
@@ -154,16 +186,6 @@
</property>
</widget>
</item>
- <item row="2" column="1" colspan="3">
- <widget class="KComboBox" name="proxy_profile">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
<item row="2" column="4">
<widget class="QToolButton" name="proxy_showprofileinfo">
<property name="text">
@@ -174,23 +196,10 @@
</property>
</widget>
</item>
- <item row="2" column="5">
- <widget class="QToolButton" name="proxy_manageprofile">
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="generate_imageproxy">
<property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="6">
- <widget class="QPlainTextEdit" name="proxyparams">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="readOnly">
- <bool>true</bool>
+ <string>Generate for images larger than</string>
</property>
</widget>
</item>
@@ -223,23 +232,23 @@
</property>
</widget>
</item>
+ <item row="3" column="0" colspan="6">
+ <widget class="QPlainTextEdit" name="proxyparams">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
- <item row="6" column="0" colspan="4">
- <widget class="QPlainTextEdit" name="previewparams">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="5" column="0" colspan="4">
+ <item row="7" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_25">
@@ -283,7 +292,50 @@
</item>
</layout>
</item>
+ <item row="8" column="0" colspan="4">
+ <widget class="QPlainTextEdit" name="previewparams">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="0" colspan="4">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>559</width>
+ <height>38</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
+ <zorder>label_4</zorder>
+ <zorder>project_folder</zorder>
+ <zorder>profile_box</zorder>
+ <zorder>label_2</zorder>
+ <zorder>video_thumbs</zorder>
+ <zorder>audio_thumbs</zorder>
+ <zorder>enable_proxy</zorder>
+ <zorder></zorder>
+ <zorder></zorder>
+ <zorder>horizontalSpacer</zorder>
+ <zorder>label_25</zorder>
+ <zorder>proxyparams</zorder>
+ <zorder>xdg_folder</zorder>
+ <zorder>custom_folder</zorder>
+ <zorder>verticalSpacer</zorder>
+ <zorder>previewparams</zorder>
+ <zorder>verticalSpacer</zorder>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
@@ -472,20 +524,7 @@
</widget>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>334</width>
- <height>484</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
+ <item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -496,12 +535,31 @@
</widget>
</item>
</layout>
+ <zorder>tabWidget</zorder>
+ <zorder>buttonBox</zorder>
+ <zorder>label_4</zorder>
+ <zorder>preview_profile</zorder>
+ <zorder>label_7</zorder>
+ <zorder>audio_thumbs</zorder>
+ <zorder>label_8</zorder>
+ <zorder>label_25</zorder>
+ <zorder>preview_showprofileinfo</zorder>
+ <zorder>video_tracks</zorder>
+ <zorder>profile_box</zorder>
+ <zorder>horizontalSpacer</zorder>
+ <zorder>enable_proxy</zorder>
+ <zorder>video_thumbs</zorder>
+ <zorder>preview_manageprofile</zorder>
+ <zorder>horizontalSpacer_2</zorder>
+ <zorder>project_folder</zorder>
+ <zorder>label_2</zorder>
+ <zorder>audio_tracks</zorder>
</widget>
<customwidgets>
<customwidget>
- <class>KComboBox</class>
- <extends>QComboBox</extends>
- <header>kcombobox.h</header>
+ <class>KTreeWidgetSearchLine</class>
+ <extends>QLineEdit</extends>
+ <header>ktreewidgetsearchline.h</header>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
@@ -510,9 +568,9 @@
<container>1</container>
</customwidget>
<customwidget>
- <class>KTreeWidgetSearchLine</class>
- <extends>QLineEdit</extends>
- <header>ktreewidgetsearchline.h</header>
+ <class>KComboBox</class>
+ <extends>QComboBox</extends>
+ <header>kcombobox.h</header>
</customwidget>
</customwidgets>
<resources/>
@@ -549,5 +607,21 @@
</hint>
</hints>
</connection>
+ <connection>
+ <sender>custom_folder</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>project_folder</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>92</x>
+ <y>137</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>377</x>
+ <y>137</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
</ui>