Skip to content

Commit ed46e15

Browse files
committed
rename mate_dialog_add_button to eel_dialog_add_button
1 parent 4901253 commit ed46e15

File tree

5 files changed

+34
-82
lines changed

5 files changed

+34
-82
lines changed

eel/eel-stock-dialogs.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ trash_dialog_response_callback (GtkDialog *dialog,
191191
gtk_widget_destroy (GTK_WIDGET (dialog));
192192
}
193193

194-
static void
195-
mate_dialog_add_button (GtkDialog *dialog,
196-
const gchar *button_text,
197-
const gchar *icon_name,
198-
gint response_id)
194+
void
195+
eel_dialog_add_button (GtkDialog *dialog,
196+
const gchar *button_text,
197+
const gchar *icon_name,
198+
gint response_id)
199199
{
200200
GtkWidget *button;
201201

@@ -232,9 +232,9 @@ timed_wait_callback (gpointer callback_data)
232232
NULL);
233233

234234
if (g_strcmp0 (button, "process-stop") == 0)
235-
mate_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button, GTK_RESPONSE_OK);
235+
eel_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button, GTK_RESPONSE_OK);
236236
else
237-
mate_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button, GTK_RESPONSE_OK);
237+
eel_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button, GTK_RESPONSE_OK);
238238

239239
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
240240

@@ -387,9 +387,9 @@ eel_run_simple_dialog (GtkWidget *parent, gboolean ignore_close_box,
387387
}
388388

389389
if (g_strcmp0 (button_title, "process-stop") == 0)
390-
mate_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button_title, response_id);
390+
eel_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), button_title, response_id);
391391
else
392-
mate_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button_title, response_id);
392+
eel_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), button_title, response_id);
393393

394394
gtk_dialog_set_default_response (GTK_DIALOG (dialog), response_id);
395395
response_id++;
@@ -588,14 +588,14 @@ eel_create_question_dialog (const char *primary_text,
588588
parent);
589589

590590
if (g_strcmp0 (answer_1, "process-stop") == 0)
591-
mate_dialog_add_button (dialog, _("_Cancel"), answer_1, response_1);
591+
eel_dialog_add_button (dialog, _("_Cancel"), answer_1, response_1);
592592
else
593593
gtk_dialog_add_button (dialog, answer_1, response_1);
594594

595595
if (g_strcmp0 (answer_2, "gtk-ok") == 0)
596-
mate_dialog_add_button (dialog, _("_OK"), answer_2, response_2);
596+
eel_dialog_add_button (dialog, _("_OK"), answer_2, response_2);
597597
else if (g_strcmp0 (answer_2, "edit-clear") == 0)
598-
mate_dialog_add_button (dialog, _("_Clear"), answer_2, response_2);
598+
eel_dialog_add_button (dialog, _("_Clear"), answer_2, response_2);
599599
else
600600
gtk_dialog_add_button (dialog, answer_2, response_2);
601601

eel/eel-stock-dialogs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ int eel_run_simple_dialog (GtkWidget *parent,
4949
const char *primary_text,
5050
const char *secondary_text,
5151
...);
52+
void eel_dialog_add_button (GtkDialog *dialog,
53+
const gchar *button_text,
54+
const gchar *icon_name,
55+
gint response_id);
5256

5357
/* Variations on mate stock dialogs; these do line wrapping, we don't
5458
* bother with non-parented versions, we allow setting the title,

libcaja-private/caja-autorun.c

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <gdk/gdkkeysyms.h>
3434

3535
#include <eel/eel-glib-extensions.h>
36+
#include <eel/eel-stock-dialogs.h>
3637

3738
#include "caja-icon-info.h"
3839
#include "caja-global-preferences.h"
@@ -915,24 +916,6 @@ combo_box_enter_ok (GtkWidget *togglebutton, GdkEventKey *event, GtkDialog *dial
915916
return FALSE;
916917
}
917918

918-
static void
919-
mate_dialog_add_button (GtkDialog *dialog,
920-
const gchar *button_text,
921-
const gchar *icon_name,
922-
gint response_id)
923-
{
924-
GtkWidget *button;
925-
926-
button = gtk_button_new_with_mnemonic (button_text);
927-
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
928-
929-
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
930-
gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
931-
gtk_widget_set_can_default (button, TRUE);
932-
gtk_widget_show (button);
933-
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
934-
}
935-
936919
/* returns TRUE if a folder window should be opened */
937920
static gboolean
938921
do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAutorunOpenWindow open_window_func, gpointer user_data)
@@ -1144,15 +1127,15 @@ do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAuto
11441127
data);
11451128
gtk_box_pack_start (GTK_BOX (vbox), always_check_button, TRUE, TRUE, 0);
11461129

