diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-10-07 02:28:55 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-10-07 02:28:55 +0800 |
commit | c3422e72c44eb2999de994b8151ec2db2e591631 (patch) | |
tree | 95365fcd667709b2abcd86082fadec4fc3d3c037 /src | |
parent | 91edd219e3e228dfaa559d524401aceed31329c7 (diff) | |
download | gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar.gz gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar.bz2 gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar.lz gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar.xz gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.tar.zst gsoc2013-epiphany-c3422e72c44eb2999de994b8151ec2db2e591631.zip |
Add style properties for 'secure-[bg|fg]-color', and apply them when the
2005-10-06 Christian Persch <chpe@cvs.gnome.org>
* lib/widgets/ephy-location-entry.c:
(ephy_location_entry_style_set), (ephy_location_entry_class_init),
(ephy_location_entry_set_favicon),
(ephy_location_entry_set_secure):
* lib/widgets/ephy-location-entry.h:
Add style properties for 'secure-[bg|fg]-color', and apply them when
the entry is in 'secure' mode. Reset the IM context before emitting
the 'activate' signal.
* src/ephy-location-action.c: (sync_secure), (connect_proxy),
(ephy_location_action_set_property),
(ephy_location_action_get_property),
(ephy_location_action_class_init):
* src/ephy-toolbar.c: (ephy_toolbar_set_security_state),
(ephy_toolbar_init):
* src/ephy-toolbar.h:
* src/ephy-window.c: (sync_chromes_visibility),
(sync_tab_security):
Set the location entry's 'secure' property on secure sites,
and also always show the lock for secure sites.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-location-action.c | 31 | ||||
-rwxr-xr-x | src/ephy-toolbar.c | 10 | ||||
-rw-r--r-- | src/ephy-toolbar.h | 1 | ||||
-rw-r--r-- | src/ephy-window.c | 7 |
4 files changed, 44 insertions, 5 deletions
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index 4cce221cf..c3c0b4109 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -50,6 +50,7 @@ struct _EphyLocationActionPrivate char *lock_tooltip; guint editable : 1; guint show_lock : 1; + guint secure : 1; }; static void ephy_location_action_init (EphyLocationAction *action); @@ -69,6 +70,7 @@ enum PROP_ICON, PROP_LOCK_STOCK, PROP_LOCK_TOOLTIP, + PROP_SECURE, PROP_SHOW_LOCK, PROP_WINDOW }; @@ -267,6 +269,18 @@ sync_lock_tooltip (GtkAction *gaction, } static void +sync_secure (GtkAction *gaction, + GParamSpec *pspec, + GtkWidget *proxy) +{ + EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction); + EphyLocationActionPrivate *priv = action->priv; + EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy); + + ephy_location_entry_set_secure (entry, priv->secure); +} + +static void sync_show_lock (GtkAction *gaction, GParamSpec *pspec, GtkWidget *proxy) @@ -387,6 +401,9 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) sync_lock_tooltip (action, NULL, proxy); g_signal_connect_object (action, "notify::lock-tooltip", G_CALLBACK (sync_lock_tooltip), proxy, 0); + sync_secure (action, NULL, proxy); + g_signal_connect_object (action, "notify::secure", + G_CALLBACK (sync_secure), proxy, 0); sync_show_lock (action, NULL, proxy); g_signal_connect_object (action, "notify::show-lock", G_CALLBACK (sync_show_lock), proxy, 0); @@ -461,6 +478,9 @@ ephy_location_action_set_property (GObject *object, g_free (priv->lock_tooltip); priv->lock_tooltip = g_value_dup_string (value); break; + case PROP_SECURE: + priv->secure = g_value_get_boolean (value); + break; case PROP_SHOW_LOCK: priv->show_lock = g_value_get_boolean (value); break; @@ -496,6 +516,9 @@ ephy_location_action_get_property (GObject *object, case PROP_LOCK_TOOLTIP: g_value_set_string (value, priv->lock_tooltip); break; + case PROP_SECURE: + g_value_set_boolean (value, priv->secure); + break; case PROP_SHOW_LOCK: g_value_set_boolean (value, priv->show_lock); break; @@ -571,6 +594,14 @@ ephy_location_action_class_init (EphyLocationActionClass *class) G_PARAM_READWRITE)); g_object_class_install_property (object_class, + PROP_SECURE, + g_param_spec_boolean ("secure", + "Secure", + "Secure", + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_SHOW_LOCK, g_param_spec_boolean ("show-lock", "Show Lock", diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c index eb8691fae..1e6e8a0e1 100755 --- a/src/ephy-toolbar.c +++ b/src/ephy-toolbar.c @@ -78,6 +78,7 @@ struct _EphyToolbarPrivate gulong set_focus_handler; gboolean updating_address; gboolean show_lock; + gboolean is_secure; gboolean lock_visible; gboolean leave_fullscreen_visible; gboolean spinning; @@ -471,6 +472,7 @@ ephy_toolbar_set_navigation_actions (EphyToolbar *toolbar, void ephy_toolbar_set_security_state (EphyToolbar *toolbar, + gboolean is_secure, gboolean show_lock, const char *stock_id, const char *tooltip) @@ -478,11 +480,13 @@ ephy_toolbar_set_security_state (EphyToolbar *toolbar, EphyToolbarPrivate *priv = toolbar->priv; priv->show_lock = show_lock; + priv->is_secure = is_secure; g_object_set (priv->actions[LOCATION_ACTION], "lock-stock-id", stock_id, "lock-tooltip", tooltip, "show-lock", priv->lock_visible && priv->show_lock, + "secure", is_secure, NULL); } @@ -588,7 +592,11 @@ ephy_toolbar_hide (GtkWidget *widget) static void ephy_toolbar_init (EphyToolbar *toolbar) { - toolbar->priv = EPHY_TOOLBAR_GET_PRIVATE (toolbar); + EphyToolbarPrivate *priv; + + priv = toolbar->priv = EPHY_TOOLBAR_GET_PRIVATE (toolbar); + + priv->lock_visible = TRUE; } static GObject * diff --git a/src/ephy-toolbar.h b/src/ephy-toolbar.h index 2c349c5c0..026588448 100644 --- a/src/ephy-toolbar.h +++ b/src/ephy-toolbar.h @@ -85,6 +85,7 @@ void ephy_toolbar_set_navigation_actions (EphyToolbar *toolbar, gboolean up); void ephy_toolbar_set_security_state (EphyToolbar *toolbar, + gboolean is_secure, gboolean show_lock, const char *stock_id, const char *tooltip); diff --git a/src/ephy-window.c b/src/ephy-window.c index 04fa156b9..3dfdb4c39 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -592,8 +592,6 @@ sync_chromes_visibility (EphyWindow *window) g_object_set (priv->bookmarksbar, "visible", show_bookmarksbar, NULL); g_object_set (priv->statusbar, "visible", show_statusbar, NULL); - ephy_toolbar_set_lock_visibility (priv->toolbar, !show_statusbar); - ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (priv->notebook), show_tabsbar); if (priv->fullscreen_popup != NULL) @@ -1307,7 +1305,7 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) char *state = NULL; char *tooltip; const char *stock_id = STOCK_LOCK_INSECURE; - gboolean show_lock = FALSE; + gboolean show_lock = FALSE, is_secure = FALSE; if (window->priv->closing) return; @@ -1344,6 +1342,7 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) state = _("High"); stock_id = STOCK_LOCK_SECURE; show_lock = TRUE; + is_secure = TRUE; break; default: g_assert_not_reached (); @@ -1363,7 +1362,7 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) ephy_statusbar_set_security_state (EPHY_STATUSBAR (window->priv->statusbar), stock_id, tooltip); - ephy_toolbar_set_security_state (window->priv->toolbar, + ephy_toolbar_set_security_state (window->priv->toolbar, is_secure, show_lock, stock_id, tooltip); if (window->priv->fullscreen_popup != NULL) |