From 4c6d5a178c538b539be8ce1bf1bb415caec213dd Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 8 Oct 2011 19:14:01 +0000 Subject: [PATCH] Update Mac customizations for gtk-mac-integration-1.0.0 Mac integration has had a name and api change from ige-mac-integration as part of migration from Sourceforge to Gnome. Also, gtk_osxapplication_add_app_menu_item() has been replaced with gtk_osxapplication_insert_menu_item(), gtk_osxapplication_add_app_menu_group() has been removed (just insert a separator where you want it), and gtk_osxapplication path functions had been deprecated in favor of quartz-application equivalents; those deprecated convenience macros were removed in 1.0.0 BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21398 57a11ea4-9604-0410-9ed3-97b8803252fd --- configure.ac | 16 ++++++++-------- src/bin/Makefile.am | 2 +- src/core-utils/Makefile.am | 4 ++-- src/core-utils/binreloc.c | 9 ++++----- src/gnome-utils/Makefile.am | 4 ++-- src/gnome-utils/gnc-main-window.c | 25 +++++++++++-------------- src/gnome/Makefile.am | 2 +- 7 files changed, 29 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index bf58ae4705..797e335e55 100644 --- a/configure.ac +++ b/configure.ac @@ -276,15 +276,15 @@ update to latest darwin]) platform=darwin/quartz AC_MSG_RESULT(yes) AC_DEFINE(GDK_QUARTZ,,[Using GDK Quartz (not X11)]) - PKG_CHECK_MODULES([IGE_MAC], ige-mac-integration, - [_ige_mac=yes], [_ige_mac=no]) - if test "x$_ige_mac" = xyes; then - IGE_MAC_LIBS="${IGE_MAC_LIBS} -lobjc" - IGE_MAC_CFLAGS="${IGE_MAC_CFLAGS} -xobjective-c" + PKG_CHECK_MODULES([GTK_MAC], gtk-mac-integration, + [_gtk_mac=yes], [_gtk_mac=no]) + if test "x$_gtk_mac" = xyes; then + GTK_MAC_LIBS="${GTK_MAC_LIBS} -lobjc" + GTK_MAC_CFLAGS="${GTK_MAC_CFLAGS} -xobjective-c" fi - AC_MSG_RESULT(${_ige_mac}) - AC_SUBST(IGE_MAC_LIBS) - AC_SUBST(IGE_MAC_CFLAGS) + AC_MSG_RESULT(${_gtk_mac}) + AC_SUBST(GTK_MAC_LIBS) + AC_SUBST(GTK_MAC_CFLAGS) else AC_MSG_RESULT(no) fi diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 455ac81d16..9ad0a286e5 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -19,7 +19,7 @@ AM_CPPFLAGS = -I${top_builddir} ${GLIB_CFLAGS} ${GNOME_CFLAGS} ${GTK_CFLAGS} \ -I${top_srcdir}/src/gnc-module \ -I${top_srcdir}/src/libqof/qof \ ${GUILE_INCS} \ - ${IGE_MAC_CFLAGS} + ${GTK_MAC_CFLAGS} SUFFIXES = .rc .res diff --git a/src/core-utils/Makefile.am b/src/core-utils/Makefile.am index b1b3082546..8af3629257 100644 --- a/src/core-utils/Makefile.am +++ b/src/core-utils/Makefile.am @@ -20,7 +20,7 @@ libgnc_core_utils_la_LIBADD = \ ${GUILE_LIBS} \ ${GLIB_LIBS} \ ${BINRELOC_LIBS} \ - ${IGE_MAC_LIBS} \ + ${GTK_MAC_LIBS} \ ${GCONF_LIBS} \ ${QOF_LIBS} @@ -47,7 +47,7 @@ AM_CPPFLAGS = \ ${GUILE_INCS} \ ${GLIB_CFLAGS} \ ${GCONF_CFLAGS} \ - ${IGE_MAC_CFLAGS} \ + ${GTK_MAC_CFLAGS} \ ${QOF_CFLAGS} \ -I${top_srcdir}/src/libqof/qof \ -I${top_builddir}/src \ diff --git a/src/core-utils/binreloc.c b/src/core-utils/binreloc.c index 17e8a818dc..7a5014c7ef 100644 --- a/src/core-utils/binreloc.c +++ b/src/core-utils/binreloc.c @@ -19,7 +19,7 @@ #include #include #ifdef MAC_INTEGRATION -#include +#include #endif #endif /* ENABLE_BINRELOC */ #include @@ -63,10 +63,9 @@ _br_find_exe (Gnc_GbrInitError *error) g_free (prefix); return result; #elif defined MAC_INTEGRATION - GtkOSXApplication *theApp; - g_type_init(); - theApp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL); - return gtk_osxapplication_get_executable_path(theApp); + gchar *path = quartz_application_get_executable_path(); + g_print ("Application Path %s\n", path); + return path; #else char *path, *path2, *line, *result; size_t buf_size; diff --git a/src/gnome-utils/Makefile.am b/src/gnome-utils/Makefile.am index 91184ed776..bb37a17347 100644 --- a/src/gnome-utils/Makefile.am +++ b/src/gnome-utils/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS = \ ${QOF_CFLAGS} \ ${GOFFICE_CFLAGS} \ ${LIBGDA_CFLAGS} \ - ${IGE_MAC_CFLAGS} + ${GTK_MAC_CFLAGS} libgncmod_gnome_utils_la_SOURCES = \ account-quickfill.c \ @@ -204,7 +204,7 @@ libgncmod_gnome_utils_la_LIBADD = \ ${DB_LIBS} \ ${REGEX_LIBS} \ ${LIBXML2_LIBS} \ - ${IGE_MAC_LIBS} + ${GTK_MAC_LIBS} if HAVE_X11_XLIB_H libgncmod_gnome_utils_la_LIBADD += -lX11 diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index 3f673b3728..25b590b091 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -69,7 +69,7 @@ #include "gnc-autosave.h" #include "print-session.h" #ifdef MAC_INTEGRATION -#include +#include #endif /** Names of signals generated by the main window. */ @@ -3456,23 +3456,20 @@ gnc_quartz_set_menu(GncMainWindow* window) if (GTK_IS_MENU_ITEM (item)) gtk_widget_hide (GTK_WIDGET (item)); - /* the about group */ - group = gtk_osxapplication_add_app_menu_group (theApp); - - item = gtk_ui_manager_get_widget (window->ui_merge, - "/menubar/Help/HelpAbout"); + item = gtk_ui_manager_get_widget (window->ui_merge, + "/menubar/Edit/EditPreferences"); if (GTK_IS_MENU_ITEM (item)) - gtk_osxapplication_add_app_menu_item (theApp, group, - GTK_MENU_ITEM (item)); - - /* the preferences group */ - group = gtk_osxapplication_add_app_menu_group (theApp); + gtk_osxapplication_insert_app_menu_item (theApp, GTK_WIDGET (item), 0); item = gtk_ui_manager_get_widget (window->ui_merge, - "/menubar/Edit/EditPreferences"); + "/menubar/Help/HelpAbout"); if (GTK_IS_MENU_ITEM (item)) - gtk_osxapplication_add_app_menu_item (theApp, group, - GTK_MENU_ITEM (item)); + { + gtk_osxapplication_insert_app_menu_item (theApp, + gtk_separator_menu_item_new (), + 0); + gtk_osxapplication_insert_app_menu_item (theApp, GTK_WIDGET (item), 0); + } item = gtk_ui_manager_get_widget (window->ui_merge, "/menubar/Help"); diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index d29d833346..8f72754c02 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -123,7 +123,7 @@ AM_CPPFLAGS = \ ${GNOME_CFLAGS} \ ${GLADE_CFLAGS} \ $(GLIB_CFLAGS) \ - ${IGE_MAC_CFLAGS} + ${GTK_MAC_CFLAGS} # We build this in an earlier directory.