aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-23 20:30:41 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-23 20:30:41 +0800
commitc325934e436073606e8ff5c725f1b068618d3797 (patch)
tree7eb87588f06c0de47747b69133b8038fc677a20e /src/bookmarks/ephy-bookmarks-editor.c
parentf360f793d3c18a3d0e9870f05d0a9787066f7046 (diff)
downloadgsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar.gz
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar.bz2
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar.lz
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar.xz
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.tar.zst
gsoc2013-epiphany-c325934e436073606e8ff5c725f1b068618d3797.zip
Complete implementation of the editor functionalities.
2003-03-23 Marco Pesenti Gritti <marco@it.gnome.org> * TODO: * data/ui/epiphany-bookmark-editor-ui.xml.in: * src/bookmarks/ephy-bookmarks-editor.c: (cmd_add_topic), (cmd_remove_topic), (cmd_close), (cmd_rename_topic), (cmd_rename_bookmark), (ephy_bookmarks_editor_construct): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_remove_keyword): * src/bookmarks/ephy-bookmarks.h: * src/bookmarks/ephy-node-view.c: (cell_renderer_edited), (ephy_node_view_add_column), (ephy_node_view_init), (ephy_node_view_edit): * src/bookmarks/ephy-node-view.h: Complete implementation of the editor functionalities. [Still work to do ... I updated the TODO with some of the higher priority things. If you want to work on any of them let me know ... (to avoid conflicts, I plan to keep working on this stuff in the next days).]
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 7383b2477..8a0a94f0f 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -67,6 +67,10 @@ static void cmd_remove_topic (EggAction *action,
EphyBookmarksEditor *editor);
static void cmd_rename_bookmark (EggAction *action,
EphyBookmarksEditor *editor);
+static void cmd_rename_topic (EggAction *action,
+ EphyBookmarksEditor *editor);
+static void cmd_close (EggAction *action,
+ EphyBookmarksEditor *editor);
struct EphyBookmarksEditorPrivate
{
@@ -98,6 +102,7 @@ static GObjectClass *parent_class = NULL;
static EggActionGroupEntry ephy_bookmark_popup_entries [] = {
/* Toplevel */
{ "File", N_("_File"), NULL, NULL, NULL, NULL, NULL },
+ { "Edit", N_("_Edit"), NULL, NULL, NULL, NULL, NULL },
{ "FakeToplevel", (""), NULL, NULL, NULL, NULL, NULL },
{ "NewTopic", N_("_New Topic"), GTK_STOCK_NEW, NULL,
@@ -112,6 +117,9 @@ static EggActionGroupEntry ephy_bookmark_popup_entries [] = {
{ "RenameBookmark", N_("_Rename Bookmark"), NULL, NULL,
NULL, G_CALLBACK (cmd_rename_bookmark), NULL },
+ { "RenameTopic", N_("R_ename Topic"), NULL, NULL,
+ NULL, G_CALLBACK (cmd_rename_topic), NULL },
+
{ "RemoveBookmark", N_("_Delete Bookmark"), GTK_STOCK_DELETE, NULL,
NULL, G_CALLBACK (cmd_remove_bookmarks), NULL },
@@ -120,6 +128,9 @@ static EggActionGroupEntry ephy_bookmark_popup_entries [] = {
{ "Properties", N_("_Properties"), GTK_STOCK_PROPERTIES, NULL,
NULL, G_CALLBACK (cmd_bookmark_properties), NULL },
+
+ { "Close", N_("_Close"), GTK_STOCK_CLOSE, NULL,
+ NULL, G_CALLBACK (cmd_close), NULL },
};
static guint ephy_bookmark_popup_n_entries = G_N_ELEMENTS (ephy_bookmark_popup_entries);
@@ -127,18 +138,48 @@ static void
cmd_add_topic (EggAction *action,
EphyBookmarksEditor *editor)
{
+ EphyNode *node;
+
+ node = ephy_bookmarks_add_keyword (editor->priv->bookmarks,
+ _("Type a topic"));
+ ephy_node_view_select_node (editor->priv->key_view, node);
+ ephy_node_view_edit (editor->priv->key_view);
}
static void
cmd_remove_topic (EggAction *action,
EphyBookmarksEditor *editor)
{
+ GList *selection;
+
+ selection = ephy_node_view_get_selection (editor->priv->key_view);
+ if (selection)
+ {
+ EphyNode *node = EPHY_NODE (selection->data);
+ ephy_bookmarks_remove_keyword (editor->priv->bookmarks, node);
+ g_list_free (selection);
+ }
+}
+
+static void
+cmd_close (EggAction *action,
+ EphyBookmarksEditor *editor)
+{
+ gtk_widget_hide (GTK_WIDGET (editor));
+}
+
+static void
+cmd_rename_topic (EggAction *action,
+ EphyBookmarksEditor *editor)
+{
+ ephy_node_view_edit (editor->priv->key_view);
}
static void
cmd_rename_bookmark (EggAction *action,
EphyBookmarksEditor *editor)
{
+ ephy_node_view_edit (editor->priv->bm_view);
}
static GtkWidget *
@@ -571,7 +612,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_node_view_enable_drag_source (key_view);
ephy_node_view_set_browse_mode (key_view);
ephy_node_view_add_column (key_view, _("Topics"),
- EPHY_TREE_MODEL_NODE_COL_KEYWORD, TRUE);
+ EPHY_TREE_MODEL_NODE_COL_KEYWORD, TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (key_view), FALSE, TRUE, 0);
gtk_widget_set_size_request (GTK_WIDGET (key_view), 130, -1);
gtk_widget_show (GTK_WIDGET (key_view));
@@ -599,7 +640,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_node_view_enable_drag_source (bm_view);
ephy_node_view_add_icon_column (bm_view, EPHY_TREE_MODEL_NODE_COL_ICON);
ephy_node_view_add_column (bm_view, _("Bookmarks"),
- EPHY_TREE_MODEL_NODE_COL_BOOKMARK, TRUE);
+ EPHY_TREE_MODEL_NODE_COL_BOOKMARK, TRUE, TRUE);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (bm_view), TRUE, TRUE, 0);
gtk_widget_show (GTK_WIDGET (bm_view));
editor->priv->bm_view = bm_view;