aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rwxr-xr-xlib/egg/egg-editable-toolbar.c23
2 files changed, 27 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index eb1c98149..98a5ddad1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-10-23 Marco Pesenti Gritti <marco@gnome.org>
+ * lib/egg/egg-editable-toolbar.c: (create_item_from_action),
+ (egg_editable_toolbar_construct):
+
+ Remove invalid items
+
+2003-10-23 Marco Pesenti Gritti <marco@gnome.org>
+
* src/toolbar.c: (toolbar_spinner_start), (toolbar_spinner_stop):
Make the spinner spin again.
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index bb42190e3..20877baa0 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -323,8 +323,16 @@ create_item_from_action (EggEditableToolbar *t,
{
g_signal_emit (G_OBJECT (t), egg_editable_toolbar_signals[ACTION_REQUEST],
0, action_name);
+
action = find_action (t, action_name);
- item = gtk_action_create_tool_item (action);
+ if (action)
+ {
+ item = gtk_action_create_tool_item (action);
+ }
+ else
+ {
+ return NULL;
+ }
}
gtk_widget_show (item);
@@ -748,8 +756,17 @@ egg_editable_toolbar_construct (EggEditableToolbar *t)
GtkWidget *item;
item = create_item (t, model, i, l);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
- GTK_TOOL_ITEM (item), l);
+ if (item)
+ {
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
+ GTK_TOOL_ITEM (item), l);
+ }
+ else
+ {
+ egg_toolbars_model_remove_item (model, i, l);
+ l--;
+ n_items--;
+ }
}
if (n_items == 0)