diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2004-07-23 18:49:39 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-07-23 18:49:39 +0800 |
commit | 4d4808cdc6c565dbdefea90b567b3efe9718c5c4 (patch) | |
tree | 87bdcc8665a631b27354b6a18b0428114b38de12 | |
parent | 456d9144bd889aa71e277fc9e7b06f3d654931cf (diff) | |
download | gsoc2013-epiphany-4d4808cdc6c565dbdefea90b567b3efe9718c5c4.tar.gz gsoc2013-epiphany-4d4808cdc6c565dbdefea90b567b3efe9718c5c4.tar.zst gsoc2013-epiphany-4d4808cdc6c565dbdefea90b567b3efe9718c5c4.zip |
Do not remove the topic when rename is cancelled.
2004-07-23 Marco Pesenti Gritti <marco@gnome.org>
* lib/widgets/ephy-node-view.c: (cell_renderer_edited),
(renderer_editing_canceled_cb), (ephy_node_view_init),
(ephy_node_view_edit):
* lib/widgets/ephy-node-view.h:
* src/bookmarks/ephy-bookmarks-editor.c: (cmd_add_topic),
(cmd_rename):
* src/bookmarks/ephy-topics-selector.c:
(ephy_topics_selector_new_topic):
Do not remove the topic when rename is cancelled.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | lib/widgets/ephy-node-view.c | 13 | ||||
-rw-r--r-- | lib/widgets/ephy-node-view.h | 3 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 6 | ||||
-rw-r--r-- | src/bookmarks/ephy-topics-selector.c | 2 |
5 files changed, 30 insertions, 7 deletions
@@ -1,5 +1,18 @@ 2004-07-23 Marco Pesenti Gritti <marco@gnome.org> + * lib/widgets/ephy-node-view.c: (cell_renderer_edited), + (renderer_editing_canceled_cb), (ephy_node_view_init), + (ephy_node_view_edit): + * lib/widgets/ephy-node-view.h: + * src/bookmarks/ephy-bookmarks-editor.c: (cmd_add_topic), + (cmd_rename): + * src/bookmarks/ephy-topics-selector.c: + (ephy_topics_selector_new_topic): + + Do not remove the topic when rename is cancelled. + +2004-07-23 Marco Pesenti Gritti <marco@gnome.org> + * lib/ephy-marshal.list: * lib/widgets/ephy-node-view.c: (path_toggled), (ephy_node_view_key_press_cb), (get_selection_refs), diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index fecb90799..3681fe169 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -68,6 +68,7 @@ struct EphyNodeViewPrivate int priority_column; EphyNode *edited_node; + gboolean remove_if_cancelled; int editable_property; int searchable_data_column; @@ -1007,13 +1008,19 @@ cell_renderer_edited (GtkCellRendererText *cell, g_value_unset (&value); gtk_tree_path_free (path); + + view->priv->remove_if_cancelled = FALSE; } static void renderer_editing_canceled_cb (GtkCellRendererText *cell, EphyNodeView *view) { - ephy_node_unref (view->priv->edited_node); + if (view->priv->remove_if_cancelled) + { + ephy_node_unref (view->priv->edited_node); + view->priv->remove_if_cancelled = FALSE; + } } static inline int @@ -1331,6 +1338,7 @@ ephy_node_view_init (EphyNodeView *view) { view->priv = EPHY_NODE_VIEW_GET_PRIVATE (view); + view->priv->remove_if_cancelled = FALSE; view->priv->toggle_column = -1; view->priv->filter = NULL; view->priv->editable_renderer = NULL; @@ -1498,7 +1506,7 @@ ephy_node_view_enable_drag_source (EphyNodeView *view, } void -ephy_node_view_edit (EphyNodeView *view) +ephy_node_view_edit (EphyNodeView *view, gboolean remove_if_cancelled) { GtkTreePath *path; GtkTreeSelection *selection; @@ -1523,6 +1531,7 @@ ephy_node_view_edit (EphyNodeView *view) TRUE); view->priv->edited_node = get_node_from_path (view, path); + view->priv->remove_if_cancelled = remove_if_cancelled; g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL); g_list_free (rows); diff --git a/lib/widgets/ephy-node-view.h b/lib/widgets/ephy-node-view.h index 91886dc67..0779e9d5c 100644 --- a/lib/widgets/ephy-node-view.h +++ b/lib/widgets/ephy-node-view.h @@ -123,7 +123,8 @@ void ephy_node_view_enable_drag_dest (EphyNodeView *view, GtkTargetEntry *types, int n_types); -void ephy_node_view_edit (EphyNodeView *view); +void ephy_node_view_edit (EphyNodeView *view, + gboolean remove_if_cancelled); gboolean ephy_node_view_is_target (EphyNodeView *view); diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 26f657154..98b6adf63 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -286,7 +286,7 @@ cmd_add_topic (GtkAction *action, node = ephy_bookmarks_add_keyword (editor->priv->bookmarks, _("Type a topic")); ephy_node_view_select_node (EPHY_NODE_VIEW (editor->priv->key_view), node); - ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view)); + ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view), TRUE); add_text_renderer_monitor (editor); } @@ -303,11 +303,11 @@ cmd_rename (GtkAction *action, { if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view))) { - ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->bm_view)); + ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->bm_view), FALSE); } else if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->key_view))) { - ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view)); + ephy_node_view_edit (EPHY_NODE_VIEW (editor->priv->key_view), FALSE); } add_text_renderer_monitor (editor); } diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c index ac8113a44..1a100f5a2 100644 --- a/src/bookmarks/ephy-topics-selector.c +++ b/src/bookmarks/ephy-topics-selector.c @@ -291,7 +291,7 @@ ephy_topics_selector_new_topic (EphyTopicsSelector *selector) node = ephy_bookmarks_add_keyword (selector->priv->bookmarks, _("Type a topic")); ephy_node_view_select_node (EPHY_NODE_VIEW (selector), node); - ephy_node_view_edit (EPHY_NODE_VIEW (selector)); + ephy_node_view_edit (EPHY_NODE_VIEW (selector), TRUE); } static void |