Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Add proxy utils in clip properties dialog to play/delete/show folder of a clip's proxy

parent 9c744a62
......@@ -826,6 +826,7 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
setProducerProperty(QStringLiteral("kdenlive:originalurl"), url());
pCore->jobManager()->startJob<ProxyJob>({clipId()}, -1, QString());
}
refreshPanel = true;
} else if (properties.contains(QStringLiteral("resource")) || properties.contains(QStringLiteral("templatetext")) ||
properties.contains(QStringLiteral("autorotate"))) {
// Clip resource changed, update thumbnail
......@@ -896,6 +897,25 @@ ClipPropertiesController *ProjectClip::buildProperties(QWidget *parent)
ClipPropertiesController *panel = new ClipPropertiesController(static_cast<ClipController *>(this), parent);
connect(this, &ProjectClip::refreshPropertiesPanel, panel, &ClipPropertiesController::slotReloadProperties);
connect(this, &ProjectClip::refreshAnalysisPanel, panel, &ClipPropertiesController::slotFillAnalysisData);
connect(panel, &ClipPropertiesController::requestProxy, [this] (bool doProxy) {
QList<std::shared_ptr<ProjectClip>> clipList {std::static_pointer_cast<ProjectClip>(shared_from_this())};
pCore->currentDoc()->slotProxyCurrentItem(doProxy, clipList);
});
connect(panel, &ClipPropertiesController::deleteProxy, [this] () {
// Disable proxy file
QString proxy = getProducerProperty(QStringLiteral("kdenlive:proxy"));
QList<std::shared_ptr<ProjectClip>> clipList {std::static_pointer_cast<ProjectClip>(shared_from_this())};
pCore->currentDoc()->slotProxyCurrentItem(false, clipList);
// Delete it
bool ok;
QDir dir = pCore->currentDoc()->getCacheDir(CacheProxy, &ok);
if (ok && proxy.length() > 2) {
proxy = QFileInfo(proxy).fileName();
if (dir.exists(proxy)) {
dir.remove(proxy);
}
}
});
return panel;
}
......
......@@ -1147,6 +1147,7 @@ void KdenliveDoc::slotProxyCurrentItem(bool doProxy, QList<std::shared_ptr<Proje
QDir dir = getCacheDir(CacheProxy, &ok);
if (!ok) {
// Error
return;
}
QString extension = QLatin1Char('.') + getDocumentProperty(QStringLiteral("proxyextension"));
QString params = getDocumentProperty(QStringLiteral("proxyparams"));
......
......@@ -117,6 +117,9 @@ signals:
void seekToFrame(int);
void editAnalysis(const QString &id, const QString &name, const QString &value);
void editClip();
void requestProxy(bool doProxy);
void proxyModified(const QString &);
void deleteProxy();
};
#endif
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