+void Monitor::setupMenu(QMenu *goMenu) {
+ m_contextMenu = new QMenu(this);
+ m_contextMenu->addMenu(m_playMenu);
+ m_contextMenu->addMenu(goMenu);
+
+ //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()));
+
+ QAction *extractFrame = m_configMenu->addAction(KIcon("document-new"), i18n("Extract frame"), this, SLOT(slotExtractCurrentFrame()));
+ m_contextMenu->addAction(extractFrame);
+
+ if (m_name != "clip") {
+ QAction *splitView = m_contextMenu->addAction(KIcon("document-new"), i18n("Split view"), render, SLOT(slotSplitView(bool)));
+ splitView->setCheckable(true);
+ m_configMenu->addAction(splitView);
+ } else {
+ QAction *setThumbFrame = m_contextMenu->addAction(KIcon("document-new"), i18n("Set current image as thumbnail"), this, SLOT(slotSetThumbFrame()));
+ m_configMenu->addAction(setThumbFrame);
+ }
+
+}
+
+void Monitor::slotSetSizeOneToOne() {
+ QRect r = QApplication::desktop()->screenGeometry();
+ const int maxWidth = r.width() - 20;
+ const int maxHeight = r.height() - 20;
+ int width = render->renderWidth();
+ int height = render->renderHeight();
+ kDebug() << "// render info: " << width << "x" << height;
+ while (width >= maxWidth || height >= maxHeight) {
+ width = width * 0.8;
+ height = height * 0.8;
+ }
+ kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
+ ui.video_frame->setFixedSize(width, height);
+ updateGeometry();
+ adjustSize();
+ //ui.video_frame->setMinimumSize(0, 0);
+ emit adjustMonitorSize();
+}
+
+void Monitor::slotSetSizeOneToTwo() {
+ QRect r = QApplication::desktop()->screenGeometry();
+ const int maxWidth = r.width() - 20;
+ const int maxHeight = r.height() - 20;
+ int width = render->renderWidth() / 2;
+ int height = render->renderHeight() / 2;
+ kDebug() << "// render info: " << width << "x" << height;
+ while (width >= maxWidth || height >= maxHeight) {
+ width = width * 0.8;
+ height = height * 0.8;
+ }
+ kDebug() << "// MONITOR; set SIZE: " << width << ", " << height;
+ ui.video_frame->setFixedSize(width, height);
+ updateGeometry();
+ adjustSize();
+ //ui.video_frame->setMinimumSize(0, 0);
+ emit adjustMonitorSize();
+}
+
+void Monitor::resetSize() {
+ ui.video_frame->setMinimumSize(0, 0);
+}
+
+void Monitor::slotZoneMoved(int start, int end) {
+ m_ruler->setZone(start, end);
+}
+
+void Monitor::slotSetZoneStart() {
+ m_ruler->setZone(m_position, -1);
+ emit zoneUpdated(m_ruler->zone());
+}
+
+void Monitor::slotSetZoneEnd() {
+ m_ruler->setZone(-1, m_position);
+ emit zoneUpdated(m_ruler->zone());
+}
+