cleanup menus/actions mess exposed on OS X; remove video items from OS X menus (for...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 May 2013 15:43:33 +0000 (11:43 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 8 May 2013 15:43:33 +0000 (11:43 -0400)
gtk2_ardour/actions.cc
gtk2_ardour/actions.h
gtk2_ardour/ardour.menus.in
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui_ed.cc

index 343dd20308476424f3af5269d7d35f15dcd2a814..3b0133b5355fb6e691c6d50151f401ae4ca4a018 100644 (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::edit_point_in_region_sensitive_actions;
 
+static Glib::RefPtr<UIManager> 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);
 
index fd9af9992aba2daccab7b1f1370a8da445a7521e..20c0532636c0641aa22800f0fbfe42af89eb8beb 100644 (file)
@@ -30,6 +30,7 @@ namespace ActionManager {
        /* Ardour specific */
 
        extern void init ();
+       extern void load_menus ();
 
        extern std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
        extern std::vector<Glib::RefPtr<Gtk::Action> > write_sensitive_actions;
index 5b10a4f2c2207335a11a6f10210f31fed8a09049..632136c73424d8e1e43947e20c74009fb4496783 100644 (file)
       <menuitem action='addExistingAudioFiles'/>
       <!--menuitem action='importFromSession'/-->
 
+#ifndef GTKOSX
       <menuitem action='OpenVideo'/>
       <menuitem action='CloseVideo'/>
-
+#endif
       <menu name='Export' action='Export'>
         <menuitem action='ExportAudio'/>
         <menuitem action='StemExport'/>
         <menuitem action='CleanupUnused'/>
         <menuitem action='FlushWastebasket'/>
       </menu>
-#ifndef GTKOSX
       <separator/>
-#endif
       <menuitem action='toggle-session-options-editor'/>
-#ifdef GTKOSX
-      <menuitem action='toggle-rc-options-editor'/>
+#ifdef GTKOSX      
       <menuitem action='toggle-about'/>
+      <menuitem action='toggle-rc-options-editor'/>
 #endif
+#ifndef GTKOSX
       <separator/>
       <menuitem action='Quit'/>
+#endif
     </menu>
 
     <menu name='Transport' action='Transport'>
         <menuitem action='snap-regions-to-grid'/>
         <menuitem action='toggle-region-lock'/>
         <menuitem action='toggle-region-lock-style'/>
+#ifndef GTKOSX
         <menuitem action='toggle-region-video-lock'/>
+#endif
         <menuitem action='set-region-sync-position'/>
         <menuitem action='remove-region-sync'/>
         <menuitem action='nudge-forward'/>
         <menuitem action="toggle-cd-marker-ruler"/>
         <menuitem action="toggle-marker-ruler"/>
         <separator/>
+#ifndef GTKOSX
         <menuitem action="toggle-video-ruler"/>
+#endif
       </menu>
       <menu action="VideoMonitorMenu">
         <menuitem action="zoom-vmon-100"/>
     <menuitem action="toggle-marker-ruler"/>
     <menuitem action="toggle-cd-marker-ruler"/>
     <menuitem action="toggle-loop-punch-ruler"/>
-         <separator/>
-         <menuitem action="toggle-video-ruler"/>
+#ifndef GTKOSX
+    <separator/>
+    <menuitem action="toggle-video-ruler"/>
+#endif
   </popup>
 
   <popup name='ProcessorMenu'>
       <menuitem action='naturalize-region'/>
       <menuitem action='toggle-region-lock'/>
       <menuitem action='toggle-region-lock-style'/>
+#ifndef GTKOSX
       <menuitem action='toggle-region-video-lock'/>
+#endif
       <menuitem action='snap-regions-to-grid'/>
       <menuitem action='set-region-sync-position'/>
       <menuitem action='remove-region-sync'/>
index 250a94baa43b3af2601fed0fb9821c31c1a92286..4dcb4eb5fa2d6d89535ff56a3b52249d34a7a2ac 100644 (file)
@@ -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 ();
        }
index b3621c177971b13464636f9222cde8d2c2795350..941f1936d1bd6db43d475461c6a7f7d0486bf393 100644 (file)
@@ -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<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->set_menu_bar (*menu_bar);
 }