aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPiers Cornwell <piers@gnome.org>2004-05-03 03:31:30 +0800
committerPiers Cornwell <piers@src.gnome.org>2004-05-03 03:31:30 +0800
commit7091b0760a43881a451adc5195bf1bc03ae70163 (patch)
treec8a6cea8e90a04565ba6c527e8fa964c6e682476 /lib
parent7093f6ad148d62a9ddc77f8080cf9822d5d24f1f (diff)
downloadgsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar.gz
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar.bz2
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar.lz
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar.xz
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.tar.zst
gsoc2013-epiphany-7091b0760a43881a451adc5195bf1bc03ae70163.zip
Make Escape cancel overwrite dialog.
2004-05-02 Piers Cornwell <piers@gnome.org> * lib/ephy-gui.c: (ephy_gui_confirm_overwrite_file): Make Escape cancel overwrite dialog.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 7d3000008..a20dbcd46 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -79,7 +79,7 @@ gboolean
ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
{
char *primary_text, *question, *converted;
- GtkWidget *dialog, *button, *hbox, *label;
+ GtkWidget *dialog, *hbox, *label;
GtkWidget *image;
gboolean res;
@@ -99,38 +99,34 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
question = g_strdup_printf ("<b><big>%s</big></b>\n\n%s", primary_text,
_("If you choose to overwrite this file, "
"the contents will be lost."));
-
+
dialog = gtk_dialog_new_with_buttons (_("Overwrite File"),
parent ? GTK_WINDOW (parent) : NULL,
- GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
- NULL);
+ GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL,
+ _("_Overwrite"), GTK_RESPONSE_ACCEPT,
+ NULL);
hbox = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- hbox, TRUE, TRUE, 12);
- image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
- GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 12);
+ image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 0);
+
label = gtk_label_new (NULL);
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
gtk_label_set_markup (GTK_LABEL (label), question);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_widget_show_all (hbox);
+
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 6);
- button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_REJECT);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_REJECT);
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_Overwrite"),
- GTK_RESPONSE_ACCEPT);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
res = (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) ? TRUE : FALSE;
-
+
gtk_widget_destroy (dialog);
-
- g_free (primary_text);
+
+ g_free (primary_text);
g_free (question);
g_free (converted);