aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorPeter Harvey <peter.a.harvey@gmail.com>2006-02-14 20:32:09 +0800
committerPeter Anthony Harvey <paharvey@src.gnome.org>2006-02-14 20:32:09 +0800
commit9d6391aba379d4032d8be1d63d9535cb36163197 (patch)
treeb543ba6cb32aaaaf2ad8e8cf8a303e7e1a136962 /src/bookmarks
parent92eb07864379444f9ecee4ac14d9a4bb8939aaa2 (diff)
downloadgsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.gz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.bz2
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.lz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.xz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.zst
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.zip
src/bookmarks/ephy-bookmarks-editor.c
2006-02-10 Peter Harvey <peter.a.harvey@gmail.com> * src/bookmarks/ephy-bookmarks-editor.c Do not create the bookmarks bar when removing bookmarks from the toolbar. * lib/egg/egg-toolbars-model.c Fix infinite loop when a toolbar has no items on it.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 039f8a251..3158953d1 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -426,19 +426,11 @@ delete_topic_dialog_construct (GtkWindow *parent,
return dialog;
}
-static void
-cmd_toolbar (GtkAction *action,
- EphyBookmarksEditor *editor)
+static gint
+get_bookmarks_bar (EggToolbarsModel *model)
{
- EggToolbarsModel *model;
- EphyNode *node;
- gboolean show;
+ gint tpos;
const char *tname;
- gint flags, tpos;
- GList *selection;
- GList *l;
-
- model = EGG_TOOLBARS_MODEL (ephy_shell_get_toolbars_model (ephy_shell_get_default (), FALSE));
for (tpos = 0; tpos < egg_toolbars_model_n_toolbars (model); tpos++)
{
@@ -454,6 +446,22 @@ cmd_toolbar (GtkAction *action,
tpos = egg_toolbars_model_add_toolbar (model, -1, "BookmarksBar");
}
+ return tpos;
+}
+
+static void
+cmd_toolbar (GtkAction *action,
+ EphyBookmarksEditor *editor)
+{
+ EggToolbarsModel *model;
+ EphyNode *node;
+ gboolean show;
+ gint flags, tpos = 0;
+ GList *selection;
+ GList *l;
+
+ model = EGG_TOOLBARS_MODEL (ephy_shell_get_toolbars_model (ephy_shell_get_default (), FALSE));
+
if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)))
{
char name[EPHY_BOOKMARK_ACTION_NAME_BUFFER_SIZE];
@@ -466,6 +474,11 @@ cmd_toolbar (GtkAction *action,
flags = egg_toolbars_model_get_name_flags (model, name);
show = ((flags & EGG_TB_MODEL_NAME_USED) == 0);
+
+ if (show)
+ {
+ tpos = get_bookmarks_bar (model);
+ }
for (l = selection; l; l = l->next)
{
@@ -499,6 +512,11 @@ cmd_toolbar (GtkAction *action,
flags = egg_toolbars_model_get_name_flags (model, name);
show = ((flags & EGG_TB_MODEL_NAME_USED) == 0);
+ if (show)
+ {
+ tpos = get_bookmarks_bar (model);
+ }
+
for (l = selection; l; l = l->next)
{
node = l->data;