connect(m_projectMonitor, SIGNAL(requestFrameForAnalysis(bool)), this, SLOT(slotMonitorRequestRenderFrame(bool)));
- connect(m_clipMonitor, SIGNAL(saveZone(Render *, QPoint)), this, SLOT(slotSaveZone(Render *, QPoint)));
- connect(m_projectMonitor, SIGNAL(saveZone(Render *, QPoint)), this, SLOT(slotSaveZone(Render *, QPoint)));
+ connect(m_clipMonitor, SIGNAL(saveZone(Render *, QPoint, DocClipBase *)), this, SLOT(slotSaveZone(Render *, QPoint, DocClipBase *)));
+ connect(m_projectMonitor, SIGNAL(saveZone(Render *, QPoint, DocClipBase *)), this, SLOT(slotSaveZone(Render *, QPoint, DocClipBase *)));
}
void MainWindow::slotAdjustClipMonitor()
disconnect(m_projectList, SIGNAL(projectModified()), m_activeDocument, SLOT(setModified()));
disconnect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
- disconnect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool)), m_activeDocument, SLOT(checkProjectClips(bool)));
+ disconnect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool, bool)), m_activeDocument, SLOT(checkProjectClips(bool, bool)));
disconnect(m_activeDocument, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int)));
- connect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool)), doc, SLOT(checkProjectClips(bool)));
+ connect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool, bool)), doc, SLOT(checkProjectClips(bool, bool)));
connect(doc, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
connect(doc, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList()));
connect(doc, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
connect(doc, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
- connect(doc, SIGNAL(saveTimelinePreview(const QString)), trackView->projectView(), SLOT(saveTimelinePreview(const QString)));
+ connect(doc, SIGNAL(saveTimelinePreview(const QString)), trackView, SLOT(slotSaveTimelinePreview(const QString)));
connect(m_notesWidget, SIGNAL(textChanged()), doc, SLOT(setModified()));
}
-void MainWindow::slotSaveZone(Render *render, QPoint zone)
+void MainWindow::slotSaveZone(Render *render, QPoint zone, DocClipBase *baseClip, KUrl path)
{
KDialog *dialog = new KDialog(this);
dialog->setCaption("Save clip zone");
QVBoxLayout *vbox = new QVBoxLayout(widget);
QLabel *label1 = new QLabel(i18n("Save clip zone as:"), this);
- QString path = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash);
- path.append("untitled.mlt");
- KUrlRequester *url = new KUrlRequester(KUrl(path), this);
+ if (path.isEmpty()) {
+ QString tmppath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash);
+ if (baseClip == NULL) tmppath.append("untitled.mlt");
+ else {
+ tmppath.append((baseClip->name().isEmpty() ? baseClip->fileURL().fileName() : baseClip->name()) + "-" + QString::number(zone.x()).rightJustified(4, '0') + ".mlt");
+ }
+ path = KUrl(tmppath);
+ }
+ KUrlRequester *url = new KUrlRequester(path, this);
url->setFilter("video/mlt-playlist");
QLabel *label2 = new QLabel(i18n("Description:"), this);
KLineEdit *edit = new KLineEdit(this);
vbox->addWidget(url);
vbox->addWidget(label2);
vbox->addWidget(edit);
- if (dialog->exec() == QDialog::Accepted)
- render->saveZone(url->url(), edit->text(), zone);
+ if (dialog->exec() == QDialog::Accepted) {
+ if (QFile::exists(url->url().path())) {
+ if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", url->url().path())) == KMessageBox::No) {
+ slotSaveZone(render, zone, baseClip, url->url());
+ return;
+ }
+ }
+ if (baseClip && !baseClip->fileURL().isEmpty()) {
+ // create zone from clip url, so that we don't have problems with proxy clips
+ QProcess::startDetached(KdenliveSettings::rendererpath(), QStringList() << baseClip->fileURL().path() << "in=" + QString::number(zone.x()) << "out=" + QString::number(zone.y()) << "-consumer" << "xml:" + url->url().path());
+ }
+ else render->saveZone(url->url(), edit->text(), zone);
+ }
}
if (!m_gfxScopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
static_cast<AbstractGfxScopeWidget *>(m_gfxScopesList.at(i)->widget())->slotActiveMonitorChanged();
}
- if (request) {
+ if (request && m_monitorManager->activeRenderer()) {
m_monitorManager->activeRenderer()->sendFrameUpdate();
}
}
{
KUrl projectFile;
KUrl projectFolder;
+ QString projectId;
kDebug()<<"// BACKUP URL: "<<url.path();
if (!url.isEmpty()) {
// we could not open the project file, guess where the backups are
else {
projectFolder = m_activeDocument->projectFolder();
projectFile = m_activeDocument->url();
+ projectId = m_activeDocument->getDocumentProperty("documentid");
}
- BackupWidget *dia = new BackupWidget(projectFile, projectFolder, this);
+ BackupWidget *dia = new BackupWidget(projectFile, projectFolder, projectId, this);
if (dia->exec() == QDialog::Accepted) {
QString requestedBackup = dia->selectedFile();
m_activeDocument->backupLastSavedVersion(projectFile.path());
closeCurrentDocument(false);
doOpenFile(KUrl(requestedBackup), NULL);
m_activeDocument->setUrl(projectFile);
+ m_activeDocument->setModified(true);
setCaption(m_activeDocument->description());
}
delete dia;