From f686d272ac4558e0ebda8f3aa873d2d9eefb17b5 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 1 Nov 2004 14:00:06 +0000 Subject: Make sure there's only one bookmark properties dialogue for each bookmark. 2004-11-01 Christian Persch * src/bookmarks/ephy-bookmark-action.c: (properties_activate_cb), (bookmark_destroy_cb), (ephy_bookmark_action_finalize): * src/bookmarks/ephy-bookmark-properties.c: (ephy_bookmark_properties_new): * src/bookmarks/ephy-bookmark-properties.h: * src/bookmarks/ephy-bookmarks-editor.c: (show_properties_dialog), (ephy_bookmarks_editor_finalize), (ephy_bookmarks_editor_init): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_init), (ephy_bookmarks_finalize), (ephy_bookmarks_add_keyword), (prop_dialog_destroy_cb), (bookmark_destroyed_cb), (ephy_bookmarks_show_bookmark_properties): * src/bookmarks/ephy-bookmarks.h: Make sure there's only one bookmark properties dialogue for each bookmark. Fixes bug #148398 and also bug #155880. --- src/bookmarks/ephy-bookmarks-editor.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'src/bookmarks/ephy-bookmarks-editor.c') diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index be69f1dfd..ed1903cd8 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -47,7 +47,6 @@ #include #include "ephy-bookmarks-editor.h" -#include "ephy-bookmark-properties.h" #include "ephy-bookmarks-import.h" #include "ephy-node-common.h" #include "ephy-node-view.h" @@ -149,7 +148,6 @@ struct EphyBookmarksEditorPrivate GtkActionGroup *action_group; int priority_col; EphyBookmarksBarModel *tb_model; - GHashTable *props_dialogs; GtkTreeViewColumn *title_col; GtkTreeViewColumn *address_col; @@ -479,31 +477,11 @@ cmd_delete (GtkAction *action, } static void -prop_dialog_destroy_cb (GtkWidget *dialog, EphyBookmarksEditor *editor) +show_properties_dialog (EphyBookmarksEditor *editor, + EphyNode *bookmark) { - EphyNode *node; - - node = ephy_bookmark_properties_get_node (EPHY_BOOKMARK_PROPERTIES (dialog)); - g_hash_table_remove (editor->priv->props_dialogs, node); -} - -static void -show_properties_dialog (EphyBookmarksEditor *editor, EphyNode *node) -{ - GtkWidget *dialog; - - dialog = g_hash_table_lookup (editor->priv->props_dialogs, node); - - if (!dialog) - { - dialog = ephy_bookmark_properties_new - (editor->priv->bookmarks, node, GTK_WINDOW (editor)); - g_signal_connect (dialog, "destroy", - G_CALLBACK (prop_dialog_destroy_cb), editor); - g_hash_table_insert (editor->priv->props_dialogs, node, dialog); - } - - gtk_window_present (GTK_WINDOW (dialog)); + ephy_bookmarks_show_bookmark_properties + (editor->priv->bookmarks, bookmark, GTK_WIDGET (editor)); } static void @@ -928,8 +906,6 @@ ephy_bookmarks_editor_finalize (GObject *object) (gpointer *)&editor->priv->window); } - g_hash_table_destroy (editor->priv->props_dialogs); - G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -1682,8 +1658,6 @@ ephy_bookmarks_editor_init (EphyBookmarksEditor *editor) { editor->priv = EPHY_BOOKMARKS_EDITOR_GET_PRIVATE (editor); - editor->priv->props_dialogs = g_hash_table_new (g_direct_hash, - g_direct_equal); editor->priv->tb_model = EPHY_BOOKMARKSBAR_MODEL (ephy_bookmarks_get_toolbars_model (ephy_shell_get_bookmarks (ephy_shell))); -- cgit v1.2.3