aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-properties.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-26 02:46:54 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-26 02:46:54 +0800
commit95c5dbcfc4214c63c93318344f5b6de091677d5e (patch)
tree56ef3ecaf51b0dc473fd880c6debac7f1b752098 /src/bookmarks/ephy-bookmark-properties.c
parente22d66b927f60c384f96c47aa5d4519ceb4f9c47 (diff)
downloadgsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.gz
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.bz2
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.lz
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.xz
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.tar.zst
gsoc2013-epiphany-95c5dbcfc4214c63c93318344f5b6de091677d5e.zip
Update.
2003-04-25 Marco Pesenti Gritti <marco@it.gnome.org> * lib/egg/egg-toolbars-model.c: * lib/egg/eggtoolbar.c: Update. * src/bookmarks/ephy-bookmark-properties.c: (toolbar_checkbox_changed_cb), (build_ui), (ephy_bookmark_properties_init): * src/bookmarks/ephy-bookmarks-editor.c: (cmd_show_in_the_toolbar), (cmd_delete), (ephy_bookmarks_editor_update_menu), (ephy_bookmarks_editor_init): * src/bookmarks/ephy-bookmarks.h: * src/ephy-toolbars-model.c: (ephy_toolbars_model_new), (get_item_pos), (get_action_name), (get_toolbar_pos), (ephy_toolbars_model_remove_bookmark), (ephy_toolbars_model_add_bookmark), (ephy_toolbars_model_has_bookmark): * src/ephy-toolbars-model.h: Implement the checkbox to add bookmarks to the toolbar.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-properties.c')
-rw-r--r--src/bookmarks/ephy-bookmark-properties.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c
index 9d6fde632..fe2b2df76 100644
--- a/src/bookmarks/ephy-bookmark-properties.c
+++ b/src/bookmarks/ephy-bookmark-properties.c
@@ -54,6 +54,8 @@ struct EphyBookmarkPropertiesPrivate
GtkWidget *title_entry;
GtkWidget *location_entry;
GtkWidget *topics_selector;
+
+ EphyToolbarsModel *tb_model;
};
enum
@@ -215,22 +217,6 @@ bookmark_properties_response_cb (GtkDialog *dialog,
}
static void
-update_checkbox (EphyBookmarkProperties *props, GtkWidget *checkbox, gulong prop)
-{
- GValue value = { 0, };
- gboolean state;
-
- state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
-
- g_value_init (&value, G_TYPE_BOOLEAN);
- g_value_set_boolean (&value, state);
- ephy_node_set_property (props->priv->bookmark,
- prop,
- &value);
- g_value_unset (&value);
-}
-
-static void
update_entry (EphyBookmarkProperties *props, GtkWidget *entry, guint prop)
{
GValue value = { 0, };
@@ -276,7 +262,23 @@ location_entry_changed_cb (GtkWidget *entry, EphyBookmarkProperties *props)
static void
toolbar_checkbox_changed_cb (GtkWidget *checkbox, EphyBookmarkProperties *props)
{
- update_checkbox (props, checkbox, EPHY_NODE_BMK_PROP_SHOW_IN_TOOLBAR);
+ gboolean state;
+ gulong id;
+
+ state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
+
+ id = ephy_node_get_id (props->priv->bookmark);
+
+ if (state)
+ {
+ ephy_toolbars_model_add_bookmark
+ (props->priv->tb_model, FALSE, id);
+ }
+ else
+ {
+ ephy_toolbars_model_remove_bookmark
+ (props->priv->tb_model, FALSE, id);
+ }
}
static void
@@ -317,6 +319,7 @@ build_ui (EphyBookmarkProperties *editor)
char *str;
const char *tmp;
gboolean state;
+ gulong id;
g_signal_connect (G_OBJECT (editor),
"response",
@@ -403,8 +406,8 @@ build_ui (EphyBookmarkProperties *editor)
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
checkbox = gtk_check_button_new_with_mnemonic (_("_Show in the bookmarks toolbar"));
- state = ephy_node_get_property_boolean (editor->priv->bookmark,
- EPHY_NODE_BMK_PROP_SHOW_IN_TOOLBAR);
+ id = ephy_node_get_id (editor->priv->bookmark);
+ state = ephy_toolbars_model_has_bookmark (editor->priv->tb_model, FALSE, id);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), state);
g_signal_connect (checkbox, "toggled",
G_CALLBACK (toolbar_checkbox_changed_cb), editor);
@@ -429,6 +432,7 @@ ephy_bookmark_properties_init (EphyBookmarkProperties *editor)
editor->priv = g_new0 (EphyBookmarkPropertiesPrivate, 1);
editor->priv->bookmark = NULL;
+ editor->priv->tb_model = ephy_shell_get_toolbars_model (ephy_shell);
}
GtkWidget *