aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-27 04:02:22 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-27 04:02:22 +0800
commite254f96f141f66bd7669426d3a8543047d734bfa (patch)
tree35d93f1b6a42509fbcc3886a46bec12248ceab56 /src/ephy-window.c
parentc463cbf5210374398fd6897eedbc2b3b2c2578f6 (diff)
downloadgsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar.gz
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar.bz2
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar.lz
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar.xz
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.tar.zst
gsoc2013-epiphany-e254f96f141f66bd7669426d3a8543047d734bfa.zip
Use new gtk+ HIG message dialogue API. Fixes bug #130232.
2004-10-26 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-gui.c: (ephy_gui_confirm_overwrite_file): * src/bookmarks/ephy-new-bookmark.c: (duplicate_dialog_construct): * src/ephy-history-window.c: (confirmation_dialog_response_cb), (confirmation_dialog_construct), (cmd_clear): * src/ephy-session.c: (offer_to_resume): * src/ephy-window.c: (confirm_close_with_modified_forms): Use new gtk+ HIG message dialogue API. Fixes bug #130232.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c60
1 files changed, 18 insertions, 42 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index fd683a529..fc7a6aa37 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -668,57 +668,33 @@ static gboolean
confirm_close_with_modified_forms (EphyWindow *window)
{
GtkWidget *dialog;
- GtkWidget *hbox, *vbox, *label, *image;
- char *text;
int response;
- dialog = gtk_dialog_new_with_buttons ("",
- GTK_WINDOW (window),
- GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_MODAL,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- _("Close _Document"), GTK_RESPONSE_OK,
- NULL);
-
- gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
-
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
-
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
- TRUE, TRUE, 0);
-
- 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_widget_show (image);
- gtk_box_pack_start (GTK_BOX (hbox), image, TRUE, TRUE, 0);
-
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_widget_show (vbox);
- gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
-
- label = gtk_label_new (NULL);
- gtk_label_set_selectable (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ dialog = gtk_message_dialog_new
+ (GTK_WINDOW (window),
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CANCEL,
+ _("There are unsubmitted changes to form elements."));
+
+ gtk_message_dialog_format_secondary_text
+ (GTK_MESSAGE_DIALOG (dialog),
+ _("If you close the document anyway, "
+ "you will lose that information."));
+
+ gtk_dialog_add_button (GTK_DIALOG (dialog),
+ _("Close _Document"), GTK_RESPONSE_ACCEPT);
- text = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
- _("There are unsubmitted changes to form elements."),
- _("If you close the document anyway, you will lose that information."));
- gtk_label_set_markup (GTK_LABEL (label), text);
- g_free (text);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
- gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
- gtk_widget_show (label);
+ /* FIXME set title */
+ gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- return response == GTK_RESPONSE_OK;
+ return response == GTK_RESPONSE_ACCEPT;
}
static void