Skip to content

Commit

Permalink
Separate window menu to separate ui file, separate function load func…
Browse files Browse the repository at this point in the history
…tion called only when not using MAC_INTEGRATION.

Quartz takes care of this on its own, and having Gnucash do it too creates two lists. The old approach, of just ifdeffing away the actions, worked but caused the trace log to fill up with "action missing" errors.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20690 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
jralls committed May 26, 2011
1 parent dd28320 commit 6d3cdce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
28 changes: 27 additions & 1 deletion src/gnome-utils/gnc-main-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,32 @@ connect_proxy (GtkUIManager *merge,
}
/* CS: end copied code from gtk+/test/testmerge.c */

static void
gnc_main_window_window_menu (GncMainWindow *window)
{
GncMainWindowPrivate *priv;
guint merge_id;
#ifdef MAC_INTEGRATION
gchar *filename = gnc_gnome_locate_ui_file("gnc-window-menu-ui-quartz.xml");
#else
gchar *filename = gnc_gnome_locate_ui_file("gnc-window-menu-ui.xml");
#endif
GError *error = NULL;
g_assert(filename);
merge_id = gtk_ui_manager_add_ui_from_file(window->ui_merge, filename,
&error);
g_free(filename);
g_assert(merge_id);
#ifndef MAC_INTEGRATION
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
gtk_action_group_add_radio_actions (priv->action_group,
radio_entries, n_radio_entries,
0,
G_CALLBACK(gnc_main_window_cmd_window_raise),
window);
#endif
};

static void
gnc_main_window_setup_window (GncMainWindow *window)
{
Expand Down Expand Up @@ -3334,7 +3360,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
g_assert(merge_id != 0);
}
g_free(filename);

gnc_main_window_window_menu(window);
gnc_gconf_add_notification(G_OBJECT(window), GCONF_GENERAL,
gnc_main_window_gconf_changed,
GNC_MAIN_WINDOW_NAME);
Expand Down
2 changes: 2 additions & 0 deletions src/gnome-utils/ui/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
uidir = $(GNC_UI_DIR)
ui_DATA = \
gnc-main-window-ui.xml \
gnc-windows-menu-ui.xml \
gnc-windows-menu-ui-quartz.xml \
osx_accel_map

EXTRA_DIST = $(ui_DATA)
17 changes: 2 additions & 15 deletions src/gnome-utils/ui/gnc-main-window-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,8 @@
<placeholder name="ExtensionsPlaceholder"/>
</menu>

<menu name="Windows" action="WindowsAction">
<menuitem name="WindowNew" action="WindowNewAction"/>
<menuitem name="WindowMovePage" action="WindowMovePageAction"/>
<separator name="ViewSep4"/>
<menuitem name="Window0" action="Window0Action"/>
<menuitem name="Window1" action="Window1Action"/>
<menuitem name="Window2" action="Window2Action"/>
<menuitem name="Window3" action="Window3Action"/>
<menuitem name="Window4" action="Window4Action"/>
<menuitem name="Window5" action="Window5Action"/>
<menuitem name="Window6" action="Window6Action"/>
<menuitem name="Window7" action="Window7Action"/>
<menuitem name="Window8" action="Window8Action"/>
<menuitem name="Window9" action="Window9Action"/>
<placeholder name="WindowsPlaceholder"/>
<menu name="Windows" action="WindowsAction" >
<placeholder name= "WindowPlaceholder"/>
</menu>

<menu name="Help" action="HelpAction">
Expand Down

0 comments on commit 6d3cdce

Please sign in to comment.