bool refreshProducer = false;
QStringList keys;
keys << "luma_duration" << "luma_file" << "fade" << "ttl" << "softness" << "crop" << "animation";
+ QString oldProxy = m_properties.value("proxy");
while (i.hasNext()) {
i.next();
setProperty(i.key(), i.value());
if (m_clipType == SLIDESHOW && keys.contains(i.key())) refreshProducer = true;
}
+ if (properties.contains("proxy")) {
+ QString value = properties.value("proxy");
+ // If value is "-", that means user manually disabled proxy on this clip
+ if (value.isEmpty() || value == "-") {
+ // reset proxy
+ emit abortProxy(m_id, oldProxy);
+ }
+ else {
+ emit createProxy(m_id);
+ }
+ }
if (refreshProducer) slotRefreshProducer();
}
void DocClipBase::setProperty(const QString &key, const QString &value)
{
- QString oldProxy = m_properties.value("proxy");
m_properties.insert(key, value);
if (key == "resource") {
getFileHash(value);
resetProducerProperty("set.force_full_luma");
} else setProducerProperty("set.force_full_luma", value.toInt());
}
- else if (key == "proxy") {
- // If value is "-", that means user manually disabled proxy on this clip
- if (value.isEmpty() || value == "-") {
- // reset proxy
- emit abortProxy(m_id, oldProxy);
- }
- else {
- emit createProxy(m_id);
- }
- }
}
QMap <QString, QString> DocClipBase::properties() const
{
QPoint p = m_activeDocument->getTracksCount();
ProjectSettings *w = new ProjectSettings(m_projectList, m_activeTimeline->projectView()->extractTransitionsLumas(), p.x(), p.y(), m_activeDocument->projectFolder().path(), true, !m_activeDocument->isModified(), this);
+ connect(w, SIGNAL(disableProxies()), this, SLOT(slotDisableProxies()));
if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
delete w;
}
+void MainWindow::slotDisableProxies()
+{
+ m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) false));
+ m_activeDocument->setModified();
+ slotUpdateProxySettings();
+}
+
void MainWindow::slotUpdateProjectProfile(const QString &profile)
{
// Recreate the stopmotion widget if profile changes
void slotOpenBackupDialog(const KUrl url = KUrl());
/** @brief Make sure to block clip monitor before deleting a clip's producer. */
void slotBlockClipMonitor(const QString id);
+ /** @brief Disable proxies for this project. */
+ void slotDisableProxies();
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
if (item == NULL) return;
DocClipBase *clip = item->referencedClip();
// Proxy clip successfully created
- QDomElement e = clip->toXML().cloneNode().toElement();
+ QDomElement e = clip->toXML().cloneNode().toElement();
+ kDebug()<<"// QUERYING CLIP, proxy: "<<e.attribute("proxy")<<", OUT: "<<e.attribute("proxy_out");
// Make sure we get the correct producer length if it was adjusted in timeline
CLIPTYPE t = item->clipType();
proxyPath.addPath("proxy/");
proxyPath.addPath(clip->getClipHash() + "." + (t == IMAGE ? "png" : m_doc->getDocumentProperty("proxyextension")));
QMap <QString, QString> newProps;
- newProps.insert("proxy", proxyPath.path());
// insert required duration for proxy
if (t != IMAGE) newProps.insert("proxy_out", clip->producerProperty("out"));
+ newProps.insert("proxy", proxyPath.path());
QMap <QString, QString> oldProps = clip->properties();
oldProps.insert("proxy", QString());
EditClipCommand *command = new EditClipCommand(this, clipId, oldProps, newProps, true);
if (doProxy) {
newProps.clear();
QString path = proxydir + item->referencedClip()->getClipHash() + "." + (t == IMAGE ? "png" : m_doc->getDocumentProperty("proxyextension"));
- newProps.insert("proxy", path);
// insert required duration for proxy
newProps.insert("proxy_out", item->referencedClip()->producerProperty("out"));
+ newProps.insert("proxy", path);
// We need to insert empty proxy so that undo will work
oldProps.insert("proxy", QString());
}
void ProjectSettings::slotDeleteProxies()
{
+ if (KMessageBox::warningContinueCancel(this, i18n("Deleting proxy clips will disable proxies for this project.")) != KMessageBox::Continue) return;
buttonBox->setEnabled(false);
-
+ enable_proxy->setChecked(false);
+ emit disableProxies();
KIO::NetAccess::del(KUrl(project_folder->url().path(KUrl::AddTrailingSlash) + "proxy/"), this);
KStandardDirs::makeDir(project_folder->url().path(KUrl::AddTrailingSlash) + "proxy/");
buttonBox->setEnabled(true);
bool m_savedProject;
ProjectList *m_projectList;
QStringList m_lumas;
+
+signals:
+ /** @brief User deleted proxies, so disable them in project. */
+ void disableProxies();
};