1147-
mate_dialog_add_button (GTK_DIALOG (dialog),
1148-
_("_Cancel"),
1149-
"process-stop",
1150-
GTK_RESPONSE_CANCEL);
1130+
eel_dialog_add_button (GTK_DIALOG (dialog),
1131+
_("_Cancel"),
1132+
"process-stop",
1133+
GTK_RESPONSE_CANCEL);
11511134

1152-
mate_dialog_add_button (GTK_DIALOG (dialog),
1153-
_("_OK"),
1154-
"gtk-ok",
1155-
GTK_RESPONSE_OK);
1135+
eel_dialog_add_button (GTK_DIALOG (dialog),
1136+
_("_OK"),
1137+
"gtk-ok",
1138+
GTK_RESPONSE_OK);
11561139

11571140
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
11581141

libcaja-private/caja-file-conflict-dialog.c

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <glib/gi18n.h>
3333
#include <pango/pango.h>
3434
#include <eel/eel-vfs-extensions.h>
35+
#include <eel/eel-stock-dialogs.h>
3536

3637
#include "caja-file.h"
3738
#include "caja-icon-info.h"
@@ -554,24 +555,6 @@ diff_button_clicked_cb (GtkButton *w,
554555
}
555556
}
556557

557-
static void
558-
mate_dialog_add_button (GtkDialog *dialog,
559-
const gchar *button_text,
560-
const gchar *icon_name,
561-
gint response_id)
562-
{
563-
GtkWidget *button;
564-
565-
button = gtk_button_new_with_mnemonic (button_text);
566-
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
567-
568-
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
569-
gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
570-
gtk_widget_set_can_default (button, TRUE);
571-
gtk_widget_show (button);
572-
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
573-
}
574-
575558
static void
576559
caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
577560
{
@@ -668,10 +651,10 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
668651
G_CALLBACK (checkbox_toggled_cb), dialog);
669652

670653
/* Add buttons */
671-
mate_dialog_add_button (dialog,
672-
_("_Cancel"),
673-
"process-stop",
674-
GTK_RESPONSE_CANCEL);
654+
eel_dialog_add_button (dialog,
655+
_("_Cancel"),
656+
"process-stop",
657+
GTK_RESPONSE_CANCEL);
675658

676659
gtk_dialog_add_button (dialog,
677660
_("_Skip"),

libcaja-private/caja-file-operations.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,24 +1085,6 @@ typedef struct {
10851085
int result;
10861086
} RunSimpleDialogData;
10871087

1088-
static void
1089-
mate_dialog_add_button (GtkDialog *dialog,
1090-
const gchar *button_text,
1091-
const gchar *icon_name,
1092-
gint response_id)
1093-
{
1094-
GtkWidget *button;
1095-
1096-
button = gtk_button_new_with_mnemonic (button_text);
1097-
gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
1098-
1099-
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
1100-
gtk_style_context_add_class (gtk_widget_get_style_context (button), "text-button");
1101-
gtk_widget_set_can_default (button, TRUE);
1102-
gtk_widget_show (button);
1103-
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);
1104-
}
1105-
11061088
static gboolean
11071089
do_run_simple_dialog (gpointer _data)
11081090
{
@@ -1133,9 +1115,9 @@ do_run_simple_dialog (gpointer _data)
11331115
}
11341116

11351117
if (g_strcmp0 (button_title, CANCEL) == 0)
1136-
mate_dialog_add_button (GTK_DIALOG (dialog), button_title, "process-stop", response_id);
1118+
eel_dialog_add_button (GTK_DIALOG (dialog), button_title, "process-stop", response_id);
11371119
else if (g_strcmp0 (button_title, DELETE) == 0)
1138-
mate_dialog_add_button (GTK_DIALOG (dialog), button_title, "edit-delete", response_id);
1120+
eel_dialog_add_button (GTK_DIALOG (dialog), button_title, "edit-delete", response_id);
11391121
else
11401122
gtk_dialog_add_button (GTK_DIALOG (dialog), button_title, response_id);
11411123

@@ -2344,8 +2326,8 @@ prompt_empty_trash (GtkWindow *parent_window)
23442326
gtk_dialog_add_button (GTK_DIALOG (dialog),
23452327
_("Do _not Empty Trash"), GTK_RESPONSE_REJECT);
23462328

2347-
mate_dialog_add_button (GTK_DIALOG (dialog),
2348-
CANCEL, "process-stop", GTK_RESPONSE_CANCEL);
2329+
eel_dialog_add_button (GTK_DIALOG (dialog),
2330+
CANCEL, "process-stop", GTK_RESPONSE_CANCEL);
23492331

23502332
gtk_dialog_add_button (GTK_DIALOG (dialog),
23512333
_("Empty _Trash"), GTK_RESPONSE_ACCEPT);

0 commit comments

Comments
 (0)