aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/egg-toolbars-model.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-27 19:49:19 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-27 19:49:19 +0800
commit3d8e5e157f5a740d1f8005383597b13eca6725d4 (patch)
tree4f177ebc3431969e0a50ce2d3aab0ec6db79254a /lib/egg/egg-toolbars-model.c
parent34c164d7175456a25362d00981d1cc38a339baf2 (diff)
downloadgsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar.gz
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar.bz2
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar.lz
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar.xz
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.tar.zst
gsoc2013-epiphany-3d8e5e157f5a740d1f8005383597b13eca6725d4.zip
update
2003-04-27 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-editable-toolbar.c: * lib/egg/egg-editable-toolbar.h: * lib/egg/egg-toolbar-editor.c: * lib/egg/egg-toolbars-model.c: * lib/egg/egg-toolbars-model.h: * lib/egg/eggtoolbar.c: update * src/ephy-shell.c: (save_toolbars), (ephy_shell_get_toolbars_model): * src/ephy-toolbars-model.c: (impl_add_item), (ephy_toolbars_model_class_init): * src/ephy-toolbars-model.h: * src/toolbar.c: (action_request_cb), (init_bookmarks_toolbar), (toolbar_set_window): Load the toolbars model in EphyShell so bookmarks editor alone can use it. Update the actions on a new editable toolbar signal, actions are per toolbar, not per model.
Diffstat (limited to 'lib/egg/egg-toolbars-model.c')
-rwxr-xr-xlib/egg/egg-toolbars-model.c50
1 files changed, 45 insertions, 5 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 8d92da83a..e2a8ce9fb 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -38,6 +38,7 @@ enum
typedef struct
{
char *name;
+ EggTbModelFlags flags;
} EggToolbarsToolbar;
typedef struct
@@ -145,6 +146,7 @@ toolbars_toolbar_new (const char *name)
toolbar = g_new0 (EggToolbarsToolbar, 1);
toolbar->name = g_strdup (name);
+ toolbar->flags = 0;
return toolbar;
}
@@ -182,6 +184,37 @@ free_item_node (EggToolbarsItem *item)
g_free (item);
}
+EggTbModelFlags
+egg_toolbars_model_get_flags (EggToolbarsModel *t,
+ int toolbar_position)
+{
+ GNode *toolbar_node;
+ EggToolbarsToolbar *toolbar;
+
+ toolbar_node = g_node_nth_child (t->priv->toolbars, toolbar_position);
+ g_return_val_if_fail (toolbar_node != NULL, -1);
+
+ toolbar = toolbar_node->data;
+
+ return toolbar->flags;
+}
+
+void
+egg_toolbars_model_set_flags (EggToolbarsModel *t,
+ EggTbModelFlags flags,
+ int toolbar_position)
+{
+ GNode *toolbar_node;
+ EggToolbarsToolbar *toolbar;
+
+ toolbar_node = g_node_nth_child (t->priv->toolbars, toolbar_position);
+ g_return_if_fail (toolbar_node != NULL);
+
+ toolbar = toolbar_node->data;
+
+ toolbar->flags = flags;
+}
+
void
egg_toolbars_model_add_separator (EggToolbarsModel *t,
int toolbar_position,
@@ -402,16 +435,23 @@ egg_toolbars_model_remove_toolbar (EggToolbarsModel *t,
int position)
{
GNode *node;
+ EggTbModelFlags flags;
g_return_if_fail (IS_EGG_TOOLBARS_MODEL (t));
- node = g_node_nth_child (t->priv->toolbars, position);
- g_return_if_fail (node != NULL);
+ flags = egg_toolbars_model_get_flags (t, position);
- free_toolbar_node (node->data);
- g_node_destroy (node);
+ if (!(flags && EGG_TB_MODEL_NOT_REMOVABLE))
+ {
+ node = g_node_nth_child (t->priv->toolbars, position);
+ g_return_if_fail (node != NULL);
- g_signal_emit (G_OBJECT (t), egg_toolbars_model_signals[TOOLBAR_REMOVED], 0, position);
+ free_toolbar_node (node->data);
+ g_node_destroy (node);
+
+ g_signal_emit (G_OBJECT (t), egg_toolbars_model_signals[TOOLBAR_REMOVED],
+ 0, position);
+ }
}
void