aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-topics-selector.c
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-03-31 23:40:10 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-03-31 23:40:10 +0800
commit8c10e78e46c4427326cc9cb7162aa65346048102 (patch)
treee8124a8ced253d59e699c7f7408b68eaf8c9058c /src/bookmarks/ephy-topics-selector.c
parent668bf3c20445fdd23862a7b7140df68ee3b63fc0 (diff)
downloadgsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar.gz
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar.bz2
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar.lz
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar.xz
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.tar.zst
gsoc2013-epiphany-8c10e78e46c4427326cc9cb7162aa65346048102.zip
Update to reflect changes in EphyTopicSelector api. Wrap the topic
2003-03-30 David Bordoley <bordoley@msu.edu> * src/bookmarks/ephy-bookmark-properties.c: (build_ui): Update to reflect changes in EphyTopicSelector api. Wrap the topic selector in a GtkScrolledWindow. * src/bookmarks/ephy-bookmarks-editor.c: (cmd_add_topic), (cmd_rename), (cmd_open_bookmarks_in_tabs), (cmd_open_bookmarks_in_browser), (cmd_delete), (cmd_bookmark_properties), (cmd_select_all), (ephy_bookmarks_editor_dispose), (keyword_node_selected_cb), (ephy_bookmarks_editor_construct), (ephy_bookmarks_editor_update_menu): Update to reflect changes in EphyNodeView api. Wrap bm_view and key_view in GtkScrolledWindows. s/_Open In New Window/_Open in New Window and s/Open In New _Tabs/Open in New _Tab. * src/bookmarks/ephy-new-bookmark.c: (build_editing_table): Update to reflect changes in EphyTopicSelector api. Wrap the topic selector in a GtkScrolledWindow. * src/bookmarks/ephy-node-view.c: (ephy_node_view_get_type), (ephy_node_view_construct), (ephy_node_view_new), (ephy_node_view_add_column), (ephy_node_view_add_icon_column), (ephy_node_view_get_selection), (ephy_node_view_has_focus), (ephy_node_view_set_browse_mode), (ephy_node_view_select_node), (ephy_node_view_enable_drag_dest), (ephy_node_view_enable_drag_source), (ephy_node_view_set_hinted), (ephy_node_view_edit): * src/bookmarks/ephy-node-view.h: Inherit from GtkTreeView instead of GtkScrolledWindow and change methods to reflect the change. Allow for better/easier keynav. Return a GtkWidget from ephy_node_view_new to be consistent with GTK. * src/bookmarks/ephy-topics-selector.c: (ephy_topics_selector_get_type), (mneumonic_activated), (ephy_topics_build_ui), (ephy_topics_selector_new): * src/bookmarks/ephy-topics-selector.h: Inherit from GtkTreeView instead of GtkScrolledWindow and change methods to reflect the change. Allow for better/easier keynav.
Diffstat (limited to 'src/bookmarks/ephy-topics-selector.c')
-rw-r--r--src/bookmarks/ephy-topics-selector.c47
1 files changed, 8 insertions, 39 deletions
diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c
index a7d8a3400..cf1439617 100644
--- a/src/bookmarks/ephy-topics-selector.c
+++ b/src/bookmarks/ephy-topics-selector.c
@@ -44,7 +44,6 @@ struct EphyTopicsSelectorPrivate
{
EphyBookmarks *bookmarks;
GtkTreeModel *model;
- GtkWidget *treeview;
EphyNode *bookmark;
};
@@ -84,7 +83,7 @@ ephy_topics_selector_get_type (void)
(GInstanceInitFunc) ephy_topics_selector_init
};
- ephy_topics_selector_type = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW,
+ ephy_topics_selector_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
"EphyTopicsSelector",
&our_info, 0);
}
@@ -365,26 +364,6 @@ topic_key_pressed (GtkTreeView *tree_view,
return FALSE;
}
-static gboolean
-mneumonic_activated (GtkWidget *widget,
- gboolean arg1,
- EphyTopicsSelector *editor)
-{
- GtkTreeIter iter;
- GtkTreeSelection* sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (editor->priv->treeview));
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (editor->priv->treeview));
-
- if ((sel == NULL)
- && gtk_tree_model_get_iter_first (editor->priv->model, &iter))
- {
- gtk_tree_selection_select_iter (sel, &iter);
- }
-
- gtk_window_set_focus (GTK_WINDOW (window), GTK_WIDGET (editor->priv->treeview));
-
- return TRUE;
-}
-
static void
ephy_topics_build_ui (EphyTopicsSelector *editor)
{
@@ -395,30 +374,27 @@ ephy_topics_build_ui (EphyTopicsSelector *editor)
model = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
editor->priv->model = GTK_TREE_MODEL (model);
- editor->priv->treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (editor->priv->treeview), FALSE);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (editor), GTK_TREE_MODEL (model));
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (editor), FALSE);
g_idle_add ((GSourceFunc) set_sort_column_id, model);
- gtk_widget_show (editor->priv->treeview);
g_object_unref (model);
/* Has topic column */
renderer = gtk_cell_renderer_toggle_new ();
column = gtk_tree_view_column_new_with_attributes
("", renderer, "active", COL_HAS_TOPIC, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (editor->priv->treeview), column);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (editor), column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes
("Description", renderer, "text", COL_TOPIC, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (editor->priv->treeview), column);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (editor), column);
- g_signal_connect (G_OBJECT (editor->priv->treeview), "key_press_event",
+ g_signal_connect (G_OBJECT (editor), "key_press_event",
G_CALLBACK (topic_key_pressed), editor);
- g_signal_connect (G_OBJECT (editor->priv->treeview), "button_press_event",
+ g_signal_connect (G_OBJECT (editor), "button_press_event",
G_CALLBACK (topic_clicked), editor);
fill_model (editor);
-
- gtk_container_add (GTK_CONTAINER (editor), editor->priv->treeview);
}
static void
@@ -441,16 +417,9 @@ ephy_topics_selector_new (EphyBookmarks *bookmarks,
(EPHY_TYPE_TOPIC_SELECTOR,
"bookmarks", bookmarks,
"bookmark", bookmark,
- "hadjustment", NULL,
- "vadjustment", NULL,
- "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "vscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "shadow_type", GTK_SHADOW_IN,
NULL));
ephy_topics_build_ui (editor);
- g_signal_connect (G_OBJECT (editor), "mnemonic-activate",
- G_CALLBACK (mneumonic_activated), editor);
-
+
return GTK_WIDGET (editor);
}