diff --git a/plugins/filebrowser/xed-file-browser-plugin.c b/plugins/filebrowser/xed-file-browser-plugin.c index b292df8..6124c6b 100644 --- a/plugins/filebrowser/xed-file-browser-plugin.c +++ b/plugins/filebrowser/xed-file-browser-plugin.c @@ -977,8 +977,7 @@ on_confirm_no_trash_cb (XedFileBrowserWidget *widget, GTK_MESSAGE_QUESTION, message, secondary, - GTK_STOCK_DELETE, - NULL); + _("_Delete")); g_free (secondary); return result; @@ -1013,8 +1012,7 @@ on_confirm_delete_cb (XedFileBrowserWidget *widget, GTK_MESSAGE_QUESTION, message, secondary, - GTK_STOCK_DELETE, - NULL); + _("_Delete")); g_free (message); diff --git a/plugins/filebrowser/xed-file-browser-utils.c b/plugins/filebrowser/xed-file-browser-utils.c index aae2fd9..9c55f6b 100644 --- a/plugins/filebrowser/xed-file-browser-utils.c +++ b/plugins/filebrowser/xed-file-browser-utils.c @@ -19,9 +19,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "xed-file-browser-utils.h" +#ifdef HAVE_CONFIG_H +#include +#endif + +#include #include +#include "xed-file-browser-utils.h" + static GdkPixbuf * process_icon_pixbuf (GdkPixbuf *pixbuf, gchar const *name, @@ -130,12 +136,10 @@ xed_file_browser_utils_confirmation_dialog (XedWindow *window, GtkMessageType type, gchar const *message, gchar const *secondary, - gchar const *button_stock, gchar const *button_label) { GtkWidget *dlg; gint ret; - GtkWidget *button; dlg = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL | @@ -148,25 +152,12 @@ xed_file_browser_utils_confirmation_dialog (XedWindow *window, gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), "%s", secondary); } - /* Add a cancel button */ - button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - gtk_widget_show (button); + gtk_dialog_add_buttons (GTK_DIALOG (dlg), + _("_Cancel"), GTK_RESPONSE_CANCEL, + button_label, GTK_RESPONSE_OK, + NULL); - gtk_widget_set_can_default (button, TRUE); - gtk_dialog_add_action_widget (GTK_DIALOG (dlg), button, GTK_RESPONSE_CANCEL); - - /* Add custom button */ - button = gtk_button_new_from_stock (button_stock); - - if (button_label) - { - gtk_button_set_use_stock (GTK_BUTTON (button), FALSE); - gtk_button_set_label (GTK_BUTTON (button), button_label); - } - - gtk_widget_show (button); - gtk_widget_set_can_default (button, TRUE); - gtk_dialog_add_action_widget (GTK_DIALOG (dlg), button, GTK_RESPONSE_OK); + gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_CANCEL); ret = gtk_dialog_run (GTK_DIALOG (dlg)); gtk_widget_destroy (dlg); diff --git a/plugins/filebrowser/xed-file-browser-utils.h b/plugins/filebrowser/xed-file-browser-utils.h index bd17b84..abbadd5 100644 --- a/plugins/filebrowser/xed-file-browser-utils.h +++ b/plugins/filebrowser/xed-file-browser-utils.h @@ -4,22 +4,21 @@ #include #include -GdkPixbuf *xed_file_browser_utils_pixbuf_from_theme (gchar const *name, - GtkIconSize size); +GdkPixbuf *xed_file_browser_utils_pixbuf_from_theme (gchar const *name, + GtkIconSize size); -GdkPixbuf *xed_file_browser_utils_pixbuf_from_icon (GIcon * icon, - GtkIconSize size); -GdkPixbuf *xed_file_browser_utils_pixbuf_from_file (GFile * file, - GtkIconSize size); +GdkPixbuf *xed_file_browser_utils_pixbuf_from_icon (GIcon *icon, + GtkIconSize size); +GdkPixbuf *xed_file_browser_utils_pixbuf_from_file (GFile *file, + GtkIconSize size); -gchar * xed_file_browser_utils_file_basename (GFile * file); +gchar * xed_file_browser_utils_file_basename (GFile *file); -gboolean xed_file_browser_utils_confirmation_dialog (XedWindow * window, - GtkMessageType type, - gchar const *message, - gchar const *secondary, - gchar const * button_stock, - gchar const * button_label); +gboolean xed_file_browser_utils_confirmation_dialog (XedWindow *window, + GtkMessageType type, + gchar const *message, + gchar const *secondary, + gchar const *button_label); #endif /* __XED_FILE_BROWSER_UTILS_H__ */ diff --git a/plugins/filebrowser/xed-file-browser-widget.c b/plugins/filebrowser/xed-file-browser-widget.c index 745a950..bed7544 100644 --- a/plugins/filebrowser/xed-file-browser-widget.c +++ b/plugins/filebrowser/xed-file-browser-widget.c @@ -559,11 +559,10 @@ get_from_bookmark_file (XedFileBrowserWidget *obj, item = (NameIcon *)data; *name = g_strdup (item->name); - *icon = item->icon; - if (item->icon != NULL) + if (icon != NULL && item->icon != NULL) { - g_object_ref (item->icon); + *icon = g_object_ref (item->icon); } return TRUE;