cleanup menus/actions mess exposed on OS X; remove video items from OS X menus (for now)

This commit is contained in:
Paul Davis 2013-05-08 11:43:33 -04:00
parent a70192adff
commit 4cd27e4733
5 changed files with 38 additions and 18 deletions

View file

@ -63,13 +63,18 @@ vector<RefPtr<Gtk::Action> > ActionManager::jack_opposite_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::transport_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::transport_sensitive_actions;
vector<RefPtr<Gtk::Action> > ActionManager::edit_point_in_region_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::edit_point_in_region_sensitive_actions;
static Glib::RefPtr<UIManager> ui_manager;
void void
ActionManager::init () ActionManager::init ()
{ {
std::string ui_file;
ui_manager = UIManager::create (); 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); find_file_in_search_path (ardour_config_search_path(), "ardour.menus", ui_file);

View file

@ -30,6 +30,7 @@ namespace ActionManager {
/* Ardour specific */ /* Ardour specific */
extern void init (); extern void init ();
extern void load_menus ();
extern std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions; extern std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
extern std::vector<Glib::RefPtr<Gtk::Action> > write_sensitive_actions; extern std::vector<Glib::RefPtr<Gtk::Action> > write_sensitive_actions;

View file

@ -35,9 +35,10 @@
<menuitem action='addExistingAudioFiles'/> <menuitem action='addExistingAudioFiles'/>
<!--menuitem action='importFromSession'/--> <!--menuitem action='importFromSession'/-->
#ifndef GTKOSX
<menuitem action='OpenVideo'/> <menuitem action='OpenVideo'/>
<menuitem action='CloseVideo'/> <menuitem action='CloseVideo'/>
#endif
<menu name='Export' action='Export'> <menu name='Export' action='Export'>
<menuitem action='ExportAudio'/> <menuitem action='ExportAudio'/>
<menuitem action='StemExport'/> <menuitem action='StemExport'/>
@ -47,16 +48,16 @@
<menuitem action='CleanupUnused'/> <menuitem action='CleanupUnused'/>
<menuitem action='FlushWastebasket'/> <menuitem action='FlushWastebasket'/>
</menu> </menu>
#ifndef GTKOSX
<separator/> <separator/>
#endif
<menuitem action='toggle-session-options-editor'/> <menuitem action='toggle-session-options-editor'/>
#ifdef GTKOSX #ifdef GTKOSX
<menuitem action='toggle-rc-options-editor'/>
<menuitem action='toggle-about'/> <menuitem action='toggle-about'/>
<menuitem action='toggle-rc-options-editor'/>
#endif #endif
#ifndef GTKOSX
<separator/> <separator/>
<menuitem action='Quit'/> <menuitem action='Quit'/>
#endif
</menu> </menu>
<menu name='Transport' action='Transport'> <menu name='Transport' action='Transport'>
@ -281,7 +282,9 @@
<menuitem action='snap-regions-to-grid'/> <menuitem action='snap-regions-to-grid'/>
<menuitem action='toggle-region-lock'/> <menuitem action='toggle-region-lock'/>
<menuitem action='toggle-region-lock-style'/> <menuitem action='toggle-region-lock-style'/>
#ifndef GTKOSX
<menuitem action='toggle-region-video-lock'/> <menuitem action='toggle-region-video-lock'/>
#endif
<menuitem action='set-region-sync-position'/> <menuitem action='set-region-sync-position'/>
<menuitem action='remove-region-sync'/> <menuitem action='remove-region-sync'/>
<menuitem action='nudge-forward'/> <menuitem action='nudge-forward'/>
@ -434,7 +437,9 @@
<menuitem action="toggle-cd-marker-ruler"/> <menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-marker-ruler"/> <menuitem action="toggle-marker-ruler"/>
<separator/> <separator/>
#ifndef GTKOSX
<menuitem action="toggle-video-ruler"/> <menuitem action="toggle-video-ruler"/>
#endif
</menu> </menu>
<menu action="VideoMonitorMenu"> <menu action="VideoMonitorMenu">
<menuitem action="zoom-vmon-100"/> <menuitem action="zoom-vmon-100"/>
@ -552,8 +557,10 @@
<menuitem action="toggle-marker-ruler"/> <menuitem action="toggle-marker-ruler"/>
<menuitem action="toggle-cd-marker-ruler"/> <menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-loop-punch-ruler"/> <menuitem action="toggle-loop-punch-ruler"/>
#ifndef GTKOSX
<separator/> <separator/>
<menuitem action="toggle-video-ruler"/> <menuitem action="toggle-video-ruler"/>
#endif
</popup> </popup>
<popup name='ProcessorMenu'> <popup name='ProcessorMenu'>
@ -649,7 +656,9 @@
<menuitem action='naturalize-region'/> <menuitem action='naturalize-region'/>
<menuitem action='toggle-region-lock'/> <menuitem action='toggle-region-lock'/>
<menuitem action='toggle-region-lock-style'/> <menuitem action='toggle-region-lock-style'/>
#ifndef GTKOSX
<menuitem action='toggle-region-video-lock'/> <menuitem action='toggle-region-video-lock'/>
#endif
<menuitem action='snap-regions-to-grid'/> <menuitem action='snap-regions-to-grid'/>
<menuitem action='set-region-sync-position'/> <menuitem action='set-region-sync-position'/>
<menuitem action='remove-region-sync'/> <menuitem action='remove-region-sync'/>

View file

@ -319,7 +319,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
TimeAxisViewItem::set_constant_heights (); TimeAxisViewItem::set_constant_heights ();
/* load up the UI manager */ /* Set this up so that our window proxies can register actions */
ActionManager::init (); ActionManager::init ();
@ -426,6 +426,8 @@ ARDOUR_UI::post_engine ()
_tooltips.enable(); _tooltips.enable();
ActionManager::load_menus ();
if (setup_windows ()) { if (setup_windows ()) {
throw failed_constructor (); throw failed_constructor ();
} }

View file

@ -573,7 +573,10 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
Gtk::Widget* widget; Gtk::Widget* widget;
Application* app = Application::instance (); 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"))) { if ((widget = ActionManager::get_widget ("/ui/Main/Session/Quit"))) {
widget->hide (); widget->hide ();
@ -585,11 +588,11 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
GtkApplicationMenuGroup* group = app->add_app_menu_group (); 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<MenuItem*>(widget)); app->add_app_menu_item (group, dynamic_cast<MenuItem*>(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<MenuItem*>(widget)); app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
} }