aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-toolbars-model.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-25 23:23:09 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-25 23:23:09 +0800
commit7fcf1690b730892033993c1001c08666448f90b1 (patch)
treee1080fc2e0b87abacd9fee7aec64d377ab525bdf /src/ephy-toolbars-model.c
parent33a47e1d4cc08edd1006d3bfd85b7a15d350119d (diff)
downloadgsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.gz
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.bz2
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.lz
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.xz
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.zst
gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.zip
Get back toolbar editing functionalities. More work on the bookmarks
2003-04-25 Marco Pesenti Gritti <marco@it.gnome.org> * data/ui/epiphany-toolbar.xml.in: * data/ui/epiphany-ui.xml.in: * lib/egg/egg-editable-toolbar.c: (egg_editable_toolbar_hide), (egg_editable_toolbar_set_drag_dest): * lib/egg/egg-editable-toolbar.h: * src/bookmarks/ephy-topic-action.c: (create_tool_item): * src/ephy-shell.c: (save_toolbars), (ephy_shell_finalize), (ephy_shell_get_toolbars_model): * src/ephy-toolbars-model.c: (impl_add_item), (ephy_toolbars_model_class_init): * src/ephy-toolbars-model.h: * src/ephy-window.c: (ephy_window_set_chrome): * src/toolbar.c: (ensure_bookmark_action), (toolbar_ensure_action), (action_added_cb), (init_bookmarks_toolbar), (toolbar_set_window), (toolbar_new), (toolbar_set_visibility): * src/toolbar.h: * src/window-commands.c: (toolbar_editor_destroy_cb), (window_cmd_edit_toolbar): Get back toolbar editing functionalities. More work on the bookmarks toolbars implementation. The toolbars context menus are regressed but it's not my fault :/ The signal on EggToolbar is borked.
Diffstat (limited to 'src/ephy-toolbars-model.c')
-rwxr-xr-xsrc/ephy-toolbars-model.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index da842e719..c67d427e3 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -26,6 +26,14 @@ static void ephy_toolbars_model_class_init (EphyToolbarsModelClass *klass);
static void ephy_toolbars_model_init (EphyToolbarsModel *t);
static void ephy_toolbars_model_finalize (GObject *object);
+enum
+{
+ ACTION_ADDED,
+ LAST_SIGNAL
+};
+
+static guint ephy_toolbars_model_signals[LAST_SIGNAL] = { 0 };
+
static GObjectClass *parent_class = NULL;
struct EphyToolbarsModelPrivate
@@ -68,7 +76,10 @@ impl_add_item (EggToolbarsModel *t,
const char *name)
{
EphyBookmarks *bookmarks;
- char *res = NULL;
+ char *action_name = NULL;
+ const char *res;
+
+ LOG ("Add item %s", name)
bookmarks = ephy_shell_get_bookmarks (ephy_shell);
@@ -79,24 +90,27 @@ impl_add_item (EggToolbarsModel *t,
nodes = ephy_dnd_node_list_extract_nodes (name);
id = ephy_node_get_id (EPHY_NODE (nodes->data));
- res = g_strdup_printf ("GoTopicId%d", id);
+ action_name = g_strdup_printf ("GoTopicId%d", id);
g_list_free (nodes);
}
- else if (gdk_atom_intern (EPHY_DND_TOPIC_TYPE, FALSE) == type)
+ else if (gdk_atom_intern (EPHY_DND_BOOKMARK_TYPE, FALSE) == type)
{
GList *nodes;
int id;
nodes = ephy_dnd_node_list_extract_nodes (name);
id = ephy_node_get_id (EPHY_NODE (nodes->data));
- res = g_strdup_printf ("GoBookmarkId%d", id);
+ action_name = g_strdup_printf ("GoBookmarkId%d", id);
g_list_free (nodes);
}
- else
- {
- EGG_TOOLBARS_MODEL_CLASS (parent_class)->add_item
- (t, toolbar_position, position, type, name);
- }
+
+ res = action_name ? action_name : name;
+
+ g_signal_emit (G_OBJECT (t),
+ ephy_toolbars_model_signals[ACTION_ADDED], 0, res);
+
+ EGG_TOOLBARS_MODEL_CLASS (parent_class)->add_item
+ (t, toolbar_position, position, type, res);
return res;
}
@@ -114,6 +128,14 @@ ephy_toolbars_model_class_init (EphyToolbarsModelClass *klass)
object_class->finalize = ephy_toolbars_model_finalize;
etm_class->add_item = impl_add_item;
+
+ ephy_toolbars_model_signals[ACTION_ADDED] =
+ g_signal_new ("action_added",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EphyToolbarsModelClass, action_added),
+ NULL, NULL, g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
}
static void