From cc7a6a12b23d035858adef82623a70a4878b1768 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 17 Jan 2019 23:45:20 +1100 Subject: [PATCH] moved loop to playback menu #288 --- mainwindow.cpp | 16 ++++++++++------ mainwindow.h | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 8105e87f6..5353265bb 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -730,6 +730,7 @@ void MainWindow::setup_menus() { // INITIALIZE PLAYBACK MENU QMenu* playback_menu = menuBar->addMenu(tr("&Playback")); + connect(playback_menu, SIGNAL(aboutToShow()), this, SLOT(playbackMenu_About_To_Be_Shown())); playback_menu->addAction(tr("Go to Start"), this, SLOT(go_to_start()), QKeySequence("Home"))->setProperty("id", "gotostart"); playback_menu->addAction(tr("Previous Frame"), this, SLOT(prev_frame()), QKeySequence("Left"))->setProperty("id", "prevframe"); @@ -743,6 +744,11 @@ void MainWindow::setup_menus() { playback_menu->addAction(tr("Go to In Point"), this, SLOT(go_to_in()), QKeySequence("Shift+I"))->setProperty("id", "gotoin"); playback_menu->addAction(tr("Go to Out Point"), this, SLOT(go_to_out()), QKeySequence("Shift+O"))->setProperty("id", "gotoout"); + loop_action = playback_menu->addAction(tr("Loop"), this, SLOT(toggle_bool_action())); + loop_action->setProperty("id", "loop"); + loop_action->setCheckable(true); + loop_action->setData(reinterpret_cast(&config.loop)); + // INITIALIZE WINDOW MENU window_menu = menuBar->addMenu(tr("&Window")); @@ -901,11 +907,6 @@ void MainWindow::setup_menus() { set_name_and_marker->setCheckable(true); set_name_and_marker->setData(reinterpret_cast(&config.set_name_with_marker)); - loop_action = tools_menu->addAction(tr("Loop"), this, SLOT(toggle_bool_action())); - loop_action->setProperty("id", "loop"); - loop_action->setCheckable(true); - loop_action->setData(reinterpret_cast(&config.loop)); - pause_at_out_point_action = tools_menu->addAction(tr("Pause At Out Point"), this, SLOT(toggle_bool_action())); pause_at_out_point_action->setProperty("id", "pauseoutpoint"); pause_at_out_point_action->setCheckable(true); @@ -1164,6 +1165,10 @@ void MainWindow::windowMenu_About_To_Be_Shown() { } } +void MainWindow::playbackMenu_About_To_Be_Shown() { + set_bool_action_checked(loop_action); +} + void MainWindow::viewMenu_About_To_Be_Shown() { set_bool_action_checked(track_lines); @@ -1207,7 +1212,6 @@ void MainWindow::toolMenu_About_To_Be_Shown() { set_bool_action_checked(enable_drop_on_media_to_replace); set_bool_action_checked(enable_hover_focus); set_bool_action_checked(set_name_and_marker); - set_bool_action_checked(loop_action); set_bool_action_checked(pause_at_out_point_action); set_bool_action_checked(seek_also_selects); diff --git a/mainwindow.h b/mainwindow.h index 42b5b8ea8..d51928626 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -84,6 +84,7 @@ private slots: void fileMenu_About_To_Hide(); void editMenu_About_To_Be_Shown(); void windowMenu_About_To_Be_Shown(); + void playbackMenu_About_To_Be_Shown(); void viewMenu_About_To_Be_Shown(); void toolMenu_About_To_Be_Shown();