diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-toolbars-group.c | 25 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-group.h | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/egg/egg-toolbars-group.c b/lib/egg/egg-toolbars-group.c index c99f0cd06..975456b8e 100755 --- a/lib/egg/egg-toolbars-group.c +++ b/lib/egg/egg-toolbars-group.c @@ -465,6 +465,31 @@ egg_toolbars_group_new (void) return t; } +static void +remove_action (EggToolbarsItem *item, + gpointer *data) +{ + char *action = data[0]; + EggToolbarsGroup *group = EGG_TOOLBARS_GROUP (data[1]); + + if (strcmp (item->action, action) == 0) + { + egg_toolbars_group_remove_item (group, item); + } +} + +void +egg_toolbars_group_remove_action (EggToolbarsGroup *group, + const char *action) +{ + gpointer data[2]; + data[0] = (char *)action; + data[1] = group; + egg_toolbars_group_foreach_item + (group, (EggToolbarsGroupForeachItemFunc) remove_action, data); + g_signal_emit (G_OBJECT (group), egg_toolbars_group_signals[CHANGED], 0); +} + void egg_toolbars_group_remove_toolbar (EggToolbarsGroup *t, EggToolbarsToolbar *toolbar) diff --git a/lib/egg/egg-toolbars-group.h b/lib/egg/egg-toolbars-group.h index 7e278dcf3..ec4163281 100755 --- a/lib/egg/egg-toolbars-group.h +++ b/lib/egg/egg-toolbars-group.h @@ -73,6 +73,10 @@ EggToolbarsGroup *egg_toolbars_group_new (void); void egg_toolbars_group_set_source (EggToolbarsGroup *group, const char *defaults, const char *user); +void egg_toolbars_group_remove_action (EggToolbarsGroup *group, + const char *action); + +/* These should be used only by editable toolbar */ EggToolbarsToolbar *egg_toolbars_group_add_toolbar (EggToolbarsGroup *t); void egg_toolbars_group_add_item (EggToolbarsGroup *t, EggToolbarsToolbar *parent, |