mirror of https://github.com/GNOME/gimp.git
app: don't call gimp_ui_manager_update() directly
gimp_ui_manager_update() should not be called directly. Instead call gimp_image_flush() after doing changes that need to be reflected in the menus.
This commit is contained in:
parent
f24ff4aca2
commit
6742ebc949
|
@ -234,6 +234,9 @@ file_save_dialog_response (GtkWidget *save_dialog,
|
|||
GIMP_FILE_SAVE_LAST_URI_KEY,
|
||||
g_strdup (uri), (GDestroyNotify) g_free);
|
||||
|
||||
/* make sure the menus are updated with the keys we've just set */
|
||||
gimp_image_flush (dialog->image);
|
||||
|
||||
/* Handle close-after-saing */
|
||||
if (dialog)
|
||||
{
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "file/file-utils.h"
|
||||
|
||||
#include "widgets/gimpuimanager.h"
|
||||
|
||||
#include "gimpdisplay.h"
|
||||
#include "gimpdisplay-handlers.h"
|
||||
#include "gimpdisplayshell.h"
|
||||
|
@ -168,22 +166,11 @@ gimp_display_saved_handler (GimpImage *image,
|
|||
gchar *filename = file_utils_uri_display_name (uri);
|
||||
|
||||
gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GIMP_MESSAGE_INFO,
|
||||
GTK_STOCK_SAVE, _("Image saved to '%s'"), filename);
|
||||
GTK_STOCK_SAVE, _("Image saved to '%s'"),
|
||||
filename);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_display_update_ui_manager_idle (GimpDisplay *display)
|
||||
{
|
||||
if (! display || ! display->shell)
|
||||
return FALSE;
|
||||
|
||||
/* Update the File/Export to label */
|
||||
gimp_ui_manager_update (GIMP_DISPLAY_SHELL (display->shell)->menubar_manager, display);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_display_exported_handler (GimpImage *image,
|
||||
const gchar *uri,
|
||||
|
@ -193,10 +180,8 @@ gimp_display_exported_handler (GimpImage *image,
|
|||
gchar *filename = file_utils_uri_display_name (uri);
|
||||
|
||||
gimp_statusbar_push_temp (GIMP_STATUSBAR (statusbar), GIMP_MESSAGE_INFO,
|
||||
GTK_STOCK_SAVE, _("Image exported to '%s'"), filename);
|
||||
GTK_STOCK_SAVE, _("Image exported to '%s'"),
|
||||
filename);
|
||||
g_free (filename);
|
||||
|
||||
/* Schedule updating of the 'Export to' label */
|
||||
g_idle_add ((GSourceFunc) gimp_display_update_ui_manager_idle, display);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue