diff options
author | Diego Escalante Urrelo <diegoe@svn.gnome.org> | 2007-01-03 03:47:49 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2007-01-03 03:47:49 +0800 |
commit | 1885536e41726d40825753019e37c793dc83a70d (patch) | |
tree | 40f50e6726fdb51010ad4ef49011ccbae5c04f92 /src/bookmarks | |
parent | cd3b869d189cc52c08a8807cd03994adc761e5ad (diff) | |
download | gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar.gz gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar.bz2 gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar.lz gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar.xz gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.tar.zst gsoc2013-epiphany-1885536e41726d40825753019e37c793dc83a70d.zip |
Disables "Add Bookmark" in the File menu when bookmarks are locked down.
2007-01-02 Diego Escalante Urrelo <diegoe@svn.gnome.org>
* src/ephy-history-window.c: (ephy_history_window_update_menu):
Disables "Add Bookmark" in the File menu when bookmarks are locked
down.
* src/bookmarks/ephy-bookmark-properties.c: (ephy_bookmark_properties_constructor):
Makes the topics pane insensitive and the rest of entries
non-editables (but sensitive so we can select the text)
when bookmarks are locked down.
* src/bookmarks/ephy-bookmarks-ui.c: (ephy_bookmarks_ui_add_bookmark):
Don't allow the add bookmark ui to appear if it's locked down.
svn path=/trunk/; revision=6778
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/ephy-bookmark-properties.c | 11 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarks-ui.c | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c index acfe01425..bc83675d2 100644 --- a/src/bookmarks/ephy-bookmark-properties.c +++ b/src/bookmarks/ephy-bookmark-properties.c @@ -34,6 +34,10 @@ #include "ephy-state.h" #include "ephy-gui.h" #include "ephy-dnd.h" +#include "ephy-prefs.h" + +#include "eel-gconf-extensions.h" + #include <glib/gi18n.h> #include <gtk/gtkcheckbutton.h> @@ -497,6 +501,7 @@ ephy_bookmark_properties_constructor (GType type, GtkWidget *widget, *table, *label, *entry, *container; GtkWindow *window; GtkDialog *dialog; + gboolean lockdown; const char *tmp; char *text; @@ -526,6 +531,8 @@ ephy_bookmark_properties_constructor (GType type, EPHY_STATE_WINDOW_SAVE_POSITION | EPHY_STATE_WINDOW_SAVE_SIZE); } + /* Lockdown */ + lockdown = eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING); update_window_title (properties); @@ -541,6 +548,7 @@ ephy_bookmark_properties_constructor (GType type, gtk_widget_show (table); entry = gtk_entry_new (); + gtk_entry_set_editable (GTK_ENTRY (entry), !lockdown); tmp = ephy_node_get_property_string (properties->priv->bookmark, EPHY_NODE_BMK_PROP_TITLE); gtk_entry_set_text (GTK_ENTRY (entry), tmp); @@ -557,6 +565,7 @@ ephy_bookmark_properties_constructor (GType type, gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); entry = gtk_entry_new (); + gtk_entry_set_editable (GTK_ENTRY (entry), !lockdown); tmp = ephy_node_get_property_string (properties->priv->bookmark, EPHY_NODE_BMK_PROP_LOCATION); gtk_entry_set_text (GTK_ENTRY (entry), tmp); @@ -572,6 +581,7 @@ ephy_bookmark_properties_constructor (GType type, gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); entry = ephy_topics_entry_new (priv->bookmarks, priv->bookmark); + gtk_entry_set_editable (GTK_ENTRY (entry), !lockdown); priv->entry = entry; gtk_widget_show (entry); label = gtk_label_new_with_mnemonic(_("T_opics:")); @@ -591,6 +601,7 @@ ephy_bookmark_properties_constructor (GType type, NULL); gtk_container_add (GTK_CONTAINER (container), widget); gtk_widget_show (widget); + gtk_widget_set_sensitive (container, !lockdown); gtk_widget_show (container); g_signal_connect (container, "map", G_CALLBACK (list_mapped_cb), properties); g_signal_connect (container, "unmap", G_CALLBACK (list_unmapped_cb), properties); diff --git a/src/bookmarks/ephy-bookmarks-ui.c b/src/bookmarks/ephy-bookmarks-ui.c index 4a8e8a4c4..bab58195f 100644 --- a/src/bookmarks/ephy-bookmarks-ui.c +++ b/src/bookmarks/ephy-bookmarks-ui.c @@ -21,6 +21,7 @@ #include "config.h" +#include "eel-gconf-extensions.h" #include "ephy-bookmarks.h" #include "ephy-bookmarks-ui.h" #include "ephy-bookmarks-menu.h" @@ -43,12 +44,14 @@ #include "ephy-file-helpers.h" #include "ephy-gui.h" #include "ephy-stock-icons.h" +#include "ephy-prefs.h" #include "egg-editable-toolbar.h" #include <string.h> #include <glib/gi18n.h> #include <gtk/gtkmain.h> + #define BM_WINDOW_DATA_KEY "bookmarks-window-data" typedef struct @@ -429,6 +432,9 @@ ephy_bookmarks_ui_add_bookmark (GtkWindow *parent, const char *location, const char *title) { + + if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING)) return; + EphyBookmarks *bookmarks; EphyNode *bookmark; GtkWidget *dialog; |