From 4cd27e47336c566d10ec88e80541097059b3c732 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 8 May 2013 11:43:33 -0400 Subject: [PATCH] cleanup menus/actions mess exposed on OS X; remove video items from OS X menus (for now) --- gtk2_ardour/actions.cc | 9 +++++++-- gtk2_ardour/actions.h | 1 + gtk2_ardour/ardour.menus.in | 23 ++++++++++++++++------- gtk2_ardour/ardour_ui.cc | 4 +++- gtk2_ardour/ardour_ui_ed.cc | 13 ++++++++----- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index 343dd20308..3b0133b535 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -63,13 +63,18 @@ vector > ActionManager::jack_opposite_sensitive_actions; vector > ActionManager::transport_sensitive_actions; vector > ActionManager::edit_point_in_region_sensitive_actions; +static Glib::RefPtr ui_manager; void ActionManager::init () { - std::string ui_file; - ui_manager = UIManager::create (); +} + +void +ActionManager::load_menus () +{ + std::string ui_file; find_file_in_search_path (ardour_config_search_path(), "ardour.menus", ui_file); diff --git a/gtk2_ardour/actions.h b/gtk2_ardour/actions.h index fd9af9992a..20c0532636 100644 --- a/gtk2_ardour/actions.h +++ b/gtk2_ardour/actions.h @@ -30,6 +30,7 @@ namespace ActionManager { /* Ardour specific */ extern void init (); + extern void load_menus (); extern std::vector > session_sensitive_actions; extern std::vector > write_sensitive_actions; diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 5b10a4f2c2..632136c734 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -35,9 +35,10 @@ +#ifndef GTKOSX - +#endif @@ -47,16 +48,16 @@ -#ifndef GTKOSX -#endif -#ifdef GTKOSX - +#ifdef GTKOSX + #endif +#ifndef GTKOSX +#endif @@ -281,7 +282,9 @@ +#ifndef GTKOSX +#endif @@ -434,7 +437,9 @@ +#ifndef GTKOSX +#endif @@ -552,8 +557,10 @@ - - +#ifndef GTKOSX + + +#endif @@ -649,7 +656,9 @@ +#ifndef GTKOSX +#endif diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 250a94baa4..4dcb4eb5fa 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -319,7 +319,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) TimeAxisViewItem::set_constant_heights (); - /* load up the UI manager */ + /* Set this up so that our window proxies can register actions */ ActionManager::init (); @@ -426,6 +426,8 @@ ARDOUR_UI::post_engine () _tooltips.enable(); + ActionManager::load_menus (); + if (setup_windows ()) { throw failed_constructor (); } diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index b3621c1779..941f1936d1 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -573,7 +573,10 @@ ARDOUR_UI::use_menubar_as_top_menubar () Gtk::Widget* widget; Application* app = Application::instance (); - /* Quit will be taken of separately */ + /* the addresses ("/ui/Main...") used below are based on the menu definitions in the menus file + */ + + /* Quit will be taken care of separately */ if ((widget = ActionManager::get_widget ("/ui/Main/Session/Quit"))) { widget->hide (); @@ -585,13 +588,13 @@ ARDOUR_UI::use_menubar_as_top_menubar () GtkApplicationMenuGroup* group = app->add_app_menu_group (); - if ((widget = ActionManager::get_widget ("/ui/Windows/toggle-about"))) { + if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-about"))) { app->add_app_menu_item (group, dynamic_cast(widget)); - } + } - if ((widget = ActionManager::get_widget ("/ui/Windows/toggle-rc-options-editor"))) { + if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-rc-options-editor"))) { app->add_app_menu_item (group, dynamic_cast(widget)); - } + } app->set_menu_bar (*menu_bar); } -- 2.30.2