Bug #653056: Fix menu accelerators not working, crash on save-while-quitting.

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20804 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2011-06-27 18:12:17 +00:00
parent 64418350b7
commit 6909c1697b

View File

@ -3417,18 +3417,20 @@ static gboolean
gnc_quartz_should_quit (GtkOSXApplication *theApp, GncMainWindow *window)
{
QofSession *session;
gboolean needs_save, do_shutdown;
gboolean needs_save;
gboolean finished = gnc_main_window_all_finish_pending();
if (!finished)
if (!gnc_main_window_all_finish_pending() ||
gnc_file_save_in_progress())
{
return TRUE;
}
session = gnc_get_current_session();
needs_save = qof_book_not_saved(qof_session_get_book(session)) &&
!gnc_file_save_in_progress();
if (needs_save && gnc_main_window_prompt_for_save(GTK_WIDGET(window)))
return TRUE;
g_idle_add((GSourceFunc)gnc_shutdown, 0);
g_timeout_add(250, gnc_main_window_timed_quit, NULL);
return TRUE;
}
@ -3445,8 +3447,6 @@ gnc_quartz_set_menu(GncMainWindow* window)
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu));
gtk_widget_hide(menu);
gtk_osxapplication_set_menu_bar (theApp, GTK_MENU_SHELL (menu));
if (gtk_osxapplication_use_quartz_accelerators(theApp))
gtk_osxapplication_set_use_quartz_accelerators(theApp, FALSE);
item = gtk_ui_manager_get_widget (window->ui_merge,
"/menubar/File/FileQuit");