connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
//connect(m_monitorManager, SIGNAL(connectMonitors()), this, SLOT(slotConnectMonitors()));
connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), this, SLOT(slotRaiseMonitor(bool)));
- connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_vectorscope, SLOT(slotActiveMonitorChanged(bool)));
- connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_waveform, SLOT(slotActiveMonitorChanged(bool)));
- connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_RGBParade, SLOT(slotActiveMonitorChanged(bool)));
- connect(m_monitorManager, SIGNAL(raiseClipMonitor(bool)), m_histogram, SLOT(slotActiveMonitorChanged(bool)));
+ connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateColorScopes()));
connect(m_effectList, SIGNAL(addEffect(const QDomElement)), this, SLOT(slotAddEffect(const QDomElement)));
connect(m_effectList, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
if (m_projectMonitor) m_projectMonitor->stop();
if (m_clipMonitor) m_clipMonitor->stop();
- if (m_activeTimeline) delete m_activeTimeline;
-
+ delete m_activeTimeline;
delete m_effectStack;
delete m_transitionConfig;
-
- if (m_activeDocument) delete m_activeDocument;
-#ifndef Q_WS_MAC
- // This sometimes causes crash on exit on OS X for some reason.
+ delete m_activeDocument;
delete m_projectMonitor;
delete m_clipMonitor;
-#endif
delete m_shortcutRemoveFocus;
Mlt::Factory::close();
}
KUrl projectFolder;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
if (!showProjectSettings) {
- if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
+ if (!KdenliveSettings::activatetabs()) if (!closeCurrentDocument()) return;
profileName = KdenliveSettings::default_profile();
projectFolder = KdenliveSettings::defaultprojectfolder();
} else {
ProjectSettings *w = new ProjectSettings(NULL, QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
if (w->exec() != QDialog::Accepted) return;
- if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
+ if (!KdenliveSettings::activatetabs()) if (!closeCurrentDocument()) return;
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
profileName = w->selectedProfile();
connectDocument(currentTab, currentDoc);
}
-void MainWindow::closeCurrentDocument(bool saveChanges)
+bool MainWindow::closeCurrentDocument(bool saveChanges)
{
QWidget *w = m_timelineArea->currentWidget();
- if (!w) return;
+ if (!w) return true;
// closing current document
int ix = m_timelineArea->currentIndex() + 1;
if (ix == m_timelineArea->count()) ix = 0;
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
- if (saveFile() == false) return;
+ if (saveFile() == false) return false;
break;
case KMessageBox::Cancel :
- return;
+ return false;
break;
default:
break;
} else {
delete w;
}
+ return true;
}
bool MainWindow::saveFileAs(const QString &outputFileName)
return;
}
+ if (!KdenliveSettings::activatetabs()) if (!closeCurrentDocument()) return;
+
// Check for backup file
QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::staleFiles(url);
if (!staleFiles.isEmpty()) {
}
}
}
- if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
m_messageLabel->setMessage(i18n("Opening file %1", url.path()), InformationMessage);
m_messageLabel->repaint();
doOpenFile(url, NULL);
void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles)
{
- if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
foreach(KAutoSaveFile *stale, staleFiles) {
/*if (!stale->open(QIODevice::QIODevice::ReadOnly)) {
// show an error message; we could not steal the lockfile
/** Gets called when the window gets hidden */
void MainWindow::hideEvent(QHideEvent */*event*/)
{
- if (isMinimized())
- if (m_monitorManager)
- m_monitorManager->stopActiveMonitor();
+ if (isMinimized() && m_monitorManager)
+ m_monitorManager->stopActiveMonitor();
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (KMessageBox::warningContinueCancel(this, i18n("This will delete all changes made since you last saved your project. Are you sure you want to continue?"), i18n("Revert to last saved version")) == KMessageBox::Cancel) return;
KUrl url = m_activeDocument->url();
- closeCurrentDocument(false);
- doOpenFile(url, NULL);
+ if (closeCurrentDocument(false))
+ doOpenFile(url, NULL);
}
}
}
+void MainWindow::slotUpdateColorScopes()
+{
+ bool request = false;
+ for (int i = 0; i < m_scopesList.count(); i++) {
+ // Check if we need the renderer to send a new frame for update
+ if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
+ static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive());
+ }
+ if (request) {
+ if (m_clipMonitor->isActive()) m_clipMonitor->render->sendFrameUpdate();
+ else m_projectMonitor->render->sendFrameUpdate();
+ }
+}
+
#include "mainwindow.moc"