From ed46e154e2e2a4083baa2f13009e204f07f15a0c Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Fri, 2 Mar 2018 10:20:50 +0100 Subject: rename mate_dialog_add_button to eel_dialog_add_button --- eel/eel-stock-dialogs.c | 24 ++++++++++---------- eel/eel-stock-dialogs.h | 4 ++++ libcaja-private/caja-autorun.c | 35 ++++++++--------------------- libcaja-private/caja-file-conflict-dialog.c | 27 +++++----------------- libcaja-private/caja-file-operations.c | 26 ++++----------------- 5 files changed, 34 insertions(+), 82 deletions(-) diff --git a/eel/eel-stock-dialogs.c b/eel/eel-stock-dialogs.c index 97597e09..5cc9487e 100644 --- a/eel/eel-stock-dialogs.c +++ b/eel/eel-stock-dialogs.c @@ -191,11 +191,11 @@ trash_dialog_response_callback (GtkDialog *dialog, gtk_widget_destroy (GTK_WIDGET (dialog)); } -static void -mate_dialog_add_button (GtkDialog *dialog, - const gchar *button_text, - const gchar *icon_name, - gint response_id) +void +eel_dialog_add_button (GtkDialog *dialog, + const gchar *button_text, + const gchar *icon_name, + gint response_id) { GtkWidget *button; @@ -232,9 +232,9 @@ timed_wait_callback (gpointer callback_data) NULL); if (g_strcmp0 (button, "process-stop") == 0) - mate_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button, GTK_RESPONSE_OK); + eel_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button, GTK_RESPONSE_OK); else - mate_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button, GTK_RESPONSE_OK); + eel_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button, GTK_RESPONSE_OK); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); @@ -387,9 +387,9 @@ eel_run_simple_dialog (GtkWidget *parent, gboolean ignore_close_box, } if (g_strcmp0 (button_title, "process-stop") == 0) - mate_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button_title, response_id); + eel_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button_title, response_id); else - mate_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button_title, response_id); + eel_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button_title, response_id); gtk_dialog_set_default_response (GTK_DIALOG (dialog), response_id); response_id++; @@ -588,14 +588,14 @@ eel_create_question_dialog (const char *primary_text, parent); if (g_strcmp0 (answer_1, "process-stop") == 0) - mate_dialog_add_button (dialog, _("_Cancel"), answer_1, response_1); + eel_dialog_add_button (dialog, _("_Cancel"), answer_1, response_1); else gtk_dialog_add_button (dialog, answer_1, response_1); if (g_strcmp0 (answer_2, "gtk-ok") == 0) - mate_dialog_add_button (dialog, _("_OK"), answer_2, response_2); + eel_dialog_add_button (dialog, _("_OK"), answer_2, response_2); else if (g_strcmp0 (answer_2, "edit-clear") == 0) - mate_dialog_add_button (dialog, _("_Clear"), answer_2, response_2); + eel_dialog_add_button (dialog, _("_Clear"), answer_2, response_2); else gtk_dialog_add_button (dialog, answer_2, response_2); diff --git a/eel/eel-stock-dialogs.h b/eel/eel-stock-dialogs.h index 8c138a14..d61c1bb1 100644 --- a/eel/eel-stock-dialogs.h +++ b/eel/eel-stock-dialogs.h @@ -49,6 +49,10 @@ int eel_run_simple_dialog (GtkWidget *parent, const char *primary_text, const char *secondary_text, ...); +void eel_dialog_add_button (GtkDialog *dialog, + const gchar *button_text, + const gchar *icon_name, + gint response_id); /* Variations on mate stock dialogs; these do line wrapping, we don't * bother with non-parented versions, we allow setting the title, diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c index 110b9fe7..0c08004e 100644 --- a/libcaja-private/caja-autorun.c +++ b/libcaja-private/caja-autorun.c @@ -33,6 +33,7 @@ #include #include +#include #include "caja-icon-info.h" #include "caja-global-preferences.h" @@ -915,24 +916,6 @@ combo_box_enter_ok (GtkWidget *togglebutton, GdkEventKey *event, GtkDialog *dial return FALSE; } -static void -mate_dialog_add_button (GtkDialog *dialog, - const gchar *button_text, - const gchar *icon_name, - gint response_id) -{ - GtkWidget *button; - - button = gtk_button_new_with_mnemonic (button_text); - gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON)); - - gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button"); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_show (button); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id); -} - /* returns TRUE if a folder window should be opened */ static gboolean do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAutorunOpenWindow open_window_func, gpointer user_data) @@ -1144,15 +1127,15 @@ show_dialog: data); gtk_box_pack_start (GTK_BOX (vbox), always_check_button, TRUE, TRUE, 0); - mate_dialog_add_button (GTK_DIALOG (dialog), - _("_Cancel"), - "process-stop", - GTK_RESPONSE_CANCEL); + eel_dialog_add_button (GTK_DIALOG (dialog), + _("_Cancel"), + "process-stop", + GTK_RESPONSE_CANCEL); - mate_dialog_add_button (GTK_DIALOG (dialog), - _("_OK"), - "gtk-ok", - GTK_RESPONSE_OK); + eel_dialog_add_button (GTK_DIALOG (dialog), + _("_OK"), + "gtk-ok", + GTK_RESPONSE_OK); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c index db9369be..2b9a7955 100644 --- a/libcaja-private/caja-file-conflict-dialog.c +++ b/libcaja-private/caja-file-conflict-dialog.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "caja-file.h" #include "caja-icon-info.h" @@ -554,24 +555,6 @@ diff_button_clicked_cb (GtkButton *w, } } -static void -mate_dialog_add_button (GtkDialog *dialog, - const gchar *button_text, - const gchar *icon_name, - gint response_id) -{ - GtkWidget *button; - - button = gtk_button_new_with_mnemonic (button_text); - gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON)); - - gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button"); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_show (button); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id); -} - static void caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd) { @@ -668,10 +651,10 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd) G_CALLBACK (checkbox_toggled_cb), dialog); /* Add buttons */ - mate_dialog_add_button (dialog, - _("_Cancel"), - "process-stop", - GTK_RESPONSE_CANCEL); + eel_dialog_add_button (dialog, + _("_Cancel"), + "process-stop", + GTK_RESPONSE_CANCEL); gtk_dialog_add_button (dialog, _("_Skip"), diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index ca3172b6..fd9fe9cb 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -1085,24 +1085,6 @@ typedef struct { int result; } RunSimpleDialogData; -static void -mate_dialog_add_button (GtkDialog *dialog, - const gchar *button_text, - const gchar *icon_name, - gint response_id) -{ - GtkWidget *button; - - button = gtk_button_new_with_mnemonic (button_text); - gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON)); - - gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button"); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_show (button); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id); -} - static gboolean do_run_simple_dialog (gpointer _data) { @@ -1133,9 +1115,9 @@ do_run_simple_dialog (gpointer _data) } if (g_strcmp0 (button_title, CANCEL) == 0) - mate_dialog_add_button (GTK_DIALOG (dialog), button_title, "process-stop", response_id); + eel_dialog_add_button (GTK_DIALOG (dialog), button_title, "process-stop", response_id); else if (g_strcmp0 (button_title, DELETE) == 0) - mate_dialog_add_button (GTK_DIALOG (dialog), button_title, "edit-delete", response_id); + eel_dialog_add_button (GTK_DIALOG (dialog), button_title, "edit-delete", response_id); else gtk_dialog_add_button (GTK_DIALOG (dialog), button_title, response_id); @@ -2344,8 +2326,8 @@ prompt_empty_trash (GtkWindow *parent_window) gtk_dialog_add_button (GTK_DIALOG (dialog), _("Do _not Empty Trash"), GTK_RESPONSE_REJECT); - mate_dialog_add_button (GTK_DIALOG (dialog), - CANCEL, "process-stop", GTK_RESPONSE_CANCEL); + eel_dialog_add_button (GTK_DIALOG (dialog), + CANCEL, "process-stop", GTK_RESPONSE_CANCEL); gtk_dialog_add_button (GTK_DIALOG (dialog), _("Empty _Trash"), GTK_RESPONSE_ACCEPT); -- cgit v1.2.1