aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-15 22:10:57 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-15 22:10:57 +0800
commitb97ce595da599035a5b3e38997eace8c2b416060 (patch)
treedb1b3f8fb8f512509b1961385f4fb9335d12acbb /src
parentc608bb09921d9f654c7dc6fd3a81a370b2c85111 (diff)
downloadgsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar.gz
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar.bz2
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar.lz
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar.xz
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.tar.zst
gsoc2013-epiphany-b97ce595da599035a5b3e38997eace8c2b416060.zip
Remove some api that was just silly wrappers. Return GtkTreeViewColumn on
2003-04-15 Marco Pesenti Gritti <marco@it.gnome.org> * TODO: * src/bookmarks/ephy-bookmarks-editor.c: (cmd_select_all), (ephy_bookmarks_editor_construct): * src/bookmarks/ephy-node-view.c: (ephy_node_view_add_column), (ephy_node_view_remove): * src/bookmarks/ephy-node-view.h: Remove some api that was just silly wrappers. Return GtkTreeViewColumn on add_column. * src/ephy-nautilus-view.c: (gnv_embed_new_window_cb): * src/ephy-shell.c: (ephy_shell_new_window_cb), (ephy_shell_new_tab): * src/ephy-tab.c: (ephy_tab_new_window_cb): * src/ephy-window.c: (ephy_window_add_tab): * src/ephy-window.h: * src/session.c: (parse_embed): Ever open tab as last on File->New tab and similars.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c12
-rw-r--r--src/bookmarks/ephy-node-view.c22
-rw-r--r--src/bookmarks/ephy-node-view.h28
-rw-r--r--src/ephy-nautilus-view.c2
-rw-r--r--src/ephy-shell.c3
-rw-r--r--src/ephy-tab.c2
-rw-r--r--src/ephy-window.c11
-rw-r--r--src/ephy-window.h1
-rw-r--r--src/session.c2
9 files changed, 37 insertions, 46 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 1dbcac36a..7239f2d20 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -350,14 +350,18 @@ cmd_select_all (EggAction *action,
EphyBookmarksEditor *editor)
{
GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (editor));
+ GtkWidget *bm_view = editor->priv->bm_view;
if (GTK_IS_EDITABLE (widget))
{
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
}
- else if (gtk_widget_is_focus (editor->priv->bm_view))
+ else if (gtk_widget_is_focus (bm_view))
{
- ephy_node_view_select_all (EPHY_NODE_VIEW (editor->priv->bm_view));
+ GtkTreeSelection *sel;
+
+ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (bm_view));
+ gtk_tree_selection_select_all (sel);
}
}
@@ -831,6 +835,7 @@ node_dropped_cb (EphyNodeView *view, EphyNode *node,
static void
ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
{
+ GtkTreeSelection *selection;
GtkWidget *hbox, *vbox;
GtkWidget *bm_view, *key_view;
GtkWidget *scrolled_window;
@@ -908,7 +913,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_node_view_enable_drag_dest (EPHY_NODE_VIEW (key_view),
topic_drag_dest_types,
n_topic_drag_dest_types);
- ephy_node_view_set_browse_mode (EPHY_NODE_VIEW (key_view));
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (key_view));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
EPHY_TREE_MODEL_NODE_COL_KEYWORD, TRUE, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), key_view);
diff --git a/src/bookmarks/ephy-node-view.c b/src/bookmarks/ephy-node-view.c
index 8c75a40cf..1a2a0cf3d 100644
--- a/src/bookmarks/ephy-node-view.c
+++ b/src/bookmarks/ephy-node-view.c
@@ -556,7 +556,7 @@ cell_renderer_edited (GtkCellRendererText *cell,
g_value_unset (&value);
}
-void
+GtkTreeViewColumn *
ephy_node_view_add_column (EphyNodeView *view,
const char *title,
EphyTreeModelNodeColumn column,
@@ -566,7 +566,7 @@ ephy_node_view_add_column (EphyNodeView *view,
GtkTreeViewColumn *gcolumn;
GtkCellRenderer *renderer;
- g_return_if_fail (!editable || view->priv->editable_renderer == NULL);
+ g_return_val_if_fail (!editable || view->priv->editable_renderer == NULL, NULL);
gcolumn = (GtkTreeViewColumn *) gtk_tree_view_column_new ();
renderer = gtk_cell_renderer_text_new ();
@@ -594,6 +594,8 @@ ephy_node_view_add_column (EphyNodeView *view,
view->priv->default_sort_column_id = column;
g_idle_add ((GSourceFunc) set_sort_column_id, view);
}
+
+ return gcolumn;
}
void
@@ -665,13 +667,6 @@ ephy_node_view_get_selection (EphyNodeView *view)
}
void
-ephy_node_view_select_all (EphyNodeView *view)
-{
- GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
- gtk_tree_selection_select_all (sel);
-}
-
-void
ephy_node_view_remove (EphyNodeView *view)
{
GList *list;
@@ -687,15 +682,6 @@ ephy_node_view_remove (EphyNodeView *view)
}
void
-ephy_node_view_set_browse_mode (EphyNodeView *view)
-{
- GtkTreeSelection *selection;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
-}
-
-void
ephy_node_view_select_node (EphyNodeView *view,
EphyNode *node)
{
diff --git a/src/bookmarks/ephy-node-view.h b/src/bookmarks/ephy-node-view.h
index 1943695a6..9aa91a876 100644
--- a/src/bookmarks/ephy-node-view.h
+++ b/src/bookmarks/ephy-node-view.h
@@ -55,46 +55,42 @@ typedef struct
void (*show_popup) (EphyNodeView *view);
} EphyNodeViewClass;
-GType ephy_node_view_get_type (void);
+GType ephy_node_view_get_type (void);
-GtkWidget *ephy_node_view_new (EphyNode *root,
+GtkWidget *ephy_node_view_new (EphyNode *root,
EphyNodeFilter *filter);
-void ephy_node_view_enable_dnd (EphyNodeView *view);
+void ephy_node_view_enable_dnd (EphyNodeView *view);
-void ephy_node_view_add_column (EphyNodeView *view,
+GtkTreeViewColumn *ephy_node_view_add_column (EphyNodeView *view,
const char *title,
EphyTreeModelNodeColumn column,
gboolean sortable,
gboolean editable);
-void ephy_node_view_add_icon_column (EphyNodeView *view,
+void ephy_node_view_add_icon_column (EphyNodeView *view,
EphyTreeModelNodeColumn column);
-void ephy_node_view_remove (EphyNodeView *view);
+void ephy_node_view_remove (EphyNodeView *view);
-gboolean ephy_node_view_has_selection (EphyNodeView *view,
+gboolean ephy_node_view_has_selection (EphyNodeView *view,
gboolean *multiple);
-GList *ephy_node_view_get_selection (EphyNodeView *view);
+GList *ephy_node_view_get_selection (EphyNodeView *view);
-void ephy_node_view_select_all (EphyNodeView *view);
-
-void ephy_node_view_set_browse_mode (EphyNodeView *view);
-
-void ephy_node_view_select_node (EphyNodeView *view,
+void ephy_node_view_select_node (EphyNodeView *view,
EphyNode *node);
-void ephy_node_view_enable_drag_source (EphyNodeView *view,
+void ephy_node_view_enable_drag_source (EphyNodeView *view,
GtkTargetEntry *types,
int n_types,
guint prop_id);
-void ephy_node_view_enable_drag_dest (EphyNodeView *view,
+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);
G_END_DECLS
diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c
index ae57d2f23..a0e90e52b 100644
--- a/src/ephy-nautilus-view.c
+++ b/src/ephy-nautilus-view.c
@@ -465,7 +465,7 @@ gnv_embed_new_window_cb (EphyEmbed *embed, EphyEmbed **new_embed,
EMBED_CHROME_OPENASPOPUP);
}
new_tab = ephy_tab_new ();
- ephy_window_add_tab (window, new_tab, FALSE);
+ ephy_window_add_tab (window, new_tab, FALSE, FALSE);
*new_embed = ephy_tab_get_embed (new_tab);
}
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index d76dc5d86..a4faae5d2 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -247,7 +247,7 @@ ephy_shell_new_window_cb (EphyEmbedShell *shell,
}
new_tab = ephy_tab_new ();
- ephy_window_add_tab (window, new_tab, FALSE);
+ ephy_window_add_tab (window, new_tab, TRUE, FALSE);
*new_embed = ephy_tab_get_embed (new_tab);
}
@@ -501,6 +501,7 @@ ephy_shell_new_tab (EphyShell *shell,
embed = ephy_tab_get_embed (tab);
gtk_widget_show (GTK_WIDGET(embed));
ephy_window_add_tab (window, tab,
+ url != NULL,
jump_to);
gtk_widget_show (GTK_WIDGET(window));
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index fcdc63098..256c48d2d 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -785,7 +785,7 @@ ephy_tab_new_window_cb (EphyEmbed *embed, EphyEmbed **new_embed,
}
new_tab = ephy_tab_new ();
- ephy_window_add_tab (window, new_tab, FALSE);
+ ephy_window_add_tab (window, new_tab, TRUE, FALSE);
*new_embed = ephy_tab_get_embed (new_tab);
}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 07b456910..11a5e9b28 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -831,10 +831,12 @@ ephy_window_get_notebook (EphyWindow *window)
void
ephy_window_add_tab (EphyWindow *window,
- EphyTab *tab,
- gboolean jump_to)
+ EphyTab *tab,
+ gboolean grouped,
+ gboolean jump_to)
{
GtkWidget *widget;
+ int position;
g_return_if_fail (IS_EPHY_WINDOW (window));
g_return_if_fail (IS_EPHY_TAB (tab));
@@ -843,10 +845,9 @@ ephy_window_add_tab (EphyWindow *window,
widget = GTK_WIDGET(ephy_tab_get_embed (tab));
+ position = grouped ? EPHY_NOTEBOOK_INSERT_GROUPED : EPHY_NOTEBOOK_INSERT_LAST;
ephy_notebook_insert_page (EPHY_NOTEBOOK (window->priv->notebook),
- widget,
- EPHY_NOTEBOOK_INSERT_GROUPED,
- jump_to);
+ widget, position, jump_to);
}
void
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 10712e3ff..f0e658a2a 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -96,6 +96,7 @@ GtkWidget *ephy_window_get_notebook (EphyWindow *window);
void ephy_window_add_tab (EphyWindow *window,
EphyTab *tab,
+ gboolean grouped,
gboolean jump_to);
void ephy_window_remove_tab (EphyWindow *window,
diff --git a/src/session.c b/src/session.c
index 2e8b573ec..d057c5af6 100644
--- a/src/session.c
+++ b/src/session.c
@@ -563,7 +563,7 @@ parse_embed (xmlNodePtr child, EphyWindow *window)
gtk_widget_show (GTK_WIDGET(embed));
- ephy_window_add_tab (window, tab, FALSE);
+ ephy_window_add_tab (window, tab, FALSE, FALSE);
ephy_embed_load_url (embed, url);