Skip to content
Permalink
Browse files

avoid gtk_dialog_new_with_buttons with stock ids

  • Loading branch information...
sc0w committed Mar 16, 2018
1 parent e0c69f8 commit 4fb359018441a9a80984a7a94be1a939efc51bde
@@ -281,16 +281,24 @@ create_rename_emblem_dialog (CajaEmblemSidebar *emblem_sidebar,
image = gtk_image_new_from_pixbuf (pixbuf);
entry = gtk_entry_new ();

dialog = gtk_dialog_new_with_buttons (_("Rename Emblem"),
NULL,
0,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-ok",
GTK_RESPONSE_OK,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Rename Emblem"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), NULL);

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

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

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

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
@@ -534,16 +542,24 @@ create_add_emblems_dialog (CajaEmblemSidebar *emblem_sidebar,

first_entry = NULL;

dialog = gtk_dialog_new_with_buttons (_("Add Emblems..."),
NULL,
0,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-ok",
GTK_RESPONSE_OK,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Add Emblems..."));
gtk_window_set_transient_for (GTK_WINDOW (dialog), NULL);

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

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

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

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
@@ -1103,11 +1103,19 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser)
GtkWidget *label;
GtkWidget *grid = gtk_grid_new ();

dialog = gtk_dialog_new_with_buttons (_("Create a New Emblem"),
GTK_WINDOW (property_browser), 0,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Create a New Emblem"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (property_browser));

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

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

/* install the grid in the dialog */
gtk_container_set_border_width (GTK_CONTAINER (grid), 5);
@@ -1175,11 +1183,19 @@ caja_color_selection_dialog_new (CajaPropertyBrowser *property_browser)

GtkWidget *grid = gtk_grid_new ();

dialog = gtk_dialog_new_with_buttons (_("Create a New Color:"),
GTK_WINDOW (property_browser), 0,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Create a New Color:"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (property_browser));

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

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

/* install the grid in the dialog */
gtk_widget_show (grid);
@@ -710,11 +710,16 @@ type_combo_changed (GtkComboBox *combo_box, CajaQueryEditorRow *row)


toplevel = gtk_widget_get_toplevel (GTK_WIDGET (combo_box));
dialog = gtk_dialog_new_with_buttons (_("Select type"),
GTK_WINDOW (toplevel),
0,
"gtk-ok", GTK_RESPONSE_OK,
NULL);

dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Select type"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel));

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 600);

scrolled = gtk_scrolled_window_new (NULL, NULL);
@@ -1194,16 +1194,26 @@ select_pattern (FMDirectoryView *view)
GtkWidget *entry;
char *example_pattern;

dialog = gtk_dialog_new_with_buttons (_("Select Items Matching"),
fm_directory_view_get_containing_window (view),
GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-help",
GTK_RESPONSE_HELP,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
"gtk-ok",
GTK_RESPONSE_OK,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Select Items Matching"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), fm_directory_view_get_containing_window (view));
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);

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

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

eel_dialog_add_button (GTK_DIALOG (dialog),
_("_OK"),
"gtk-ok",
GTK_RESPONSE_OK);

gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_OK);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
@@ -1332,11 +1342,14 @@ action_save_search_as_callback (GtkAction *action,
CAJA_IS_SEARCH_DIRECTORY (directory_view->details->model)) {
search = CAJA_SEARCH_DIRECTORY (directory_view->details->model);

dialog = gtk_dialog_new_with_buttons (_("Save Search as"),
fm_directory_view_get_containing_window (directory_view),
0,
"gtk-cancel", GTK_RESPONSE_CANCEL,
NULL);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Save Search as"));
gtk_window_set_transient_for (GTK_WINDOW (dialog), fm_directory_view_get_containing_window (directory_view));

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

save_button = eel_dialog_add_button (GTK_DIALOG (dialog), _("_Save"),
"document-save", GTK_RESPONSE_OK);
@@ -6984,12 +6997,19 @@ action_connect_to_server_link_callback (GtkAction *action,

if (uri != NULL) {
title = g_strdup_printf (_("Connect to Server %s"), name);
dialog = gtk_dialog_new_with_buttons (title,
fm_directory_view_get_containing_window (view),
0,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("_Connect"), GTK_RESPONSE_OK,
NULL);

dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), title);
gtk_window_set_transient_for (GTK_WINDOW (dialog), fm_directory_view_get_containing_window (view));

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

gtk_dialog_add_button (GTK_DIALOG (dialog),
_("_Connect"),
GTK_RESPONSE_OK);

g_object_set_data_full (G_OBJECT (dialog), "link-uri", g_strdup (uri), g_free);
g_object_set_data_full (G_OBJECT (dialog), "link-icon", g_strdup (icon_name), g_free);
@@ -36,6 +36,7 @@
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-stock-dialogs.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
@@ -2531,11 +2532,16 @@ create_column_editor (FMListView *view)
str = g_strdup_printf (_("%s Visible Columns"), name);
g_free (name);

window = gtk_dialog_new_with_buttons (str,
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))),
GTK_DIALOG_DESTROY_WITH_PARENT,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
window = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (window), str);
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))));
gtk_window_set_destroy_with_parent (GTK_WINDOW (window), TRUE);

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

g_free (str);
g_signal_connect (window, "response",
G_CALLBACK (column_editor_response_callback), NULL);

0 comments on commit 4fb3590

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