aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/egg-toolbar-editor.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-toolbar-editor.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-toolbar-editor.c')
-rwxr-xr-xlib/egg/egg-toolbar-editor.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c
index b957875ad..aa047c195 100755
--- a/lib/egg/egg-toolbar-editor.c
+++ b/lib/egg/egg-toolbar-editor.c
@@ -60,6 +60,7 @@ struct EggToolbarEditorPrivate
GtkWidget *table;
GtkWidget *scrolled_window;
+ GList *default_actions_list;
GList *actions_list;
};
@@ -247,8 +248,12 @@ editor_drag_data_received_cb (GtkWidget *widget,
action = find_action (editor, (const char *)selection_data->data);
g_return_if_fail (action != NULL);
- editor->priv->actions_list = g_list_append
- (editor->priv->actions_list, action);
+
+ if (g_list_find (editor->priv->default_actions_list, action))
+ {
+ editor->priv->actions_list = g_list_append
+ (editor->priv->actions_list, action);
+ }
update_editor_sheet (editor);
}
@@ -504,6 +509,7 @@ egg_toolbar_editor_init (EggToolbarEditor *t)
t->priv = g_new0 (EggToolbarEditorPrivate, 1);
t->priv->merge = NULL;
+ t->priv->default_actions_list = NULL;
t->priv->actions_list = NULL;
setup_editor (t);
@@ -518,8 +524,8 @@ egg_toolbar_editor_add_action (EggToolbarEditor *editor,
action = find_action (editor, action_name);
g_return_if_fail (action != NULL);
- editor->priv->actions_list = g_list_append
- (editor->priv->actions_list, action);
+ editor->priv->default_actions_list = g_list_append
+ (editor->priv->default_actions_list, action);
}
static void
@@ -569,7 +575,7 @@ egg_toolbar_editor_load_actions (EggToolbarEditor *editor,
xmlDocPtr doc;
xmlNodePtr root;
xmlNodePtr child;
- GList *l, *tmp;
+ GList *l;
doc = xmlParseFile (xml_file);
root = xmlDocGetRootElement (doc);
@@ -587,18 +593,17 @@ egg_toolbar_editor_load_actions (EggToolbarEditor *editor,
xmlFreeDoc (doc);
/* Remove the already used items */
- tmp = g_list_copy (editor->priv->actions_list);
- for (l = editor->priv->actions_list; l != NULL; l = l->next)
+ editor->priv->actions_list = g_list_copy (editor->priv->default_actions_list);
+ for (l = editor->priv->default_actions_list; l != NULL; l = l->next)
{
EggAction *action = EGG_ACTION (l->data);
if (model_has_action (editor->priv->model, action))
{
- tmp = g_list_remove (tmp, action);
+ editor->priv->actions_list = g_list_remove
+ (editor->priv->actions_list, action);
}
}
- g_list_free (editor->priv->actions_list);
- editor->priv->actions_list = tmp;
update_editor_sheet (editor);
}