diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-07-25 03:34:54 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-07-25 03:34:54 +0800 |
commit | 095010d768b454906d6029fc0403580585527e51 (patch) | |
tree | 2099f34d6168da1987aff944465e477bc68dbf83 | |
parent | 3f67020b032c7307fdc8d66777c808f75a2c4016 (diff) | |
download | gsoc2013-epiphany-095010d768b454906d6029fc0403580585527e51.tar.gz gsoc2013-epiphany-095010d768b454906d6029fc0403580585527e51.tar.zst gsoc2013-epiphany-095010d768b454906d6029fc0403580585527e51.zip |
Add page security info dialogue from Certificates extension.
2006-07-24 Christian Persch <chpe@cvs.gnome.org>
* data/ui/epiphany-ui.xml:
* src/ephy-statusbar.c: (ephy_statusbar_class_init),
(padlock_button_press_cb), (create_statusbar_security_icon):
* src/ephy-statusbar.h:
* src/ephy-window.c: (ephy_window_constructor):
* src/window-commands.c: (window_cmd_view_page_security_info),
(window_cmd_help_about):
* src/window-commands.h:
Add page security info dialogue from Certificates extension.
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | data/ui/epiphany-ui.xml | 1 | ||||
-rwxr-xr-x | src/ephy-statusbar.c | 43 | ||||
-rw-r--r-- | src/ephy-statusbar.h | 3 | ||||
-rw-r--r-- | src/ephy-window.c | 43 | ||||
-rw-r--r-- | src/window-commands.c | 16 | ||||
-rw-r--r-- | src/window-commands.h | 3 |
7 files changed, 115 insertions, 14 deletions
@@ -1,3 +1,23 @@ +2006-07-24 Christian Persch <chpe@cvs.gnome.org> + + * data/ui/epiphany-ui.xml: + * src/ephy-statusbar.c: (ephy_statusbar_class_init), + (padlock_button_press_cb), (create_statusbar_security_icon): + * src/ephy-statusbar.h: + * src/ephy-window.c: (ephy_window_constructor): + * src/window-commands.c: (window_cmd_view_page_security_info), + (window_cmd_help_about): + * src/window-commands.h: + + Add page security info dialogue from Certificates extension. + +2006-07-24 Christian Persch <chpe@cvs.gnome.org> + + * lib/widgets/ephy-location-entry.c: (match_selected_cb): + + Reset IM context before activation. Bug #348478, patch by + Nguyễn Thái Ngọc Duy. + 2006-07-23 Jean-François Rameau <jframeau@cvs.gnome.org> * embed/mozilla/Makefile.am: diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml index c887ca7c6..001c034ae 100644 --- a/data/ui/epiphany-ui.xml +++ b/data/ui/epiphany-ui.xml @@ -60,6 +60,7 @@ <placeholder name="ViewEncodingPlaceholder"/> </menu> <menuitem name="ViewPageSourceMenu" action="ViewPageSource"/> + <menuitem action="ViewPageSecurityInfo"/> <separator name="ViewSep4"/> <menuitem name="ViewStopMenu" action="ViewStop"/> <menuitem name="ViewReloadMenu" action="ViewReload"/> diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index 44bc5b029..c5dab348f 100755 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -38,8 +38,6 @@ static void ephy_statusbar_class_init (EphyStatusbarClass *klass); static void ephy_statusbar_init (EphyStatusbar *t); static void ephy_statusbar_finalize (GObject *object); -static GObjectClass *parent_class = NULL; - #define EPHY_STATUSBAR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_STATUSBAR, EphyStatusbarPrivate)) struct _EphyStatusbarPrivate @@ -54,6 +52,15 @@ struct _EphyStatusbarPrivate GtkWidget *popups_manager_evbox; }; +enum +{ + LOCK_CLICKED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL]; +static GObjectClass *parent_class; + GType ephy_statusbar_get_type (void) { @@ -91,6 +98,17 @@ ephy_statusbar_class_init (EphyStatusbarClass *klass) object_class->finalize = ephy_statusbar_finalize; + signals[LOCK_CLICKED] = + g_signal_new + ("lock-clicked", + EPHY_TYPE_STATUSBAR, + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (EphyStatusbarClass, lock_clicked), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + g_type_class_add_private (object_class, sizeof (EphyStatusbarPrivate)); } @@ -126,6 +144,23 @@ create_caret_indicator (EphyStatusbar *statusbar) FALSE, FALSE, 0); } +static gboolean +padlock_button_press_cb (GtkWidget *ebox, + GdkEventButton *event, + EphyStatusbar *statusbar) +{ + if (event->type == GDK_BUTTON_PRESS && + event->button == 1 /* left */ && + (event->state & gtk_accelerator_get_default_mod_mask ()) == 0) + { + g_signal_emit (statusbar, signals[LOCK_CLICKED], 0); + + return TRUE; + } + + return FALSE; +} + static void create_statusbar_security_icon (EphyStatusbar *s) { @@ -137,6 +172,10 @@ create_statusbar_security_icon (EphyStatusbar *s) s->priv->security_evbox = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (s->priv->security_evbox), FALSE); + gtk_widget_add_events (s->priv->security_evbox, GDK_BUTTON_PRESS_MASK); + g_signal_connect (s->priv->security_evbox, "button-press-event", + G_CALLBACK (padlock_button_press_cb), s); + gtk_container_add (GTK_CONTAINER (s->security_frame), GTK_WIDGET (s->priv->security_evbox)); gtk_container_add (GTK_CONTAINER (s->priv->security_evbox), diff --git a/src/ephy-statusbar.h b/src/ephy-statusbar.h index 6db674193..9a71e0e05 100644 --- a/src/ephy-statusbar.h +++ b/src/ephy-statusbar.h @@ -55,6 +55,9 @@ struct _EphyStatusbar struct _EphyStatusbarClass { GtkStatusbarClass parent_class; + + /* Signals */ + void (* lock_clicked) (EphyStatusbar *statusbar); }; GType ephy_statusbar_get_type (void); diff --git a/src/ephy-window.c b/src/ephy-window.c index 332c5dcfb..166b4b9c3 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -223,6 +223,9 @@ static const GtkActionEntry ephy_menu_entries [] = { { "ViewPageSource", STOCK_VIEW_SOURCE, N_("_Page Source"), "<control>U", N_("View the source code of the page"), G_CALLBACK (window_cmd_view_page_source) }, + { "ViewPageSecurityInfo", NULL, N_("Page _Security Information..."), NULL, + N_("Display security information for the web page"), + G_CALLBACK (window_cmd_view_page_security_info) }, /* Bookmarks menu */ @@ -656,32 +659,38 @@ sync_chromes_visibility (EphyWindow *window) static void ephy_window_fullscreen (EphyWindow *window) { + EphyWindowPrivate *priv = window->priv; GtkWidget *popup; EphyTab *tab; + GtkAction *action; gboolean lockdown_fs; - window->priv->fullscreen_mode = TRUE; + priv->fullscreen_mode = TRUE; lockdown_fs = eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN); popup = ephy_fullscreen_popup_new (window); ephy_fullscreen_popup_set_show_leave (EPHY_FULLSCREEN_POPUP (popup), !lockdown_fs); - window->priv->fullscreen_popup = popup; + priv->fullscreen_popup = popup; g_signal_connect_swapped (popup, "exit-clicked", G_CALLBACK (exit_fullscreen_clicked_cb), window); + action = gtk_action_group_get_action (priv->action_group, "ViewPageSecurityInfo"); + g_signal_connect_swapped (popup, "lock-clicked", + G_CALLBACK (gtk_action_activate), action); + /* sync status */ tab = ephy_window_get_active_tab (window); sync_tab_load_status (tab, NULL, window); sync_tab_security (tab, NULL, window); egg_editable_toolbar_set_model - (EGG_EDITABLE_TOOLBAR (window->priv->toolbar), + (EGG_EDITABLE_TOOLBAR (priv->toolbar), EGG_TOOLBARS_MODEL ( ephy_shell_get_toolbars_model (ephy_shell, TRUE))); - ephy_toolbar_set_show_leave_fullscreen (window->priv->toolbar, + ephy_toolbar_set_show_leave_fullscreen (priv->toolbar, !lockdown_fs); sync_chromes_visibility (window); @@ -1460,8 +1469,11 @@ sync_tab_navigation (EphyTab *tab, } static void -sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) +sync_tab_security (EphyTab *tab, + GParamSpec *pspec, + EphyWindow *window) { + EphyWindowPrivate *priv = window->priv; EphyEmbed *embed; EphyEmbedSecurityLevel level; char *description = NULL; @@ -1469,8 +1481,9 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) char *tooltip; const char *stock_id = STOCK_LOCK_INSECURE; gboolean show_lock = FALSE, is_secure = FALSE; + GtkAction *action; - if (window->priv->closing) return; + if (priv->closing) return; embed = ephy_tab_get_embed (tab); @@ -1526,19 +1539,22 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) g_free (tmp); } - ephy_statusbar_set_security_state (EPHY_STATUSBAR (window->priv->statusbar), + ephy_statusbar_set_security_state (EPHY_STATUSBAR (priv->statusbar), stock_id, tooltip); - ephy_toolbar_set_security_state (window->priv->toolbar, is_secure, + ephy_toolbar_set_security_state (priv->toolbar, is_secure, show_lock, stock_id, tooltip); - if (window->priv->fullscreen_popup != NULL) + if (priv->fullscreen_popup != NULL) { ephy_fullscreen_popup_set_security_state - (EPHY_FULLSCREEN_POPUP (window->priv->fullscreen_popup), + (EPHY_FULLSCREEN_POPUP (priv->fullscreen_popup), show_lock, stock_id, tooltip); } + action = gtk_action_group_get_action (priv->action_group, "ViewPageSecurityInfo"); + gtk_action_set_sensitive (action, is_secure); + g_free (tooltip); } @@ -3169,6 +3185,13 @@ ephy_window_constructor (GType type, action = gtk_action_group_get_action (priv->popups_action_group, "OpenLinkInNewTab"); ephy_action_change_sensitivity_flags (action, SENS_FLAG_CHROME, priv->is_popup); + /* Connect lock clicks */ + action = gtk_action_group_get_action (priv->action_group, "ViewPageSecurityInfo"); + g_signal_connect_swapped (priv->statusbar, "lock-clicked", + G_CALLBACK (gtk_action_activate), action); + g_signal_connect_swapped (priv->toolbar, "lock-clicked", + G_CALLBACK (gtk_action_activate), action); + /* ensure the UI is updated */ gtk_ui_manager_ensure_update (priv->manager); diff --git a/src/window-commands.c b/src/window-commands.c index 471d72d5d..46dee486b 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -637,6 +637,18 @@ window_cmd_view_page_source (GtkAction *action, } void +window_cmd_view_page_security_info (GtkAction *action, + EphyWindow *window) +{ + EphyEmbed *embed; + + embed = ephy_window_get_active_embed (window); + g_return_if_fail (EPHY_IS_EMBED (embed)); + + ephy_embed_show_page_certificate (embed); +} + +void window_cmd_go_history (GtkAction *action, EphyWindow *window) { @@ -720,8 +732,6 @@ window_cmd_help_about (GtkAction *action, GtkWidget *window) { const char * const authors[] = { - "Marco Pesenti Gritti", - "Adam Hooper", "Xan Lopez", "Christian Persch", "Jean-François Rameau", @@ -735,7 +745,9 @@ window_cmd_help_about (GtkAction *action, "Raphaël Slinckx", "", _("Past developers:"), + "Marco Pesenti Gritti", "David Bordoley", + "Adam Hooper", NULL, }; const char * const documenters[] = { diff --git a/src/window-commands.h b/src/window-commands.h index fa8607808..1bafbc460 100644 --- a/src/window-commands.h +++ b/src/window-commands.h @@ -118,6 +118,9 @@ void window_cmd_view_zoom_normal(GtkAction *action, void window_cmd_view_page_source(GtkAction *action, EphyWindow *window); +void window_cmd_view_page_security_info (GtkAction *action, + EphyWindow *window); + void window_cmd_go_history (GtkAction *action, EphyWindow *window); |