diff options
author | Xan Lopez <xan@src.gnome.org> | 2003-03-30 23:32:55 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2003-03-30 23:32:55 +0800 |
commit | 33700d8d076cee88d0da1e12b4c27dfc0283139b (patch) | |
tree | 9fe4ec97785c08b642d039dffae8c08c2d8d71fd | |
parent | e6f7200e86782d3fb216617d124024f42ba07721 (diff) | |
download | gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar.gz gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar.bz2 gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar.lz gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar.xz gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.tar.zst gsoc2013-epiphany-33700d8d076cee88d0da1e12b4c27dfc0283139b.zip |
More sensitive stuff.
More sensitive stuff.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 78 |
2 files changed, 67 insertions, 20 deletions
@@ -1,3 +1,12 @@ +2003-03-30 Xan Lopez <xan@masilla.org> + + * src/bookmarks/ephy-bookmarks-editor.c: + (ephy_bookmarks_editor_node_selected_cb), + (keyword_node_selected_cb), (ephy_bookmarks_editor_update_menu): + + More sensitive stuff, I think this handles every case marco's sick + mind can think about *grin* + 2003-03-29 Xan Lopez <xan@masilla.org> * src/bookmarks/ephy-bookmarks-editor.c: diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index b0bba72fb..20756fd97 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -508,10 +508,7 @@ ephy_bookmarks_editor_node_selected_cb (EphyNodeView *view, EphyNode *node, EphyBookmarksEditor *editor) { - if (node != NULL) - { - ephy_bookmarks_editor_update_menu (editor, node, view); - } + ephy_bookmarks_editor_update_menu (editor, node, view); } static void @@ -558,8 +555,8 @@ keyword_node_selected_cb (EphyNodeView *view, else { bookmarks_filter (editor, node); - ephy_bookmarks_editor_update_menu (editor, node, view); } + ephy_bookmarks_editor_update_menu (editor, node, view); } @@ -905,35 +902,76 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor, EphyNodeView *view) { int priority; - gresult delete, rename; + gboolean delete, rename, properties; EggAction *action; EggActionGroup *action_group; GList *selection; g_return_if_fail (editor != NULL); - g_return_if_fail (node != NULL); - - priority = ephy_node_get_property_int (node, EPHY_NODE_KEYWORD_PROP_PRIORITY); - if (priority == EPHY_BOOKMARKS_KEYWORD_ALL_PRIORITY || - priority == EPHY_BOOKMARKS_KEYWORD_SPECIAL_PRIORITY) + /* Unselection */ + if (node == NULL) { - delete = rename = G_FAILED; + selection = ephy_node_view_get_selection (editor->priv->bm_view); + if (!selection) + { + rename = delete = properties = FALSE; + } + else + { + delete = properties = TRUE; + if (g_list_length (selection) > 1) + { + rename = FALSE; + } + else + { + rename = TRUE; + } + } + g_list_free (selection); } + /* Selection */ else { - delete = G_OK; - selection = ephy_node_view_get_selection (editor->priv->bm_view); - if (g_list_length (selection) > 1) - rename = G_FAILED; + priority = ephy_node_get_property_int (node, EPHY_NODE_KEYWORD_PROP_PRIORITY); + + if (priority == EPHY_BOOKMARKS_KEYWORD_ALL_PRIORITY || + priority == EPHY_BOOKMARKS_KEYWORD_SPECIAL_PRIORITY) + { + delete = rename = properties = FALSE; + } else - rename = G_OK; - g_list_free (selection); + { + if (view == editor->priv->key_view) + { + properties = FALSE; + } + else + { + properties = TRUE; + } + + delete = TRUE; + selection = ephy_node_view_get_selection (editor->priv->bm_view); + if (g_list_length (selection) > 1) + { + rename = FALSE; + } + else + { + rename = TRUE; + } + g_list_free (selection); + } + } action_group = editor->priv->action_group; action = egg_action_group_get_action (action_group, "Rename"); - g_object_set (action, "sensitive", !rename, NULL); + g_object_set (action, "sensitive", rename, NULL); action = egg_action_group_get_action (action_group, "Delete"); - g_object_set (action, "sensitive", !delete, NULL); + g_object_set (action, "sensitive", delete, NULL); + action = egg_action_group_get_action (action_group, "Properties"); + g_object_set (action, "sensitive", properties, NULL); } |