X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=9e369e30aa143aab4a13057e8d54bd9c322164c8;hb=74a50cb99d5215db8256af51d915d65dc276ea70;hp=4c50fa607f64b27cc795ebecc8bc0b5fed7201be;hpb=b10fa39bf67665a52d9d8ac49e1649748b89c27f;p=kdenlive diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4c50fa60..9e369e30 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -62,6 +62,7 @@ #include "audiospectrum.h" #include "spectrogram.h" #include "archivewidget.h" +#include "databackup/backupwidget.h" #include #include @@ -139,6 +140,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & KXmlGuiWindow(parent), m_activeDocument(NULL), m_activeTimeline(NULL), + m_recMonitor(NULL), m_renderWidget(NULL), #ifndef NO_JOGSHUTTLE m_jogProcess(NULL), @@ -208,11 +210,12 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & #ifndef Q_WS_MAC m_recMonitorDock = new QDockWidget(i18n("Record Monitor"), this); m_recMonitorDock->setObjectName("record_monitor"); - m_recMonitor = new RecMonitor("record"); + m_recMonitor = new RecMonitor("record", m_monitorManager); m_recMonitorDock->setWidget(m_recMonitor); connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl))); connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int))); #endif + m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor, m_recMonitor); m_notesDock = new QDockWidget(i18n("Project Notes"), this); m_notesDock->setObjectName("notes_widget"); @@ -245,7 +248,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & m_effectListDock->setWidget(m_effectList); addDockWidget(Qt::TopDockWidgetArea, m_effectListDock); - m_vectorscope = new Vectorscope(m_projectMonitor, m_clipMonitor); + m_vectorscope = new Vectorscope(m_monitorManager); m_vectorscopeDock = new QDockWidget(i18n("Vectorscope"), this); m_vectorscopeDock->setObjectName(m_vectorscope->widgetName()); m_vectorscopeDock->setWidget(m_vectorscope); @@ -255,7 +258,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & connect(m_vectorscope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest())); m_gfxScopesList.append(m_vectorscopeDock); - m_waveform = new Waveform(m_projectMonitor, m_clipMonitor); + m_waveform = new Waveform(m_monitorManager); m_waveformDock = new QDockWidget(i18n("Waveform"), this); m_waveformDock->setObjectName(m_waveform->widgetName()); m_waveformDock->setWidget(m_waveform); @@ -265,7 +268,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & connect(m_waveform, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest())); m_gfxScopesList.append(m_waveformDock); - m_RGBParade = new RGBParade(m_projectMonitor, m_clipMonitor); + m_RGBParade = new RGBParade(m_monitorManager); m_RGBParadeDock = new QDockWidget(i18n("RGB Parade"), this); m_RGBParadeDock->setObjectName(m_RGBParade->widgetName()); m_RGBParadeDock->setWidget(m_RGBParade); @@ -275,7 +278,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & connect(m_RGBParade, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateGfxScopeFrameRequest())); m_gfxScopesList.append(m_RGBParadeDock); - m_histogram = new Histogram(m_projectMonitor, m_clipMonitor); + m_histogram = new Histogram(m_monitorManager); m_histogramDock = new QDockWidget(i18n("Histogram"), this); m_histogramDock->setObjectName(m_histogram->widgetName()); m_histogramDock->setWidget(m_histogram); @@ -561,12 +564,12 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool))); 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(raiseMonitor(AbstractMonitor *)), this, SLOT(slotRaiseMonitor(AbstractMonitor *))); connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateColorScopes())); + connect(m_monitorManager, SIGNAL(clearScopes()), this, SLOT(slotClearColorScopes())); connect(m_effectList, SIGNAL(addEffect(const QDomElement)), this, SLOT(slotAddEffect(const QDomElement))); connect(m_effectList, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects())); - m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor); slotConnectMonitors(); // Open or create a file. Command line argument passed in Url has @@ -824,10 +827,10 @@ void MainWindow::slotAddEffect(const QDomElement effect) else m_activeTimeline->projectView()->slotAddEffect(effectToAdd, GenTime(), -1); } -void MainWindow::slotRaiseMonitor(bool clipMonitor) +void MainWindow::slotRaiseMonitor(AbstractMonitor *monitor) { - if (clipMonitor) m_clipMonitorDock->raise(); - else m_projectMonitorDock->raise(); + if (monitor == m_clipMonitor) m_clipMonitorDock->raise(); + else if (monitor == m_projectMonitor) m_projectMonitorDock->raise(); } void MainWindow::slotUpdateClip(const QString &id) @@ -1159,6 +1162,10 @@ void MainWindow::setupActions() collection.addAction("project_settings", projectAction); connect(projectAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProjectSettings())); + KAction* backupAction = new KAction(KIcon("edit-undo"), i18n("Open Backup File"), this); + collection.addAction("open_backup", backupAction); + connect(backupAction, SIGNAL(triggered(bool)), this, SLOT(slotOpenBackupDialog())); + KAction* projectRender = new KAction(KIcon("media-record"), i18n("Render"), this); collection.addAction("project_render", projectRender); projectRender->setShortcut(Qt::CTRL + Qt::Key_Return); @@ -1504,15 +1511,6 @@ void MainWindow::setupActions() showTitleBar->setChecked(KdenliveSettings::showtitlebars()); slotShowTitleBars(KdenliveSettings::showtitlebars()); - - //const QByteArray state = layoutGroup.readEntry("layout1", QByteArray()); - - /*QAction *maxCurrent = new KAction(i18n("Maximize Current Widget"), this); - collection.addAction("maximize_current", maxCurrent); - maxCurrent->setCheckable(true); - maxCurrent->setChecked(false); - connect(maxCurrent, SIGNAL(triggered(bool)), this, SLOT(slotMaximizeCurrent(bool)));*/ - m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection); KStandardAction::quit(this, SLOT(close()), collection); KStandardAction::open(this, SLOT(openFile()), collection); @@ -1623,8 +1621,6 @@ void MainWindow::setupActions() } //m_effectsActionCollection->readSettings(); - //connect(collection, SIGNAL( clearStatusText() ), - //statusBar(), SLOT( clear() ) ); } void MainWindow::slotDisplayActionMessage(QAction *a) @@ -1673,9 +1669,7 @@ void MainWindow::slotLoadLayout(QAction *action) if (layoutId.isEmpty()) return; KSharedConfigPtr config = KGlobal::config(); KConfigGroup layouts(config, "Layouts"); - //QByteArray geom = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii()); QByteArray state = QByteArray::fromBase64(layouts.readEntry(layoutId).toAscii()); - //restoreGeometry(geom); restoreState(state); } @@ -1801,8 +1795,8 @@ void MainWindow::newFile(bool showProjectSettings, bool force) } m_timelineArea->setEnabled(true); m_projectList->setEnabled(true); - - KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, projectTracks, m_projectMonitor->render, m_notesWidget, this); + bool openBackup; + KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, projectTracks, m_projectMonitor->render, m_notesWidget, &openBackup, this); doc->m_autosave = new KAutoSaveFile(KUrl(), doc); bool ok; TrackView *trackView = new TrackView(doc, &ok, this); @@ -1908,7 +1902,7 @@ bool MainWindow::saveFileAs(const QString &outputFileName) bool MainWindow::saveFileAs() { - QString outputFile = KFileDialog::getSaveFileName(m_activeDocument->projectFolder(), getMimeType()); + QString outputFile = KFileDialog::getSaveFileName(m_activeDocument->projectFolder(), getMimeType(false)); if (outputFile.isEmpty()) { return false; } @@ -1956,6 +1950,22 @@ void MainWindow::openLastFile() void MainWindow::openFile(const KUrl &url) { + // Make sure the url is a Kdenlive project file + KMimeType::Ptr mime = KMimeType::findByUrl(url); + if (mime.data()->is("application/x-compressed-tar")) { + // Opening a compressed project file, we need to process it + kDebug()<<"Opening archive, processing"; + ArchiveWidget *ar = new ArchiveWidget(url); + if (ar->exec() == QDialog::Accepted) openFile(KUrl(ar->extractedProjectFile())); + delete ar; + return; + } + if (!url.fileName().endsWith(".kdenlive")) { + // This is not a Kdenlive project file, abort loading + KMessageBox::sorry(this, i18n("File %1 is not a Kdenlive project file", url.path())); + return; + } + // Check if the document is already opened const int ct = m_timelineArea->count(); bool isOpened = false; @@ -2015,7 +2025,8 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale) progressDialog.progressBar()->setValue(0); qApp->processEvents(); - KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog); + bool openBackup; + KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, &openBackup, this, &progressDialog); progressDialog.progressBar()->setValue(1); progressDialog.progressBar()->setMaximum(4); @@ -2062,6 +2073,7 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale) m_clipMonitor->refreshMonitor(true); progressDialog.progressBar()->setValue(4); + if (openBackup) slotOpenBackupDialog(url); } void MainWindow::recoverFiles(QList staleFiles) @@ -2235,8 +2247,6 @@ void MainWindow::slotEditProjectSettings() void MainWindow::slotUpdateProjectProfile(const QString &profile) { - double dar = m_activeDocument->dar(); - // Recreate the stopmotion widget if profile changes if (m_stopmotion) { delete m_stopmotion; @@ -2259,8 +2269,6 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile) m_projectList->updateProjectFormat(m_activeDocument->timecode()); if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile()); m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description()); - //m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList()); - if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails(); if (updateFps) m_activeTimeline->updateProjectFps(); m_activeDocument->setModified(true); m_commandStack->activeStack()->clear(); @@ -2375,7 +2383,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha 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()), m_activeDocument, SLOT(checkProjectClips())); + disconnect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool)), m_activeDocument, SLOT(checkProjectClips(bool))); disconnect(m_activeDocument, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated())); disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool))); @@ -2383,7 +2391,6 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &))); disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &))); disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &))); - disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &))); disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int))); disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), this, SLOT(slotActivateEffectStackView(ClipItem*, int, bool))); disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*))); @@ -2439,7 +2446,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha connect(m_projectList, SIGNAL(findInTimeline(const QString&)), this, SLOT(slotClipInTimeline(const QString&))); - connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor())); + //connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor())); connect(trackView, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int))); connect(trackView, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int))); connect(trackView, SIGNAL(configTrack(int)), this, SLOT(slotConfigTrack(int))); @@ -2452,7 +2459,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha 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()), doc, SLOT(checkProjectClips())); + connect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool)), doc, SLOT(checkProjectClips(bool))); connect(doc, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool))); connect(doc, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList())); @@ -2460,9 +2467,10 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha connect(doc, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &))); connect(doc, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &))); - connect(doc, SIGNAL(deleteTimelineClip(const QString &)), trackView, SLOT(slotDeleteClip(const QString &))); 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(m_notesWidget, SIGNAL(textChanged()), doc, SLOT(setModified())); connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int))); @@ -3536,20 +3544,20 @@ void MainWindow::slotSaveZone(Render *render, QPoint zone) void MainWindow::slotSetInPoint() { - if (m_clipMonitor->isActive()) + if (m_clipMonitor->isActive()) { m_clipMonitor->slotSetZoneStart(); - else + } else { m_projectMonitor->slotSetZoneStart(); - //else m_activeTimeline->projectView()->setInPoint(); + } } void MainWindow::slotSetOutPoint() { - if (m_clipMonitor->isActive()) + if (m_clipMonitor->isActive()) { m_clipMonitor->slotSetZoneEnd(); - else + } else { m_projectMonitor->slotSetZoneEnd(); - // else m_activeTimeline->projectView()->setOutPoint(); + } } void MainWindow::slotResizeItemStart() @@ -3660,21 +3668,15 @@ void MainWindow::slotShowTimeline(bool show) } } -void MainWindow::slotMaximizeCurrent(bool /*show*/) +void MainWindow::slotMaximizeCurrent(bool) { //TODO: is there a way to maximize current widget? - //if (show == true) - { - m_timelineState = saveState(); - QWidget *par = focusWidget()->parentWidget(); - while (par->parentWidget() && par->parentWidget() != this) - par = par->parentWidget(); - kDebug() << "CURRENT WIDGET: " << par->objectName(); - } - /*else { - //centralWidget()->setHidden(false); - //restoreState(m_timelineState); - }*/ + + m_timelineState = saveState(); + QWidget *par = focusWidget()->parentWidget(); + while (par->parentWidget() && par->parentWidget() != this) + par = par->parentWidget(); + kDebug() << "CURRENT WIDGET: " << par->objectName(); } void MainWindow::loadTranscoders() @@ -3831,14 +3833,18 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS // replace proxy clips with originals QMap proxies = m_projectList->getProxies(); - QDomNodeList producers = doc.elementsByTagName("producer"); QString producerResource; QString suffix; for (uint n = 0; n < producers.length(); n++) { QDomElement e = producers.item(n).toElement(); producerResource = EffectsList::property(e, "resource"); + if (producerResource.isEmpty()) continue; + if (!producerResource.startsWith("/")) { + producerResource.prepend(root + "/"); + } if (producerResource.contains('?')) { + // slowmotion producer suffix = "?" + producerResource.section('?', 1); producerResource = producerResource.section('?', 0, 0); } @@ -3850,12 +3856,6 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS // sometimes have different ratio than original clips EffectsList::removeProperty(e, "aspect_ratio"); } - else if (!root.isEmpty() && producerResource.startsWith(root) && proxies.contains(producerResource.remove(0, root.count() + 1))) { - EffectsList::setProperty(e, "resource", proxies.value(producerResource.remove(0, root.count() + 1)) + suffix); - // We need to delete the "aspect_ratio" property because proxy clips - // sometimes have different ratio than original clips - EffectsList::removeProperty(e, "aspect_ratio"); - } } } @@ -3949,11 +3949,12 @@ void MainWindow::slotChangePalette(QAction *action, const QString &themename) plt = QApplication::desktop()->palette(); } else { KSharedConfigPtr config = KSharedConfig::openConfig(theme); - - // Since there currently is a bug (or feature change) in KGlobalSettings::createApplicationPalette, we need - // to do the palette loading stuff ourselves... - //plt = KGlobalSettings::createApplicationPalette(config); - + +#if KDE_IS_VERSION(4,6,3) + plt = KGlobalSettings::createNewApplicationPalette(config); +#else + // Since there was a bug in createApplicationPalette in KDE < 4.6.3 we need + // to do the palette loading stuff ourselves. (https://bugs.kde.org/show_bug.cgi?id=263497) QPalette::ColorGroup states[3] = { QPalette::Active, QPalette::Inactive, QPalette::Disabled }; // TT thinks tooltips shouldn't use active, so we use our active colors for all states @@ -3987,7 +3988,9 @@ void MainWindow::slotChangePalette(QAction *action, const QString &themename) plt.setBrush( state, QPalette::Link, schemeView.foreground( KColorScheme::LinkText ) ); plt.setBrush( state, QPalette::LinkVisited, schemeView.foreground( KColorScheme::VisitedText ) ); } +#endif } + kapp->setPalette(plt); const QObjectList children = statusBar()->children(); @@ -4109,11 +4112,15 @@ void MainWindow::slotSwitchTitles() slotShowTitleBars(!KdenliveSettings::showtitlebars()); } -QString MainWindow::getMimeType() +QString MainWindow::getMimeType(bool open) { QString mimetype = "application/x-kdenlive"; KMimeType::Ptr mime = KMimeType::mimeType(mimetype); - if (!mime) mimetype = "*.kdenlive"; + if (!mime) { + mimetype = "*.kdenlive"; + if (open) mimetype.append(" *.tar.gz"); + } + else if (open) mimetype.append(" application/x-compressed-tar"); return mimetype; } @@ -4160,9 +4167,13 @@ void MainWindow::slotDoUpdateGfxScopeFrameRequest() m_projectMonitor->render->sendFrameForAnalysis = false; } m_clipMonitor->render->sendFrameForAnalysis = false; + if (m_recMonitor) + m_recMonitor->analyseFrames(false); } else { m_projectMonitor->render->sendFrameForAnalysis = true; m_clipMonitor->render->sendFrameForAnalysis = true; + if (m_recMonitor) + m_recMonitor->analyseFrames(true); } } @@ -4196,28 +4207,35 @@ void MainWindow::slotDoUpdateAudioScopeFrameRequest() void MainWindow::slotUpdateColorScopes() { bool request = false; + kDebug()<<"// UPDATE SCOPES"; for (int i = 0; i < m_gfxScopesList.count(); i++) { // Check if we need the renderer to send a new frame for update if (!m_gfxScopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast(m_gfxScopesList.at(i)->widget())->autoRefreshEnabled())) request = true; - static_cast(m_gfxScopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive()); + static_cast(m_gfxScopesList.at(i)->widget())->slotActiveMonitorChanged(); } - if (request) { - if (m_clipMonitor->isActive()) m_clipMonitor->render->sendFrameUpdate(); - else m_projectMonitor->render->sendFrameUpdate(); + if (request && m_monitorManager->activeRenderer()) { + m_monitorManager->activeRenderer()->sendFrameUpdate(); + } +} + +void MainWindow::slotClearColorScopes() +{ + for (int i = 0; i < m_gfxScopesList.count(); i++) { + static_cast(m_gfxScopesList.at(i)->widget())->slotClearMonitor(); } } void MainWindow::slotOpenStopmotion() { if (m_stopmotion == NULL) { - m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this); + m_stopmotion = new StopmotionWidget(m_monitorManager, m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this); connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString))); - for (int i = 0; i < m_gfxScopesList.count(); i++) { + //for (int i = 0; i < m_gfxScopesList.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(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/ - connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast(m_gfxScopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage))); + //connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast(m_gfxScopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage))); //static_cast(m_scopesList.at(i)->widget())->slotMonitorCapture(); - } + //} } m_stopmotion->show(); } @@ -4250,11 +4268,45 @@ void MainWindow::slotArchiveProject() { QList list = m_projectList->documentClipList(); QDomDocument doc = m_activeDocument->xmlSceneList(m_projectMonitor->sceneList(), m_projectList->expandedFolders()); - ArchiveWidget *d = new ArchiveWidget(doc, list, m_activeTimeline->projectView()->extractTransitionsLumas(), this); + ArchiveWidget *d = new ArchiveWidget(m_activeDocument->url().fileName(), doc, list, m_activeTimeline->projectView()->extractTransitionsLumas(), this); d->exec(); } +void MainWindow::slotOpenBackupDialog(const KUrl url) +{ + KUrl projectFile; + KUrl projectFolder; + QString projectId; + kDebug()<<"// BACKUP URL: "<projectFolder(); + projectFile = m_activeDocument->url(); + projectId = m_activeDocument->getDocumentProperty("documentid"); + } + + 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; +} + + + + + #include "mainwindow.moc" #ifdef DEBUG_MAINW