diff options
author | Peter Harvey <peter.a.harvey@gmail.com> | 2006-02-04 18:43:25 +0800 |
---|---|---|
committer | Peter Anthony Harvey <paharvey@src.gnome.org> | 2006-02-04 18:43:25 +0800 |
commit | aa0171e76962bcdc240f3a0b3b25b15855803b7b (patch) | |
tree | 2e7015eca562bed70b63ee6b122887834c6ada9e | |
parent | be7c992ff6b3a05d6facf24e42826fe14a94ad89 (diff) | |
download | gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar.gz gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar.bz2 gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar.lz gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar.xz gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.tar.zst gsoc2013-epiphany-aa0171e76962bcdc240f3a0b3b25b15855803b7b.zip |
lib/egg/egg-editable-toolbar.c lib/egg/egg-toolbar-editor.c
2006-02-04 Peter Harvey <peter.a.harvey@gmail.com>
* lib/egg/egg-editable-toolbar.c
* lib/egg/egg-toolbar-editor.c
* lib/egg/egg-toolbars-model.c
* lib/egg/egg-toolbars-model.h
* src/bookmarks/ephy-bookmark-factory-action.c
* src/bookmarks/ephy-topic-factory-action.c
* src/ephy-toolbars-model.c
* src/epiphany.defs
Improve the system for testing whether an item has already
been used on the toolbar.
-rw-r--r-- | ChangeLog | 14 | ||||
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 48 | ||||
-rwxr-xr-x | lib/egg/egg-toolbar-editor.c | 8 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 146 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.h | 25 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-factory-action.c | 5 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-factory-action.c | 5 | ||||
-rwxr-xr-x | src/ephy-toolbars-model.c | 34 | ||||
-rw-r--r-- | src/epiphany.defs | 29 |
9 files changed, 232 insertions, 82 deletions
@@ -1,5 +1,19 @@ 2006-02-04 Peter Harvey <peter.a.harvey@gmail.com> + * lib/egg/egg-editable-toolbar.c + * lib/egg/egg-toolbar-editor.c + * lib/egg/egg-toolbars-model.c + * lib/egg/egg-toolbars-model.h + * src/bookmarks/ephy-bookmark-factory-action.c + * src/bookmarks/ephy-topic-factory-action.c + * src/ephy-toolbars-model.c + * src/epiphany.defs + + Improve the system for testing whether an item has already + been used on the toolbar. + +2006-02-04 Peter Harvey <peter.a.harvey@gmail.com> + * src/bookmarks/ephy-bookmark-properties.c * src/bookmarks/ephy-bookmarks-ui.c * src/bookmarks/ephy-bookmarks-ui.h diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index e7deb4129..42fa32ee3 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -230,7 +230,7 @@ drag_data_delete_cb (GtkWidget *widget, toolbar_pos = get_toolbar_position (etoolbar, widget->parent); egg_toolbars_model_remove_item (etoolbar->priv->model, - toolbar_pos, pos); + toolbar_pos, pos); } static void @@ -238,7 +238,23 @@ drag_begin_cb (GtkWidget *widget, GdkDragContext *context, EggEditableToolbar *etoolbar) { + GtkAction *action; + gint flags; + gtk_widget_hide (widget); + + action = g_object_get_data (G_OBJECT (widget), "gtk-action"); + if (action == NULL) return; + + flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model, + gtk_action_get_name (action)); + if (!(flags & EGG_TB_MODEL_NAME_INFINITE)) + { + flags &= ~EGG_TB_MODEL_NAME_USED; + egg_toolbars_model_set_name_flags (etoolbar->priv->model, + gtk_action_get_name (action), + flags); + } } static void @@ -246,7 +262,26 @@ drag_end_cb (GtkWidget *widget, GdkDragContext *context, EggEditableToolbar *etoolbar) { - gtk_widget_show (widget); + GtkAction *action; + gint flags; + + if (gtk_widget_get_parent (widget) != NULL) + { + gtk_widget_show (widget); + + action = g_object_get_data (G_OBJECT (widget), "gtk-action"); + if (action == NULL) return; + + flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model, + gtk_action_get_name (action)); + if (!(flags & EGG_TB_MODEL_NAME_INFINITE)) + { + flags |= EGG_TB_MODEL_NAME_USED; + egg_toolbars_model_set_name_flags (etoolbar->priv->model, + gtk_action_get_name (action), + flags); + } + } } static void @@ -557,12 +592,17 @@ toolbar_drag_data_received_cb (GtkToolbar *toolbar, int ipos = -1; char *name = NULL; + gboolean used = FALSE; /* Find out where the drop is occuring, and the name of what is being dropped. */ if (selection_data->length >= 0) { ipos = gtk_toolbar_get_drop_index (toolbar, x, y); name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, FALSE); + if (name != NULL) + { + used = ((egg_toolbars_model_get_name_flags (etoolbar->priv->model, name) & EGG_TB_MODEL_NAME_USED) != 0); + } } /* If we just want a highlight item, then . */ @@ -570,7 +610,7 @@ toolbar_drag_data_received_cb (GtkToolbar *toolbar, { etoolbar->priv->dnd_pending--; - if (name != NULL && etoolbar->priv->dnd_toolbar == toolbar) + if (name != NULL && etoolbar->priv->dnd_toolbar == toolbar && !used) { etoolbar->priv->dnd_toolitem = create_item_from_action (etoolbar, name); gtk_toolbar_set_drop_highlight_item (etoolbar->priv->dnd_toolbar, @@ -589,7 +629,7 @@ toolbar_drag_data_received_cb (GtkToolbar *toolbar, name = egg_toolbars_model_get_name (etoolbar->priv->model, type, data, TRUE); } - if (name != NULL) + if (name != NULL && !used) { gint tpos = get_toolbar_position (etoolbar, GTK_WIDGET (toolbar)); egg_toolbars_model_add_item (etoolbar->priv->model, tpos, ipos, name); diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index b03973a07..ca3e2f1ea 100755 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -532,7 +532,7 @@ update_editor_sheet (EggToolbarEditor *editor) GtkWidget *viewport; g_return_if_fail (EGG_IS_TOOLBAR_EDITOR (editor)); - + /* Create new table. */ table = gtk_table_new (0, 0, TRUE); editor->priv->table = table; @@ -544,16 +544,18 @@ update_editor_sheet (EggToolbarEditor *editor) GDK_ACTION_MOVE | GDK_ACTION_COPY); /* Build two lists of items (one for copying, one for moving). */ - items = egg_toolbars_model_get_avail (editor->priv->model); + items = egg_toolbars_model_get_name_avail (editor->priv->model); while (items->len > 0) { GtkWidget *item; const char *name; + gint flags; name = g_ptr_array_index (items, 0); g_ptr_array_remove_index_fast (items, 0); - if (egg_toolbars_model_get_n_avail (editor->priv->model, name) == 1) + flags = egg_toolbars_model_get_name_flags (editor->priv->model, name); + if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0) { item = editor_create_item_from_name (editor, name, GDK_ACTION_MOVE); if (item != NULL) diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 682ee59b3..51ada3703 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -65,7 +65,7 @@ struct EggToolbarsModelPrivate { GNode *toolbars; GList *types; - GHashTable *avail; + GHashTable *flags; }; GType @@ -223,9 +223,9 @@ safe_save_xml (const char *xml_file, xmlDocPtr doc) } void -egg_toolbars_model_save (EggToolbarsModel *model, - const char *xml_file, - const char *version) +egg_toolbars_model_save_toolbars (EggToolbarsModel *model, + const char *xml_file, + const char *version) { xmlDocPtr doc; xmlNodePtr root; @@ -239,6 +239,32 @@ egg_toolbars_model_save (EggToolbarsModel *model, xmlFreeDoc (doc); } +static gboolean +is_unique (EggToolbarsModel *model, + EggToolbarsItem *idata) +{ + EggToolbarsItem *idata2; + GNode *toolbar, *item; + + + for(toolbar = g_node_first_child (model->priv->toolbars); + toolbar != NULL; toolbar = g_node_next_sibling (toolbar)) + { + for(item = g_node_first_child (toolbar); + item != NULL; item = g_node_next_sibling (item)) + { + idata2 = item->data; + + if (idata != idata2 && strcmp (idata->name, idata2->name) == 0) + { + return FALSE; + } + } + } + + return TRUE; +} + static GNode * toolbar_node_new (const char *name) { @@ -255,18 +281,18 @@ static GNode * item_node_new (const char *name, EggToolbarsModel *model) { EggToolbarsItem *item; - int count; + int flags; g_return_val_if_fail (name != NULL, NULL); item = g_new (EggToolbarsItem, 1); item->name = g_strdup (name); - count = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, item->name)); - if (count > G_MININT && count < G_MAXINT) - g_hash_table_insert (model->priv->avail, + flags = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, item->name)); + if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0) + g_hash_table_insert (model->priv->flags, g_strdup (item->name), - GINT_TO_POINTER (count - 1)); + GINT_TO_POINTER (flags | EGG_TB_MODEL_NAME_USED)); return g_node_new (item); } @@ -275,13 +301,13 @@ static void item_node_free (GNode *item_node, EggToolbarsModel *model) { EggToolbarsItem *item = item_node->data; - int count; + int flags; - count = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, item->name)); - if (count < G_MAXINT - 1) - g_hash_table_insert (model->priv->avail, + flags = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, item->name)); + if ((flags & EGG_TB_MODEL_NAME_INFINITE) == 0 && is_unique (model, item)) + g_hash_table_insert (model->priv->flags, g_strdup (item->name), - GINT_TO_POINTER (count + 1)); + GINT_TO_POINTER (flags & ~EGG_TB_MODEL_NAME_USED)); g_free (item->name); g_free (item); @@ -582,8 +608,8 @@ parse_toolbars (EggToolbarsModel *model, } gboolean -egg_toolbars_model_load (EggToolbarsModel *model, - const char *xml_file) +egg_toolbars_model_load_toolbars (EggToolbarsModel *model, + const char *xml_file) { xmlDocPtr doc; xmlNodePtr root; @@ -608,6 +634,70 @@ egg_toolbars_model_load (EggToolbarsModel *model, } static void +parse_available_list (EggToolbarsModel *model, + xmlNodePtr child) +{ + gint flags; + + while (child) + { + if (xmlStrEqual (child->name, (const xmlChar*) "toolitem")) + { + xmlChar *name; + + name = xmlGetProp (child, (const xmlChar*) "name"); + flags = egg_toolbars_model_get_name_flags + (model, (const char*)name); + egg_toolbars_model_set_name_flags + (model, (const char*)name, flags | EGG_TB_MODEL_NAME_KNOWN); + xmlFree (name); + } + child = child->next; + } +} + +static void +parse_names (EggToolbarsModel *model, + xmlNodePtr child) +{ + while (child) + { + if (xmlStrEqual (child->name, (const xmlChar*) "available")) + { + parse_available_list (model, child->children); + } + + child = child->next; + } +} + +gboolean +egg_toolbars_model_load_names (EggToolbarsModel *model, + const char *xml_file) +{ + xmlDocPtr doc; + xmlNodePtr root; + + g_return_val_if_fail (EGG_IS_TOOLBARS_MODEL (model), FALSE); + + if (!xml_file || !g_file_test (xml_file, G_FILE_TEST_EXISTS)) return FALSE; + + doc = xmlParseFile (xml_file); + if (doc == NULL) + { + g_warning ("Failed to load XML data from %s", xml_file); + return FALSE; + } + root = xmlDocGetRootElement (doc); + + parse_names (model, root->children); + + xmlFreeDoc (doc); + + return TRUE; +} + +static void egg_toolbars_model_class_init (EggToolbarsModelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -663,8 +753,10 @@ egg_toolbars_model_init (EggToolbarsModel *model) model->priv =EGG_TOOLBARS_MODEL_GET_PRIVATE (model); model->priv->toolbars = g_node_new (NULL); - model->priv->avail = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - egg_toolbars_model_set_n_avail (model, "_separator", G_MAXINT); + model->priv->flags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + egg_toolbars_model_set_name_flags (model, "_separator", + EGG_TB_MODEL_NAME_KNOWN | + EGG_TB_MODEL_NAME_INFINITE); } static void @@ -675,7 +767,7 @@ egg_toolbars_model_finalize (GObject *object) g_node_children_foreach (model->priv->toolbars, G_TRAVERSE_ALL, (GNodeForeachFunc) toolbar_node_free, model); g_node_destroy (model->priv->toolbars); - g_hash_table_destroy (model->priv->avail); + g_hash_table_destroy (model->priv->flags); G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -891,25 +983,27 @@ egg_toolbars_model_set_types (EggToolbarsModel *model, GList *types) static void fill_avail_array (gpointer key, gpointer value, GPtrArray *array) { - if (GPOINTER_TO_INT (value) > 0) g_ptr_array_add (array, key); + int flags = GPOINTER_TO_INT (value); + if ((flags & EGG_TB_MODEL_NAME_KNOWN) && !(flags & EGG_TB_MODEL_NAME_USED)) + g_ptr_array_add (array, key); } GPtrArray * -egg_toolbars_model_get_avail (EggToolbarsModel *model) +egg_toolbars_model_get_name_avail (EggToolbarsModel *model) { GPtrArray *array = g_ptr_array_new (); - g_hash_table_foreach (model->priv->avail, (GHFunc) fill_avail_array, array); + g_hash_table_foreach (model->priv->flags, (GHFunc) fill_avail_array, array); return array; } gint -egg_toolbars_model_get_n_avail (EggToolbarsModel *model, const char *name) +egg_toolbars_model_get_name_flags (EggToolbarsModel *model, const char *name) { - return GPOINTER_TO_INT (g_hash_table_lookup (model->priv->avail, name)); + return GPOINTER_TO_INT (g_hash_table_lookup (model->priv->flags, name)); } void -egg_toolbars_model_set_n_avail (EggToolbarsModel *model, const char *name, gint count) +egg_toolbars_model_set_name_flags (EggToolbarsModel *model, const char *name, gint flags) { - g_hash_table_insert (model->priv->avail, g_strdup (name), GINT_TO_POINTER (count)); + g_hash_table_insert (model->priv->flags, g_strdup (name), GINT_TO_POINTER (flags)); } diff --git a/lib/egg/egg-toolbars-model.h b/lib/egg/egg-toolbars-model.h index cfc19a75d..415328948 100755 --- a/lib/egg/egg-toolbars-model.h +++ b/lib/egg/egg-toolbars-model.h @@ -52,6 +52,13 @@ typedef enum EGG_TB_MODEL_HIDDEN = 1 << 6 } EggTbModelFlags; +typedef enum +{ + EGG_TB_MODEL_NAME_USED = 1 << 0, + EGG_TB_MODEL_NAME_INFINITE = 1 << 1, + EGG_TB_MODEL_NAME_KNOWN = 1 << 2 +} EggTbModelNameFlags; + struct EggToolbarsModel { GObject parent_object; @@ -105,9 +112,11 @@ struct EggToolbarsItemType GType egg_toolbars_model_flags_get_type (void); GType egg_toolbars_model_get_type (void); EggToolbarsModel *egg_toolbars_model_new (void); -gboolean egg_toolbars_model_load (EggToolbarsModel *model, +gboolean egg_toolbars_model_load_names (EggToolbarsModel *model, const char *xml_file); -void egg_toolbars_model_save (EggToolbarsModel *model, +gboolean egg_toolbars_model_load_toolbars (EggToolbarsModel *model, + const char *xml_file); +void egg_toolbars_model_save_toolbars (EggToolbarsModel *model, const char *xml_file, const char *version); @@ -126,12 +135,12 @@ char * egg_toolbars_model_get_data (EggToolbarsModel *model, const char *name); /* Functions for retrieving what items are available for adding to the toolbars. */ -GPtrArray * egg_toolbars_model_get_avail (EggToolbarsModel *model); -gint egg_toolbars_model_get_n_avail (EggToolbarsModel *model, - const char *name); -void egg_toolbars_model_set_n_avail (EggToolbarsModel *model, - const char *name, - gint count); +GPtrArray * egg_toolbars_model_get_name_avail (EggToolbarsModel *model); +gint egg_toolbars_model_get_name_flags (EggToolbarsModel *model, + const char *name); +void egg_toolbars_model_set_name_flags (EggToolbarsModel *model, + const char *name, + gint flags); /* Functions for manipulating flags on individual toolbars. */ EggTbModelFlags egg_toolbars_model_get_flags (EggToolbarsModel *model, diff --git a/src/bookmarks/ephy-bookmark-factory-action.c b/src/bookmarks/ephy-bookmark-factory-action.c index 2d3de0c73..2547c8b8f 100644 --- a/src/bookmarks/ephy-bookmark-factory-action.c +++ b/src/bookmarks/ephy-bookmark-factory-action.c @@ -98,7 +98,7 @@ build_menu_for_topic (GtkWidget *placeholder, EggToolbarsModel *model, EphyNode EphyNode *node; GPtrArray *children, *bookmarks; const char *name, *action; - gint i; + gint i, flags; children = ephy_node_get_children (topic); bookmarks = g_ptr_array_sized_new (children->len); @@ -113,7 +113,8 @@ build_menu_for_topic (GtkWidget *placeholder, EggToolbarsModel *model, EphyNode node = g_ptr_array_index (bookmarks, i); action = ephy_bookmark_action_name (node); - if (egg_toolbars_model_get_n_avail (model, action) < 0) + flags = egg_toolbars_model_get_name_flags (model, action); + if (flags & EGG_TB_MODEL_NAME_USED) continue; name = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_TITLE); diff --git a/src/bookmarks/ephy-topic-factory-action.c b/src/bookmarks/ephy-topic-factory-action.c index 524a97ae7..44e9e0dd9 100644 --- a/src/bookmarks/ephy-topic-factory-action.c +++ b/src/bookmarks/ephy-topic-factory-action.c @@ -143,7 +143,7 @@ build_menu (GtkWidget *placeholder, EggToolbarsModel *model) GPtrArray *children, *topics; const char *name, *action; - gint i, priority = -1, ptmp; + gint i, priority = -1, ptmp, flags; /* Get a sorted list of topics. */ eb = ephy_shell_get_bookmarks (ephy_shell); @@ -160,7 +160,8 @@ build_menu (GtkWidget *placeholder, EggToolbarsModel *model) node = g_ptr_array_index (topics, i); action = ephy_topic_action_name (node); - if (egg_toolbars_model_get_n_avail (model, action) < 0) + flags = egg_toolbars_model_get_name_flags (model, action); + if (flags & EGG_TB_MODEL_NAME_USED) continue; ptmp = ephy_node_get_property_int (node, EPHY_NODE_KEYWORD_PROP_PRIORITY); diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c index dec18628e..103ebc4c6 100755 --- a/src/ephy-toolbars-model.c +++ b/src/ephy-toolbars-model.c @@ -80,7 +80,7 @@ save_changes_idle (EphyToolbarsModel *model) { LOG ("Saving toolbars model"); - egg_toolbars_model_save + egg_toolbars_model_save_toolbars (EGG_TOOLBARS_MODEL (model), model->priv->xml_file, EPHY_TOOLBARS_XML_VERSION); @@ -182,29 +182,9 @@ ephy_toolbars_model_load (EphyToolbarsModel *model) gboolean success; int i; - egg_toolbars_model_set_n_avail (eggmodel, "NavigationBack", 1); - egg_toolbars_model_set_n_avail (eggmodel, "NavigationForward", 1); - egg_toolbars_model_set_n_avail (eggmodel, "NavigationUp", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ViewStop", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ViewReload", 1); - egg_toolbars_model_set_n_avail (eggmodel, "GoHome", 1); - egg_toolbars_model_set_n_avail (eggmodel, "GoHistory", 1); - egg_toolbars_model_set_n_avail (eggmodel, "GoBookmarks", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FileNewTab", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FileNewWindow", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FileOpen", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FileSaveAs", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FilePrint", 1); - egg_toolbars_model_set_n_avail (eggmodel, "FileBookmarkPage", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ViewFullscreen", 1); - egg_toolbars_model_set_n_avail (eggmodel, "EditFind", 1); - egg_toolbars_model_set_n_avail (eggmodel, "Location", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ToolbarGo", 1); - egg_toolbars_model_set_n_avail (eggmodel, "Zoom", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ViewZoomOut", 1); - egg_toolbars_model_set_n_avail (eggmodel, "ViewZoomIn", 1); + egg_toolbars_model_load_names (eggmodel, ephy_file ("epiphany-toolbar.xml")); - success = egg_toolbars_model_load (eggmodel, model->priv->xml_file); + success = egg_toolbars_model_load_toolbars (eggmodel, model->priv->xml_file); LOG ("Loading the toolbars was %ssuccessful", success ? "" : "un"); /* maybe an old format, try to migrate: load the old layout, and @@ -217,7 +197,7 @@ ephy_toolbars_model_load (EphyToolbarsModel *model) old_xml = g_build_filename (ephy_dot_dir (), "epiphany-toolbars-2.xml", NULL); - success = egg_toolbars_model_load (eggmodel, old_xml); + success = egg_toolbars_model_load_toolbars (eggmodel, old_xml); g_free (old_xml); if (success == TRUE) @@ -225,7 +205,7 @@ ephy_toolbars_model_load (EphyToolbarsModel *model) old_xml = g_build_filename (ephy_dot_dir (), "epiphany-bookmarksbar.xml", NULL); - egg_toolbars_model_load (eggmodel, old_xml); + egg_toolbars_model_load_toolbars (eggmodel, old_xml); g_free (old_xml); } @@ -239,7 +219,7 @@ ephy_toolbars_model_load (EphyToolbarsModel *model) old_xml = g_build_filename (ephy_dot_dir (), "epiphany-toolbars.xml", NULL); - success = egg_toolbars_model_load (eggmodel, old_xml); + success = egg_toolbars_model_load_toolbars (eggmodel, old_xml); g_free (old_xml); LOG ("Migration was %ssuccessful", success ? "" : "un"); @@ -248,7 +228,7 @@ ephy_toolbars_model_load (EphyToolbarsModel *model) /* Still no success, load the default toolbars */ if (success == FALSE) { - success = egg_toolbars_model_load + success = egg_toolbars_model_load_toolbars (eggmodel, ephy_file ("epiphany-toolbar.xml")); LOG ("Loading the default toolbars was %ssuccessful", success ? "" : "un"); } diff --git a/src/epiphany.defs b/src/epiphany.defs index 9d0b81adb..33157fe16 100644 --- a/src/epiphany.defs +++ b/src/epiphany.defs @@ -1619,18 +1619,27 @@ ; (return-type "EggToolbarsModel*") ;) -(define-method load +(define-method load_names (of-object "EggToolbarsModel") - (c-name "egg_toolbars_model_load") + (c-name "egg_toolbars_model_load_names") (return-type "gboolean") (parameters '("const-char*" "xml_file") ) ) -(define-method save +(define-method load_toolbars + (of-object "EggToolbarsModel") + (c-name "egg_toolbars_model_load_toolbars") + (return-type "gboolean") + (parameters + '("const-char*" "xml_file") + ) +) + +(define-method save_toolbars (of-object "EggToolbarsModel") - (c-name "egg_toolbars_model_save") + (c-name "egg_toolbars_model_save_toolbars") (return-type "none") (parameters '("const-char*" "xml_file") @@ -1676,24 +1685,24 @@ ; ) ;) -(define-method get_avail +(define-method get_name_avail (of-object "EggToolbarsModel") - (c-name "egg_toolbars_model_get_avail") + (c-name "egg_toolbars_model_get_name_avail") (return-type "GPtrArray*") ) -(define-method get_n_avail +(define-method get_name_flags (of-object "EggToolbarsModel") - (c-name "egg_toolbars_model_get_n_avail") + (c-name "egg_toolbars_model_get_name_flags") (return-type "gint") (parameters '("const-char*" "name") ) ) -(define-method set_n_avail +(define-method set_name_flags (of-object "EggToolbarsModel") - (c-name "egg_toolbars_model_set_n_avail") + (c-name "egg_toolbars_model_set_name_flags") (return-type "none") (parameters '("const-char*" "name") |