fix new mac menu stuff; push quit item into mac menu bar so that we get proper quit...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 6 Oct 2007 01:20:29 +0000 (01:20 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 6 Oct 2007 01:20:29 +0000 (01:20 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2522 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/SConscript
gtk2_ardour/actions.cc
gtk2_ardour/ardour_ui.cc
gtk2_ardour/cocoacarbon.cc
gtk2_ardour/sync-menu.c
gtk2_ardour/x11.c [deleted file]

index e0ea87ff2d3cfca642a445939c2e60e20fefda5a..82fc200ba48ec46d71e82afe35c73d5d0b1254f5 100644 (file)
@@ -85,7 +85,7 @@ au_pluginui.cc
 
 gtkosx_files=Split("""
 sync-menu.c
-cocoacarbon.c
+cocoacarbon.cc
 """)
 
 x11_files=Split("""
index 2aa0546a095a3ab18e449f20c2ba7a564f9a6afd..c70a07d64da9d79887cc9ef059949021cfcf38f4 100644 (file)
@@ -65,7 +65,7 @@ void
 ActionManager::init ()
 {
        ui_manager = UIManager::create ();
-       
+
        std::string ui_file = ARDOUR::find_config_file (ARDOUR_COMMAND_LINE::menus_file);
 
        bool loaded = false;
index 23487fe5b153f90c7219928ec1e02ddab670876a..bc1369d9eee54b9fc6dfd7b15d3a8070925fac25 100644 (file)
@@ -243,8 +243,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        starting.connect (mem_fun(*this, &ARDOUR_UI::startup));
        stopping.connect (mem_fun(*this, &ARDOUR_UI::shutdown));
-
-       platform_specific ();
 }
 
 int
@@ -336,6 +334,8 @@ ARDOUR_UI::post_engine ()
        update_cpu_load ();
        update_sample_rate (engine->frame_rate());
 
+       platform_specific ();
+
        /* now start and maybe save state */
 
        if (do_engine_start () == 0) {
index a27324b52535de3ff2eb27882594992241999ceb..4548b28179e8da9b9334362023f7da94ba971550 100644 (file)
 */
 
 #include <Carbon/Carbon.h>
+#undef check // stupid, stupid carbon
+
 #include "ardour_ui.h"
+#include "actions.h"
+#include "sync-menu.h"
 
 /* Called for clicks on the dock icon. Can be used to unminimize or
  * create a new window for example.
  */
+
 static OSErr
 handle_reopen_application (const AppleEvent *inAppleEvent, 
                            AppleEvent       *outAppleEvent, 
                            long              inHandlerRefcon)
 {
-        g_print ("AEReopenApplication\n");
-
+       cerr << "reopen app\n";
         return noErr;
 }
 
@@ -37,19 +41,25 @@ handle_quit_application (const AppleEvent *inAppleEvent,
                          AppleEvent       *outAppleEvent, 
                          long              inHandlerRefcon)
 {
-        g_print ("AEQuitApplication\n");
-       
+       cerr << "quit app\n";
        ARDOUR_UI::instance()->quit ();
 
         return noErr;
 }
 
 void
-ARDOUR_UI::platform_specific () (void)
+ARDOUR_UI::platform_specific ()
 {
         AEInstallEventHandler (kCoreEventClass, kAEReopenApplication, 
                                handle_reopen_application, 0, true);
 
         AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, 
                                handle_quit_application, 0, true);
+
+       Gtk::Widget* widget = ActionManager::get_widget ("/ui/Main/Session/Quit");
+       if (widget) {
+               ige_mac_menu_set_quit_menu_item ((GtkMenuItem*) widget->gobj());
+       }
+
 }
+
index 229802b324cef4b413f9f7bfd21d58f282242c61..dacef06384fbc44912c8bc9ec3aa02255e8babf9 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <Carbon/Carbon.h>
 
-#include "ige-mac-menu.h"
+#include "sync-menu.h"
 
 
 /* TODO
diff --git a/gtk2_ardour/x11.c b/gtk2_ardour/x11.c
deleted file mode 100644 (file)
index 323fae0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-foobar