diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2011-01-28 02:48:14 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2011-03-05 01:40:53 +0800 |
commit | 5fed4b274d16041d629155c6b246a46917d09fe7 (patch) | |
tree | 4f3d9a48b389d84462a29a161f01aa41ad587c75 /src | |
parent | ae650f34deedaa12fd02e770cda754888055f3c0 (diff) | |
download | gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar.gz gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar.bz2 gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar.lz gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar.xz gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.tar.zst gsoc2013-epiphany-5fed4b274d16041d629155c6b246a46917d09fe7.zip |
ephy-window: make construct_confirm_close_dialog reusable
Bug #618443
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 5753912fc..98eb1c44d 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -515,24 +515,24 @@ impl_set_active_child (EphyEmbedContainer *container, } static GtkWidget * -construct_confirm_close_dialog (EphyWindow *window) +construct_confirm_close_dialog (EphyWindow *window, + const char *title, + const char *info, + const char *action) { GtkWidget *dialog; - dialog = gtk_message_dialog_new - (GTK_WINDOW (window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CANCEL, - _("There are unsubmitted changes to form elements")); + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CANCEL, + title); gtk_message_dialog_format_secondary_text - (GTK_MESSAGE_DIALOG (dialog), - _("If you close the document anyway, " - "you will lose that information.")); + (GTK_MESSAGE_DIALOG (dialog), info); gtk_dialog_add_button (GTK_DIALOG (dialog), - _("Close _Document"), GTK_RESPONSE_ACCEPT); + action, GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); @@ -554,7 +554,11 @@ confirm_close_with_modified_forms (EphyWindow *window) GtkWidget *dialog; int response; - dialog = construct_confirm_close_dialog (window); + dialog = construct_confirm_close_dialog (window, + _("There are unsubmitted changes to form elements"), + _("If you close the document anyway, " + "you will lose that information."), + _("Close _Document")); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); |