aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-04-15 23:02:56 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-04-15 23:02:56 +0800
commita1962faa29d9f42ed0dfeab8126767470c4be6e0 (patch)
tree67c4eb97783483c64f504795055a49fde8ce9e10 /src
parent217f693f5762bbc4f327542dd911a639c42dc8bd (diff)
downloadgsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar.gz
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar.bz2
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar.lz
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar.xz
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.tar.zst
gsoc2013-epiphany-a1962faa29d9f42ed0dfeab8126767470c4be6e0.zip
Added a confirmation dialog for clearing history.
2003-04-15 David Bordoley <bordoley@msu.edu> * src/history-dialog.c: (history_clear_button_clicked_cb), (clear_history_dialog_response_cb): Added a confirmation dialog for clearing history. Patch from Jon Svendsen <jon-sven@frisurf.no>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/history-dialog.c72
1 files changed, 68 insertions, 4 deletions
diff --git a/src/history-dialog.c b/src/history-dialog.c
index 3e1660c27..caa0470a5 100755
--- a/src/history-dialog.c
+++ b/src/history-dialog.c
@@ -542,13 +542,18 @@ history_ok_button_clicked_cb (GtkWidget *button,
g_object_unref (G_OBJECT(dialog));
}
-void
-history_clear_button_clicked_cb (GtkWidget *button,
- HistoryDialog *dialog)
+static void
+clear_history_dialog_response_cb (GtkDialog *dialog, gint response,
+ HistoryDialog *history_dialog)
{
const GList *windows;
Session *session;
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+
+ if (response != GTK_RESPONSE_OK)
+ return;
+
session = ephy_shell_get_session (ephy_shell);
windows = session_get_windows (session);
@@ -560,5 +565,64 @@ history_clear_button_clicked_cb (GtkWidget *button,
toolbar_clear_location_history (t);
}
- ephy_history_clear (dialog->priv->gh);
+ ephy_history_clear (history_dialog->priv->gh);
+}
+
+void
+history_clear_button_clicked_cb (GtkWidget *button,
+ HistoryDialog *dialog)
+{
+ GtkWidget *clear;
+ GtkWidget *label;
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *image;
+ char *str;
+
+ clear = gtk_dialog_new_with_buttons (_("Clear history"),
+ GTK_WINDOW (dialog->priv->window),
+ GTK_DIALOG_DESTROY_WITH_PARENT |
+ GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL,
+ GTK_STOCK_CLEAR,
+ GTK_RESPONSE_OK,
+ NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (clear), GTK_RESPONSE_OK);
+ gtk_container_set_border_width (GTK_CONTAINER (clear), 6);
+ gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (clear)->vbox), 12);
+
+ hbox = gtk_hbox_new (FALSE, 6);
+ gtk_widget_show (hbox);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (clear)->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_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ str = g_strconcat ("<b>","<big>", _("Clear browsing history?"),"</big>", "</b>", NULL);
+ gtk_label_set_markup (GTK_LABEL (label), str);
+ g_free (str);
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
+
+ label = gtk_label_new (_("Clearing the browsing history will cause all history items to be permanently deleted."));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
+
+ g_signal_connect (clear, "response",
+ G_CALLBACK (clear_history_dialog_response_cb), dialog);
+ gtk_widget_show (clear);
}