From 704e1716a071203b9eb81be8f525eab008d2f547 Mon Sep 17 00:00:00 2001 From: David Bordoley Date: Tue, 13 May 2003 17:38:43 +0000 Subject: Don't go modal when showing the duplicate bookmark dialog. 2003-05-13 David Bordoley * src/bookmarks/ephy-new-bookmark.c: (duplicate_dialog_construct), (duplicate_bookmark_response_cb), (ephy_new_bookmark_is_unique): Don't go modal when showing the duplicate bookmark dialog. --- ChangeLog | 7 +++++++ src/bookmarks/ephy-new-bookmark.c | 28 ++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2402a03fa..73db45125 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-05-13 David Bordoley + + * src/bookmarks/ephy-new-bookmark.c: (duplicate_dialog_construct), + (duplicate_bookmark_response_cb), (ephy_new_bookmark_is_unique): + + Don't go modal when showing the duplicate bookmark dialog. + 2003-05-13 David Bordoley * src/ephy-history-window.c: (cmd_bookmark_page): diff --git a/src/bookmarks/ephy-new-bookmark.c b/src/bookmarks/ephy-new-bookmark.c index 332e737bd..37dc3e16d 100644 --- a/src/bookmarks/ephy-new-bookmark.c +++ b/src/bookmarks/ephy-new-bookmark.c @@ -298,11 +298,16 @@ duplicate_dialog_construct (GtkWindow *parent, GtkWidget *hbox, *vbox, *label, *image; char *str; + /* FIXME: We "should" use gtk_message dialog here + * but it doesn't support markup of text yet + * so we build our own. See bug 65501. + */ + dialog = gtk_dialog_new_with_buttons (_("Duplicated bookmark"), GTK_WINDOW (parent), GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, + GTK_RESPONSE_OK, NULL); gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); @@ -336,6 +341,19 @@ duplicate_dialog_construct (GtkWindow *parent, return dialog; } +static void +duplicate_bookmark_response_cb (EphyNewBookmark *new_bookmark, + int response_id, + gpointer user_data) +{ + switch (response_id) + { + case GTK_RESPONSE_OK: + gtk_widget_destroy (GTK_WIDGET (new_bookmark)); + break; + } +} + gboolean ephy_new_bookmark_is_unique (EphyBookmarks *bookmarks, GtkWindow *parent, @@ -352,9 +370,11 @@ ephy_new_bookmark_is_unique (EphyBookmarks *bookmarks, title = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_TITLE); dialog = duplicate_dialog_construct (parent, title); gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - + g_signal_connect (G_OBJECT (dialog), + "response", + G_CALLBACK (duplicate_bookmark_response_cb), + dialog); + gtk_widget_show (GTK_WIDGET (dialog)); return FALSE; } -- cgit v1.2.3