diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-22 15:22:58 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:22 -0500 |
commit | cf93eaec98fcd2a09173f7f975a74b3fcfe3a320 (patch) | |
tree | eb511e361e848841d4d3505a3bb542aa69cea4c2 | |
parent | fd938d95bfd37f2ae428938c8efee55e9196fd4f (diff) |
break out window ops for Tabbables into show/hide/attach/detach
-rw-r--r-- | gtk2_ardour/ardour.menus.in | 20 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 8 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 23 |
5 files changed, 58 insertions, 23 deletions
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index d6ae12b5a5..7c507c30f6 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -511,8 +511,24 @@ <menu action = 'WindowMenu'> <menuitem action='toggle-audio-midi-setup'/> <separator/> - <menuitem action='show-editor'/> - <menuitem action='show-mixer'/> + <menu action='EditorMenu'> + <menuitem action='show-editor'/> + <menuitem action='hide-editor'/> + <menuitem action='attach-editor'/> + <menuitem action='detach-editor'/> + </menu> + <menu action='MixerMenu'> + <menuitem action='show-mixer'/> + <menuitem action='hide-mixer'/> + <menuitem action='attach-mixer'/> + <menuitem action='detach-mixer'/> + </menu> + <menu action='PrefsMenu'> + <menuitem action='show-application-preferences'/> + <menuitem action='hide-application-preferences'/> + <menuitem action='attach-application-preferences'/> + <menuitem action='detach-application-preferences'/> + </menu> <menuitem action='toggle-meterbridge'/> <separator/> <menuitem action='toggle-inspector'/> diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 5186ce6488..13627e4af1 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -374,9 +374,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Gtkmm2ext::Bindings _global_bindings; - void show_editor (); - void show_mixer (); - void show_application_preferences (); + void show_tabbable (Gtkmm2ext::Tabbable*); + void hide_tabbable (Gtkmm2ext::Tabbable*); + void detach_tabbable (Gtkmm2ext::Tabbable*); + void attach_tabbable (Gtkmm2ext::Tabbable*); + void toggle_meterbridge (); int setup_windows (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 100e0235a3..c895262cb6 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -97,6 +97,10 @@ ARDOUR_UI::setup_windows () return -1; } + rc_option_editor = new RCOptionEditor; + rc_option_editor->add_to_notebook (_tabs, _("Preferences")); + rc_option_editor->contents().show_all (); + /* all other dialogs are created conditionally */ we_have_dependents (); @@ -181,10 +185,6 @@ ARDOUR_UI::setup_windows () _main_window.show_all (); setup_toplevel_window (_main_window, "", this); - rc_option_editor = new RCOptionEditor; - rc_option_editor->add_to_notebook (_tabs, _("Preferences")); - rc_option_editor->contents().show_all (); - _tabs.signal_switch_page().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_switch)); _tabs.signal_page_removed().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_page_removed)); _tabs.signal_page_added().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_page_added)); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index fb4f3d52a1..c31257eb5b 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -330,38 +330,38 @@ _hide_splash (gpointer arg) } void -ARDOUR_UI::show_application_preferences () +ARDOUR_UI::show_tabbable (Tabbable* t) { if (splash && splash->is_visible()) { // in 2 seconds, hide the splash screen Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); } - rc_option_editor->make_visible (); + t->make_visible (); } void -ARDOUR_UI::show_editor () +ARDOUR_UI::hide_tabbable (Tabbable* t) { - if (splash && splash->is_visible()) { - // in 2 seconds, hide the splash screen - Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); - } - - editor->make_visible (); + t->make_invisible (); } void -ARDOUR_UI::show_mixer () +ARDOUR_UI::attach_tabbable (Tabbable* t) { if (splash && splash->is_visible()) { // in 2 seconds, hide the splash screen Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000); } - mixer->make_visible (); + t->attach (); } +void +ARDOUR_UI::detach_tabbable (Tabbable* t) +{ + t->detach (); +} void ARDOUR_UI::toggle_meterbridge () diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 43ad3e3ee3..203babd597 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -106,6 +106,10 @@ ARDOUR_UI::install_actions () ActionManager::register_action (main_menu_actions, X_("Sync"), _("Sync")); ActionManager::register_action (main_menu_actions, X_("TransportOptions"), _("Options")); ActionManager::register_action (main_menu_actions, X_("WindowMenu"), _("Window")); + ActionManager::register_action (main_menu_actions, X_("MixerMenu"), _("Mixer")); + ActionManager::register_action (main_menu_actions, X_("EditorMenu"), _("Editor")); + ActionManager::register_action (main_menu_actions, X_("PrefsMenu"), _("Preferences")); + ActionManager::register_action (main_menu_actions, X_("DetachMenu"), _("Detach")); ActionManager::register_action (main_menu_actions, X_("Help"), _("Help")); ActionManager::register_action (main_menu_actions, X_("KeyMouseActions"), _("Misc. Shortcuts")); ActionManager::register_action (main_menu_actions, X_("AudioFileFormat"), _("Audio File Format")); @@ -215,9 +219,22 @@ ARDOUR_UI::install_actions () common_actions = ActionGroup::create (X_("Common")); ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (hide_return (sigc::mem_fun(*this, &ARDOUR_UI::finish)))); ActionManager::register_action (common_actions, X_("Hide"), _("Hide"), sigc::mem_fun (*this, &ARDOUR_UI::hide_application)); - ActionManager::register_action (common_actions, X_("show-editor"), _("Show Editor"), sigc::mem_fun (*this, &ARDOUR_UI::show_editor)); - ActionManager::register_action (common_actions, X_("show-mixer"), _("Show Mixer"), sigc::mem_fun (*this, &ARDOUR_UI::show_mixer)); - ActionManager::register_action (common_actions, X_("show-application-preferences"), _("Preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_application_preferences)); + + ActionManager::register_action (common_actions, X_("show-editor"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), editor)); + ActionManager::register_action (common_actions, X_("show-mixer"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), mixer)); + ActionManager::register_action (common_actions, X_("show-application-preferences"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor)); + + ActionManager::register_action (common_actions, X_("hide-editor"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), editor)); + ActionManager::register_action (common_actions, X_("hide-mixer"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), mixer)); + ActionManager::register_action (common_actions, X_("hide-application-preferences"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), rc_option_editor)); + + ActionManager::register_action (common_actions, X_("attach-editor"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), editor)); + ActionManager::register_action (common_actions, X_("attach-mixer"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), mixer)); + ActionManager::register_action (common_actions, X_("attach-application-preferences"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), rc_option_editor)); + + ActionManager::register_action (common_actions, X_("detach-editor"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), editor)); + ActionManager::register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer)); + ActionManager::register_action (common_actions, X_("detach-application-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor)); /* windows visibility actions */ |