aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorChris Lahey <clahey@src.gnome.org>2004-01-10 04:49:11 +0800
committerChris Lahey <clahey@src.gnome.org>2004-01-10 04:49:11 +0800
commit1743162eef31aab9bb28a2c8201240e7dc4bd1cd (patch)
tree46addc66c3d524ccd4adddac135385b44c390852 /src/ephy-window.c
parentfd4119bf05f970c82fda53fe0deff9dc440d8f5b (diff)
downloadgsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar.gz
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar.bz2
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar.lz
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar.xz
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.tar.zst
gsoc2013-epiphany-1743162eef31aab9bb28a2c8201240e7dc4bd1cd.zip
Added disable_bookmark_editing key.
* data/epiphany-lockdown.schemas.in, lib/ephy-prefs.h: Added disable_bookmark_editing key. * lib/ephy-node-db.c, ephy-node-db.h, ephy-node.c: Added immutable property. * lib/egg/egg-editable-toolbar.c (drag_data_received_cb, toolbar_drag_motion_cb), src/ephy-toolbars-model.c (impl_get_item_id): Made these handle immutable models/node_dbs. * src/ephy-automation.c, src/ephy-session.c: Don't show the bookmark editor if disabled. * src/ephy-window.c: Disable a bunch of menus if bookmark editing is disabled. * src/bookmarks/ephy-bookmarks-import.c, src/bookmarks/ephy-bookmarks.c: Disable bookmark editing and importing is key is set. Uses immutable property.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 48513c880..f66d4119d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -333,6 +333,7 @@ struct EphyWindowPrivate
guint show_statusbar_notifier_id;
guint hide_menubar_notifier_id;
guint disable_save_to_disk_notifier_id;
+ guint disable_bookmark_editing_notifier_id;
guint browse_with_caret_notifier_id;
};
@@ -1695,7 +1696,7 @@ update_actions (EphyWindow *window)
GtkActionGroup *action_group = GTK_ACTION_GROUP (window->priv->action_group);
GtkActionGroup *popups_action_group = GTK_ACTION_GROUP (window->priv->popups_action_group);
GtkAction *action;
- gboolean save_to_disk;
+ gboolean bookmarks_editable, save_to_disk;
action = gtk_action_group_get_action (action_group, "ViewToolbar");
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
@@ -1712,6 +1713,16 @@ update_actions (EphyWindow *window)
eel_gconf_get_boolean (CONF_WINDOWS_SHOW_STATUSBAR));
g_object_set (action, "sensitive", eel_gconf_key_is_writable (CONF_WINDOWS_SHOW_STATUSBAR), NULL);
+ bookmarks_editable = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING);
+ action = gtk_action_group_get_action (action_group, "GoBookmarks");
+ g_object_set (action, "sensitive", bookmarks_editable, NULL);
+ action = gtk_action_group_get_action (action_group, "FileBookmarkPage");
+ g_object_set (action, "sensitive", bookmarks_editable, NULL);
+ action = gtk_action_group_get_action (popups_action_group, "ContextBookmarkPage");
+ g_object_set (action, "sensitive", bookmarks_editable, NULL);
+ action = gtk_action_group_get_action (popups_action_group, "BookmarkLink");
+ g_object_set (action, "sensitive", bookmarks_editable, NULL);
+
save_to_disk = !eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_SAVE_TO_DISK);
action = gtk_action_group_get_action (action_group, "FileSaveAs");
g_object_set (action, "sensitive", save_to_disk, NULL);
@@ -1851,6 +1862,10 @@ ephy_window_init (EphyWindow *window)
(CONF_LOCKDOWN_HIDE_MENUBAR,
(GConfClientNotifyFunc)chrome_notifier, window);
+ window->priv->disable_bookmark_editing_notifier_id = eel_gconf_notification_add
+ (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING,
+ (GConfClientNotifyFunc)actions_notifier, window);
+
window->priv->disable_save_to_disk_notifier_id = eel_gconf_notification_add
(CONF_LOCKDOWN_DISABLE_SAVE_TO_DISK,
(GConfClientNotifyFunc)actions_notifier, window);
@@ -1877,6 +1892,7 @@ ephy_window_finalize (GObject *object)
eel_gconf_notification_remove (window->priv->show_bookmarks_bar_notifier_id);
eel_gconf_notification_remove (window->priv->show_statusbar_notifier_id);
eel_gconf_notification_remove (window->priv->hide_menubar_notifier_id);
+ eel_gconf_notification_remove (window->priv->disable_bookmark_editing_notifier_id);
eel_gconf_notification_remove (window->priv->disable_save_to_disk_notifier_id);
eel_gconf_notification_remove (window->priv->browse_with_caret_notifier_id);