aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
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 'src')
-rw-r--r--src/ephy-shell.c22
-rwxr-xr-xsrc/ephy-toolbars-model.c13
-rwxr-xr-xsrc/ephy-toolbars-model.h3
-rwxr-xr-xsrc/toolbar.c36
4 files changed, 32 insertions, 42 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 1975d0f7c..1e4bed077 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -287,7 +287,7 @@ save_toolbars (EggToolbarsModel *model)
char *xml_file;
xml_file = g_build_filename (ephy_dot_dir (),
- "toolbar.xml",
+ "ephy-toolbar.xml",
NULL);
egg_toolbars_model_save (model, xml_file);
g_free (xml_file);
@@ -654,7 +654,27 @@ ephy_shell_get_toolbars_model (EphyShell *gs)
{
if (gs->priv->toolbars_model == NULL)
{
+ char *xml_file;
+ EggToolbarsModel *model;
+
gs->priv->toolbars_model = ephy_toolbars_model_new ();
+ model = EGG_TOOLBARS_MODEL (gs->priv->toolbars_model);
+
+ xml_file = g_build_filename (ephy_dot_dir (),
+ "ephy-toolbar.xml",
+ NULL);
+ if (g_file_test (xml_file, G_FILE_TEST_EXISTS))
+ {
+ egg_toolbars_model_load (model, xml_file);
+ }
+ else
+ {
+ const char *default_xml;
+
+ default_xml = ephy_file ("epiphany-toolbar.xml");
+ egg_toolbars_model_load (model, default_xml);
+ }
+ g_free (xml_file);
}
return gs->priv->toolbars_model;
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index 99d55c295..8c3bc19fc 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -34,8 +34,6 @@ enum
LAST_SIGNAL
};
-static guint ephy_toolbars_model_signals[LAST_SIGNAL] = { 0 };
-
static GObjectClass *parent_class = NULL;
struct EphyToolbarsModelPrivate
@@ -108,9 +106,6 @@ impl_add_item (EggToolbarsModel *t,
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);
@@ -130,14 +125,6 @@ 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
diff --git a/src/ephy-toolbars-model.h b/src/ephy-toolbars-model.h
index dd84859f2..0f1de55ad 100755
--- a/src/ephy-toolbars-model.h
+++ b/src/ephy-toolbars-model.h
@@ -44,9 +44,6 @@ struct EphyToolbarsModel
struct EphyToolbarsModelClass
{
EggToolbarsModelClass parent_class;
-
- void (* action_added) (EggToolbarsModel *group,
- char *action_name);
};
GType ephy_toolbars_model_get_type (void);
diff --git a/src/toolbar.c b/src/toolbar.c
index 4f4203874..631bc94c2 100755
--- a/src/toolbar.c
+++ b/src/toolbar.c
@@ -311,11 +311,11 @@ toolbar_setup_actions (Toolbar *t)
}
static void
-action_added_cb (EphyToolbarsModel *model,
- char *action_name,
- Toolbar *t)
+action_request_cb (EggEditableToolbar *etoolbar,
+ char *action_name,
+ gpointer data)
{
- toolbar_ensure_action (t, action_name);
+ toolbar_ensure_action (TOOLBAR (etoolbar), action_name);
}
static void
@@ -342,6 +342,9 @@ init_bookmarks_toolbar (Toolbar *t)
(EGG_EDITABLE_TOOLBAR (t),
drag_targets, n_drag_targets,
t_name);
+ egg_toolbars_model_set_flags
+ (EGG_TOOLBARS_MODEL (model),
+ i, EGG_TB_MODEL_NOT_REMOVABLE);
}
}
}
@@ -350,7 +353,6 @@ static void
toolbar_set_window (Toolbar *t, EphyWindow *window)
{
EphyToolbarsModel *model;
- char *xml_file;
g_return_if_fail (t->priv->window == NULL);
@@ -361,27 +363,11 @@ toolbar_set_window (Toolbar *t, EphyWindow *window)
egg_menu_merge_insert_action_group (t->priv->ui_merge,
t->priv->action_group, 1);
- model = ephy_shell_get_toolbars_model (ephy_shell);
- g_return_if_fail (model != NULL);
- g_signal_connect_object (model, "action_added",
- G_CALLBACK (action_added_cb),
- t, 0);
-
- xml_file = g_build_filename (ephy_dot_dir (),
- "toolbar.xml",
- NULL);
- if (g_file_test (xml_file, G_FILE_TEST_EXISTS))
- {
- egg_toolbars_model_load
- (EGG_TOOLBARS_MODEL (model), xml_file);
- }
- else
- {
- egg_toolbars_model_load (EGG_TOOLBARS_MODEL (model),
- ephy_file ("epiphany-toolbar.xml"));
- }
- g_free (xml_file);
+ g_signal_connect (t, "action_request",
+ G_CALLBACK (action_request_cb),
+ NULL);
+ model = ephy_shell_get_toolbars_model (ephy_shell);
g_object_set (G_OBJECT (t),
"ToolbarsModel", model,
"MenuMerge", t->priv->ui_merge,