diff --git a/ChangeLog b/ChangeLog index 74ede7ad50..0f4993194f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2004-07-21 Michael Natterer + + Enabled the various "Clear saved foobar now" buttons in prefs: + + * app/gui/session.[ch] + * app/menus/menus.[ch] + * app/widgets/gimpdevices.[ch]: implemented the _clear() + functions: unlink() the rc file and set an internal flag that it + has been deleted. Added "gboolean always_save" parameter to the + _save() functions and don't save anything if it is FALSE and the + internal deletion flag has been set. + + * app/gui/gui.c + * app/widgets/gimpdevicestatus.c: changed accordingly. + + * app/gui/preferences-dialog.c: added callbacks for all "Save now" + and "Clear now" buttons and show error messages if clearing fails. + Inform the user that she has to restart GIMP to see the effect of + the clearing. + 2004-07-21 Michael Natterer * app/core/gimpmarshal.list diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 024fdd876f..1c6114d24d 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -88,6 +88,18 @@ static void prefs_input_dialog_able_callback (GtkWidget *widget, gpointer data); static void prefs_keyboard_shortcuts_dialog (GtkWidget *widget, Gimp *gimp); +static void prefs_menus_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_menus_clear_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_session_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_session_clear_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_devices_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_devices_clear_callback (GtkWidget *widget, + Gimp *gimp); /* private variables */ @@ -519,6 +531,108 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget, gtk_widget_show (dialog); } +static void +prefs_menus_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + menus_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_menus_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! menus_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your keyboard shortcuts will be reset to default values " + "the next time you start GIMP.")); + } +} + +static void +prefs_session_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + session_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_session_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! session_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your window setup will be reset to default values. " + "the next time you start GIMP.")); + } +} + +static void +prefs_devices_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + gimp_devices_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_devices_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! gimp_devices_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your input device settings will be reset to " + "default values the next time you start GIMP.")); + } +} + static GtkWidget * prefs_notebook_append_page (Gimp *gimp, GtkNotebook *notebook, @@ -1006,6 +1120,7 @@ prefs_dialog_new (Gimp *gimp, GtkWidget *vbox2; GtkWidget *hbox; GtkWidget *button; + GtkWidget *button2; GtkWidget *fileselection; GtkWidget *patheditor; GtkWidget *table; @@ -1246,16 +1361,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Keyboard Shortcuts Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (menus_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_menus_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Keyboard Shortcuts Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (menus_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Keyboard Shortcuts Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_menus_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /***********/ @@ -1879,16 +1996,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Input Device Settings Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gimp_devices_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_devices_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Input Device Settings Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gimp_devices_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Input Device Settings Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_devices_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /****************************/ @@ -2118,16 +2237,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Window Positions Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (session_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_session_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Window Positions Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (session_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Window Positions Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_session_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /*****************/ diff --git a/app/gui/gui.c b/app/gui/gui.c index 26966ebe0f..36d6cf3139 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -435,15 +435,15 @@ gui_exit_callback (Gimp *gimp, gimp->message_handler = GIMP_CONSOLE; if (gui_config->save_session_info) - session_save (gimp); + session_save (gimp, FALSE); color_history_save (); if (gui_config->save_accels) - menus_save (gimp); + menus_save (gimp, FALSE); if (gui_config->save_device_status) - gimp_devices_save (gimp); + gimp_devices_save (gimp, FALSE); if (TRUE /* gui_config->save_controllers */) gimp_controllers_save (gimp); @@ -473,6 +473,7 @@ gui_exit_after_callback (Gimp *gimp, g_object_unref (image_ui_manager); image_ui_manager = NULL; + session_exit (gimp); menus_exit (gimp); actions_exit (gimp); render_exit (gimp); diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 024fdd876f..1c6114d24d 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -88,6 +88,18 @@ static void prefs_input_dialog_able_callback (GtkWidget *widget, gpointer data); static void prefs_keyboard_shortcuts_dialog (GtkWidget *widget, Gimp *gimp); +static void prefs_menus_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_menus_clear_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_session_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_session_clear_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_devices_save_callback (GtkWidget *widget, + Gimp *gimp); +static void prefs_devices_clear_callback (GtkWidget *widget, + Gimp *gimp); /* private variables */ @@ -519,6 +531,108 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget, gtk_widget_show (dialog); } +static void +prefs_menus_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + menus_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_menus_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! menus_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your keyboard shortcuts will be reset to default values " + "the next time you start GIMP.")); + } +} + +static void +prefs_session_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + session_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_session_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! session_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your window setup will be reset to default values. " + "the next time you start GIMP.")); + } +} + +static void +prefs_devices_save_callback (GtkWidget *widget, + Gimp *gimp) +{ + GtkWidget *clear_button; + + gimp_devices_save (gimp, TRUE); + + clear_button = g_object_get_data (G_OBJECT (widget), "clear-button"); + + if (clear_button) + gtk_widget_set_sensitive (clear_button, TRUE); +} + +static void +prefs_devices_clear_callback (GtkWidget *widget, + Gimp *gimp) +{ + GError *error = NULL; + + if (! gimp_devices_clear (gimp, &error)) + { + g_message (error->message); + g_clear_error (&error); + } + else + { + gtk_widget_set_sensitive (widget, FALSE); + + g_message (_("Your input device settings will be reset to " + "default values the next time you start GIMP.")); + } +} + static GtkWidget * prefs_notebook_append_page (Gimp *gimp, GtkNotebook *notebook, @@ -1006,6 +1120,7 @@ prefs_dialog_new (Gimp *gimp, GtkWidget *vbox2; GtkWidget *hbox; GtkWidget *button; + GtkWidget *button2; GtkWidget *fileselection; GtkWidget *patheditor; GtkWidget *table; @@ -1246,16 +1361,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Keyboard Shortcuts Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (menus_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_menus_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Keyboard Shortcuts Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (menus_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Keyboard Shortcuts Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_menus_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /***********/ @@ -1879,16 +1996,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Input Device Settings Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gimp_devices_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_devices_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Input Device Settings Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gimp_devices_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Input Device Settings Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_devices_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /****************************/ @@ -2118,16 +2237,18 @@ prefs_dialog_new (Gimp *gimp, button = prefs_button_add (GTK_STOCK_SAVE, _("Save Window Positions Now"), GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (session_save), - gimp); + g_signal_connect (button, "clicked", + G_CALLBACK (prefs_session_save_callback), + gimp); - button = prefs_button_add (GTK_STOCK_CLEAR, - _("Clear Saved Window Positions Now"), - GTK_BOX (vbox2)); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (session_clear), - gimp); + button2 = prefs_button_add (GTK_STOCK_CLEAR, + _("Clear Saved Window Positions Now"), + GTK_BOX (vbox2)); + g_signal_connect (button2, "clicked", + G_CALLBACK (prefs_session_clear_callback), + gimp); + + g_object_set_data (G_OBJECT (button), "clear-button", button2); /*****************/ diff --git a/app/gui/session.c b/app/gui/session.c index 68ff20a1fe..85f566cc88 100644 --- a/app/gui/session.c +++ b/app/gui/session.c @@ -21,13 +21,21 @@ #include "config.h" +#include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include "libgimpbase/gimpbase.h" +#ifdef G_OS_WIN32 +#include "libgimpbase/gimpwin32-io.h" +#endif + #include "gui-types.h" #include "config/gimpconfig-error.h" @@ -56,6 +64,11 @@ enum static gchar * session_filename (Gimp *gimp); +/* private variables */ + +static gboolean sessionrc_deleted = FALSE; + + /* public functions */ void @@ -157,6 +170,12 @@ session_init (Gimp *gimp) g_free (filename); } +void +session_exit (Gimp *gimp) +{ + g_return_if_fail (GIMP_IS_GIMP (gimp)); +} + void session_restore (Gimp *gimp) { @@ -166,13 +185,17 @@ session_restore (Gimp *gimp) } void -session_save (Gimp *gimp) +session_save (Gimp *gimp, + gboolean always_save) { GimpConfigWriter *writer; gchar *filename; g_return_if_fail (GIMP_IS_GIMP (gimp)); + if (sessionrc_deleted && ! always_save) + return; + filename = session_filename (gimp); writer = @@ -203,14 +226,36 @@ session_save (Gimp *gimp) gimp_config_writer_close (writer); gimp_config_writer_finish (writer, "end of sessionrc", NULL); + + sessionrc_deleted = FALSE; } -void -session_clear (Gimp *gimp) +gboolean +session_clear (Gimp *gimp, + GError **error) { - g_return_if_fail (GIMP_IS_GIMP (gimp)); + gchar *filename; + gboolean success = TRUE; - g_print ("TODO: implement session_clear()\n"); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + filename = session_filename (gimp); + + if (unlink (filename) != 0 && errno != ENOENT) + { + g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"), + gimp_filename_to_utf8 (filename), g_strerror (errno)); + success = FALSE; + } + else + { + sessionrc_deleted = TRUE; + } + + g_free (filename); + + return success; } diff --git a/app/gui/session.h b/app/gui/session.h index d91a928aa9..46cea6fb5e 100644 --- a/app/gui/session.h +++ b/app/gui/session.h @@ -20,10 +20,15 @@ #define __SESSION_H__ -void session_init (Gimp *gimp); -void session_restore (Gimp *gimp); -void session_save (Gimp *gimp); -void session_clear (Gimp *gimp); +void session_init (Gimp *gimp); +void session_exit (Gimp *gimp); + +void session_restore (Gimp *gimp); +void session_save (Gimp *gimp, + gboolean always_save); + +gboolean session_clear (Gimp *gimp, + GError **error); #endif /* __SESSION_H__ */ diff --git a/app/menus/menus.c b/app/menus/menus.c index e8202fb2be..5ec124ede0 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -18,10 +18,19 @@ #include "config.h" +#include +#ifdef HAVE_UNISTD_H +#include +#endif + #include #include "libgimpbase/gimpbase.h" +#ifdef G_OS_WIN32 +#include "libgimpbase/gimpwin32-io.h" +#endif + #include "menus-types.h" #include "config/gimpguiconfig.h" @@ -37,6 +46,8 @@ #include "tool-options-menu.h" #include "toolbox-menu.h" +#include "gimp-intl.h" + /* local function prototypes */ @@ -45,7 +56,12 @@ static void menu_can_change_accels (GimpGuiConfig *config); /* global variables */ -GimpMenuFactory *global_menu_factory = NULL; +GimpMenuFactory * global_menu_factory = NULL; + + +/* private variables */ + +static gboolean menurc_deleted = FALSE; /* public functions */ @@ -266,7 +282,6 @@ menus_exit (Gimp *gimp) g_return_if_fail (global_menu_factory != NULL); g_return_if_fail (global_menu_factory->gimp == gimp); - g_object_unref (global_menu_factory); global_menu_factory = NULL; @@ -288,23 +303,49 @@ menus_restore (Gimp *gimp) } void -menus_save (Gimp *gimp) +menus_save (Gimp *gimp, + gboolean always_save) { gchar *filename; g_return_if_fail (GIMP_IS_GIMP (gimp)); + if (menurc_deleted && ! always_save) + return; + filename = gimp_personal_rc_file ("menurc"); gtk_accel_map_save (filename); g_free (filename); + + menurc_deleted = FALSE; } -void -menus_clear (Gimp *gimp) +gboolean +menus_clear (Gimp *gimp, + GError **error) { - g_return_if_fail (GIMP_IS_GIMP (gimp)); + gchar *filename; + gboolean success = TRUE; - g_print ("TODO: implement menus_clear()\n"); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + filename = gimp_personal_rc_file ("menurc"); + + if (unlink (filename) != 0 && errno != ENOENT) + { + g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"), + gimp_filename_to_utf8 (filename), g_strerror (errno)); + success = FALSE; + } + else + { + menurc_deleted = TRUE; + } + + g_free (filename); + + return success; } diff --git a/app/menus/menus.h b/app/menus/menus.h index af18e17b27..403f5c4392 100644 --- a/app/menus/menus.h +++ b/app/menus/menus.h @@ -23,11 +23,15 @@ extern GimpMenuFactory *global_menu_factory; -void menus_init (Gimp *gimp); -void menus_exit (Gimp *gimp); -void menus_restore (Gimp *gimp); -void menus_save (Gimp *gimp); -void menus_clear (Gimp *gimp); +void menus_init (Gimp *gimp); +void menus_exit (Gimp *gimp); + +void menus_restore (Gimp *gimp); +void menus_save (Gimp *gimp, + gboolean always_save); + +gboolean menus_clear (Gimp *gimp, + GError **error); #endif /* __MENUS_H__ */ diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c index 14b1de5ca9..f4a2cacea7 100644 --- a/app/widgets/gimpdevices.c +++ b/app/widgets/gimpdevices.c @@ -18,11 +18,20 @@ #include "config.h" +#include +#ifdef HAVE_UNISTD_H +#include +#endif + #include #include "libgimpcolor/gimpcolor.h" #include "libgimpbase/gimpbase.h" +#ifdef G_OS_WIN32 +#include "libgimpbase/gimpwin32-io.h" +#endif + #include "widgets-types.h" #include "core/gimp.h" @@ -38,6 +47,8 @@ #include "gimpdeviceinfo.h" #include "gimpdevices.h" +#include "gimp-intl.h" + #define GIMP_DEVICE_MANAGER_DATA_KEY "gimp-device-manager" @@ -49,6 +60,7 @@ struct _GimpDeviceManager GimpContainer *device_info_list; GdkDevice *current_device; GimpDeviceChangeNotify change_notify; + gboolean devicerc_deleted; }; @@ -151,7 +163,8 @@ gimp_devices_restore (Gimp *gimp) } void -gimp_devices_save (Gimp *gimp) +gimp_devices_save (Gimp *gimp, + gboolean always_save) { GimpDeviceManager *manager; gchar *filename; @@ -163,6 +176,9 @@ gimp_devices_save (Gimp *gimp) g_return_if_fail (manager != NULL); + if (manager->devicerc_deleted && ! always_save) + return; + filename = gimp_personal_rc_file ("devicerc"); if (! gimp_config_serialize_to_file (GIMP_CONFIG (manager->device_info_list), @@ -177,14 +193,40 @@ gimp_devices_save (Gimp *gimp) } g_free (filename); + + manager->devicerc_deleted = FALSE; } -void -gimp_devices_clear (Gimp *gimp) +gboolean +gimp_devices_clear (Gimp *gimp, + GError **error) { - g_return_if_fail (GIMP_IS_GIMP (gimp)); + GimpDeviceManager *manager; + gchar *filename; + gboolean success = TRUE; - g_print ("TODO: implement gimp_devices_clear()\n"); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE); + + manager = gimp_device_manager_get (gimp); + + g_return_val_if_fail (manager != NULL, FALSE); + + filename = gimp_personal_rc_file ("devicerc"); + + if (unlink (filename) != 0 && errno != ENOENT) + { + g_set_error (error, 0, 0, _("Deleting \"%s\" failed: %s"), + gimp_filename_to_utf8 (filename), g_strerror (errno)); + success = FALSE; + } + else + { + manager->devicerc_deleted = TRUE; + } + + g_free (filename); + + return success; } GdkDevice * diff --git a/app/widgets/gimpdevices.h b/app/widgets/gimpdevices.h index bdc8353ef7..c33e682ffb 100644 --- a/app/widgets/gimpdevices.h +++ b/app/widgets/gimpdevices.h @@ -28,8 +28,11 @@ void gimp_devices_init (Gimp *gimp, void gimp_devices_exit (Gimp *gimp); void gimp_devices_restore (Gimp *gimp); -void gimp_devices_save (Gimp *gimp); -void gimp_devices_clear (Gimp *gimp); +void gimp_devices_save (Gimp *gimp, + gboolean always_save); + +gboolean gimp_devices_clear (Gimp *gimp, + GError **error); GdkDevice * gimp_devices_get_current (Gimp *gimp); diff --git a/app/widgets/gimpdevicestatus.c b/app/widgets/gimpdevicestatus.c index 4ba02259ef..13298ca383 100644 --- a/app/widgets/gimpdevicestatus.c +++ b/app/widgets/gimpdevicestatus.c @@ -405,7 +405,7 @@ static void gimp_device_status_save_clicked (GtkWidget *button, GimpDeviceStatus *status) { - gimp_devices_save (status->gimp); + gimp_devices_save (status->gimp, TRUE); } static void