]> git.sesse.net Git - kdenlive/blobdiff - src/monitor.cpp
Fix several DVD wizard monitor issue, might solve:
[kdenlive] / src / monitor.cpp
index 9bb76d83afaaeaeec2593b7ba928e897d2813c6f..cedfc4e4cda61af0bb1d31aa64e8c652110b9f65 100644 (file)
@@ -41,7 +41,7 @@
 #include <QIntValidator>
 
 
-Monitor::Monitor(QString name, MonitorManager *manager, QWidget *parent) :
+Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget *parent) :
         QWidget(parent),
         render(NULL),
         m_name(name),
@@ -130,12 +130,14 @@ Monitor::Monitor(QString name, MonitorManager *manager, QWidget *parent) :
 
     //m_ruler->setPixelPerMark(3);
 
+    if (profile.isEmpty()) profile = KdenliveSettings::current_profile();
+
     QVBoxLayout *rendererBox = new QVBoxLayout(m_ui.video_frame);
     rendererBox->setContentsMargins(0, 0, 0, 0);
 #ifdef Q_WS_MAC
     m_glWidget = new VideoGLWidget(m_ui.video_frame);
     rendererBox->addWidget(m_glWidget);
-    render = new Render(m_name, (int) m_ui.video_frame->winId(), -1, this);
+    render = new Render(m_name, (int) m_ui.video_frame->winId(), -1, profile, this);
     m_glWidget->setImageAspectRatio(render->dar());
     m_glWidget->setBackgroundColor(KdenliveSettings::window_background());
     m_glWidget->resize(m_ui.video_frame->size());
@@ -144,7 +146,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QWidget *parent) :
 #else
     m_monitorRefresh = new MonitorRefresh(m_ui.video_frame);
     rendererBox->addWidget(m_monitorRefresh);
-    render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, this);
+    render = new Render(m_name, (int) m_monitorRefresh->winId(), -1, profile, this);
     m_monitorRefresh->setRenderer(render);
 #endif
 
@@ -194,8 +196,10 @@ void Monitor::setupMenu(QMenu *goMenu, QAction *playZone, QAction *loopZone, QMe
     m_playMenu->addAction(loopZone);
 
     //TODO: add save zone to timeline monitor when fixed
-    if (m_name == "clip") m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
-
+    if (m_name == "clip") {
+        m_contextMenu->addMenu(m_markerMenu);
+        m_contextMenu->addAction(KIcon("document-save"), i18n("Save zone"), this, SLOT(slotSaveZone()));
+    }
     QAction *extractFrame = m_configMenu->addAction(KIcon("document-new"), i18n("Extract frame"), this, SLOT(slotExtractCurrentFrame()));
     m_contextMenu->addAction(extractFrame);
 
@@ -283,7 +287,7 @@ DocClipBase *Monitor::activeClip()
 
 void Monitor::updateMarkers(DocClipBase *source)
 {
-    if (source == m_currentClip) {
+    if (source == m_currentClip && source != NULL) {
         m_markerMenu->clear();
         QList <CommentedTime> markers = m_currentClip->commentedSnapMarkers();
         if (!markers.isEmpty()) {
@@ -484,10 +488,12 @@ void Monitor::slotSetThumbFrame()
 void Monitor::slotExtractCurrentFrame()
 {
     QImage frame = render->extractFrame(render->seekFramePosition());
-    KFileDialog *fs = new KFileDialog(KUrl(), "image/png",this);
+    KFileDialog *fs = new KFileDialog(KUrl(), "image/png", this);
     fs->setOperationMode(KFileDialog::Saving);
     fs->setMode(KFile::File);
+#if KDE_IS_VERSION(4,2,0)
     fs->setConfirmOverwrite(true);
+#endif
     fs->setKeepLocation(true);
     fs->exec();
     QString path = fs->selectedFile();
@@ -746,7 +752,7 @@ void Monitor::slotSetXml(DocClipBase *clip, const int position)
     }
     if (clip != m_currentClip) {
         m_currentClip = clip;
-        updateMarkers(clip);        
+        updateMarkers(clip);
         if (render->setProducer(clip->producer(), position) == -1) {
             // MLT CONSUMER is broken
             emit blockMonitors();
@@ -777,10 +783,10 @@ void Monitor::slotSaveZone()
 }
 
 
-void Monitor::resetProfile()
+void Monitor::resetProfile(const QString profile)
 {
     if (render == NULL) return;
-    render->resetProfile();
+    render->resetProfile(profile);
 }
 
 void Monitor::saveSceneList(QString path, QDomElement info)