Skip to content
Permalink
Browse files

avoid gtk_dialog_add_buttons with stock ids

  • Loading branch information...
sc0w committed Mar 10, 2018
1 parent dfb6585 commit 68fb5e488ecf7c80622af3d00edab5348e70917c
@@ -191,7 +191,7 @@ trash_dialog_response_callback (GtkDialog *dialog,
gtk_widget_destroy (GTK_WIDGET (dialog));
}

void
GtkWidget*
eel_dialog_add_button (GtkDialog *dialog,
const gchar *button_text,
const gchar *icon_name,
@@ -207,6 +207,8 @@ eel_dialog_add_button (GtkDialog *dialog,
gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id);

return button;
}

static gboolean
@@ -49,7 +49,7 @@ int eel_run_simple_dialog (GtkWidget *parent,
const char *primary_text,
const char *secondary_text,
...);
void eel_dialog_add_button (GtkDialog *dialog,
GtkWidget* eel_dialog_add_button (GtkDialog *dialog,
const gchar *button_text,
const gchar *icon_name,
gint response_id);
@@ -814,7 +814,12 @@ get_executable_text_file_action (GtkWindow *parent_window, CajaFile *file)
_("Run in _Terminal"), RESPONSE_RUN_IN_TERMINAL,
_("_Display"), RESPONSE_DISPLAY,
parent_window);
gtk_dialog_add_button (dialog, "gtk-cancel", GTK_RESPONSE_CANCEL);

eel_dialog_add_button (dialog,
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);

gtk_dialog_add_button (dialog, _("_Run"), RESPONSE_RUN);
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CANCEL);
gtk_widget_show (GTK_WIDGET (dialog));
@@ -1361,7 +1366,10 @@ show_unhandled_type_error (ActivateParametersInstall *parameters)

gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Select Application"), GTK_RESPONSE_ACCEPT);

gtk_dialog_add_button (GTK_DIALOG (dialog), "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);

@@ -1713,8 +1721,12 @@ activate_desktop_file (ActivateParameters *parameters,
gtk_dialog_add_button (GTK_DIALOG (dialog),
_("Mark as _Trusted"), RESPONSE_MARK_TRUSTED);
}
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel", GTK_RESPONSE_CANCEL);

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);

gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);

g_signal_connect (dialog, "response",
@@ -931,15 +931,18 @@ caja_open_with_dialog_init (CajaOpenWithDialog *dialog)
gtk_widget_show (GTK_WIDGET (dialog->details->checkbox));
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->checkbox, FALSE, FALSE, 0);

gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-remove",
eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Remove"),
"list-remove",
RESPONSE_REMOVE);

gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
RESPONSE_REMOVE,
FALSE);

gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel",
eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);


@@ -1113,14 +1113,16 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
G_BINDING_DEFAULT |
G_BINDING_SYNC_CREATE);



gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-help",
eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Help"),
"help-browser",
GTK_RESPONSE_HELP);
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel",

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);

connect_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
_("C_onnect"),
RESPONSE_CONNECT);
@@ -185,15 +185,21 @@ caja_location_dialog_init (CajaLocationDialog *dialog)
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
box, FALSE, TRUE, 0);

gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-help",
eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Help"),
"help-browser",
GTK_RESPONSE_HELP);
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel",

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop",
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-open",

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Open"),
"document-open",
RESPONSE_OPEN);

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
RESPONSE_OPEN);

@@ -1337,8 +1337,10 @@ action_save_search_as_callback (GtkAction *action,
0,
"gtk-cancel", GTK_RESPONSE_CANCEL,
NULL);
save_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-save", GTK_RESPONSE_OK);

save_button = eel_dialog_add_button (GTK_DIALOG (dialog), _("_Save"),
"document-save", GTK_RESPONSE_OK);

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
@@ -10269,8 +10271,11 @@ ask_link_action (FMDirectoryView *view)

gtk_dialog_add_button (GTK_DIALOG (dialog),
_("Make a _Link"), 0);
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel", 1);

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_Cancel"),
"process-stop", 1);

gtk_dialog_add_button (GTK_DIALOG (dialog),
_("_Download"), 2);

@@ -5168,10 +5168,15 @@ create_properties_window (StartupData *startup_data)
/* append pages from available views */
append_extension_pages (window);

gtk_dialog_add_buttons (GTK_DIALOG (window),
"gtk-help", GTK_RESPONSE_HELP,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
eel_dialog_add_button (GTK_DIALOG (window),
_("_Help"),
"help-browser",
GTK_RESPONSE_HELP);

eel_dialog_add_button (GTK_DIALOG (window),
_("_Close"),
"window-close",
GTK_RESPONSE_CLOSE);

/* FIXME - HIGificiation, should be done inside GTK+ */
gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (window))), 12);

0 comments on commit 68fb5e4

Please sign in to comment.
You can’t perform that action at this time.