From a5f61340ef90850f2cc1adaaa09c57c042d9eda0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 19 Dec 2016 19:21:38 +0100 Subject: [PATCH] Show relevant preferences on sync-button right-click --- gtk2_ardour/ardour_ui.h | 1 + gtk2_ardour/ardour_ui2.cc | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 33dd9edf3a..3ebd3d5899 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -831,6 +831,7 @@ private: int ambiguous_file (std::string file, std::vector hits); bool click_button_clicked (GdkEventButton *); + bool sync_button_clicked (GdkEventButton *); VisibilityGroup _status_bar_visibility; diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 0d5a52ba13..4954dc46aa 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -259,7 +259,9 @@ ARDOUR_UI::setup_transport () act = ActionManager::get_action (X_("MIDI"), X_("panic")); midi_panic_button.set_related_action (act); act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync")); + sync_button.set_related_action (act); + sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false); sync_button.set_sizing_text (S_("LogestSync|M-Clk")); @@ -763,6 +765,19 @@ ARDOUR_UI::click_button_clicked (GdkEventButton* ev) return true; } +bool +ARDOUR_UI::sync_button_clicked (GdkEventButton* ev) +{ + if (ev->button != 3) { + /* this handler is just for button-3 clicks */ + return false; + } + + show_tabbable (rc_option_editor); + rc_option_editor->set_current_page (_("Transport/Sync")); + return true; +} + void ARDOUR_UI::toggle_follow_edits () {