From 5a1f97224b86f734537637f36d8baa8a942b2f0a Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 9 Jan 2004 09:29:57 +0000 Subject: Add an accellerator-only action (F7) to toggle caret browsing. Hook up 2004-01-09 Christian Persch * data/epiphany.schemas.in: * data/ui/epiphany-ui.xml: * embed/ephy-embed-prefs.h: * embed/mozilla/mozilla-notifiers.cpp: * src/ephy-window.c: (ephy_window_finalize), (browse_with_caret_notifier), (ephy_window_init): * src/pdm-dialog.c: (show_cookies_properties): * src/window-commands.c: (window_cmd_browse_with_caret): * src/window-commands.h: Add an accellerator-only action (F7) to toggle caret browsing. Hook up listener to set the mozilla pref, added the gconf key to the schema. --- src/ephy-window.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 588406b1d..48513c880 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -35,6 +35,7 @@ #include "ephy-shell.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" +#include "ephy-embed-prefs.h" #include "ephy-zoom.h" #include "ephy-debug.h" #include "ephy-file-helpers.h" @@ -240,7 +241,10 @@ static GtkToggleActionEntry ephy_menu_toggle_entries [] = G_CALLBACK (window_cmd_view_statusbar), TRUE }, { "ViewFullscreen", STOCK_FULLSCREEN, N_("_Fullscreen"), "F11", N_("Browse at full screen"), - G_CALLBACK (window_cmd_view_fullscreen), FALSE} + G_CALLBACK (window_cmd_view_fullscreen), FALSE }, + { "BrowseWithCaret", NULL, N_("Selection Caret"), "F7", + "", + G_CALLBACK (window_cmd_browse_with_caret), FALSE } }; static guint ephy_menu_n_toggle_entries = G_N_ELEMENTS (ephy_menu_toggle_entries); @@ -329,6 +333,7 @@ struct EphyWindowPrivate guint show_statusbar_notifier_id; guint hide_menubar_notifier_id; guint disable_save_to_disk_notifier_id; + guint browse_with_caret_notifier_id; }; enum @@ -1740,6 +1745,20 @@ actions_notifier (GConfClient *client, update_actions(window); } +static void +browse_with_caret_notifier (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + EphyWindow *window) +{ + GtkAction *action; + + action = gtk_action_group_get_action (window->priv->action_group, + "BrowseWithCaret"); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), + eel_gconf_get_boolean (CONF_BROWSE_WITH_CARET)); +} + static void ephy_window_init (EphyWindow *window) { @@ -1836,6 +1855,12 @@ ephy_window_init (EphyWindow *window) (CONF_LOCKDOWN_DISABLE_SAVE_TO_DISK, (GConfClientNotifyFunc)actions_notifier, window); + /* other notifiers */ + browse_with_caret_notifier (NULL, 0, NULL, window); + window->priv->browse_with_caret_notifier_id = eel_gconf_notification_add + (CONF_BROWSE_WITH_CARET, + (GConfClientNotifyFunc)browse_with_caret_notifier, window); + /* ensure the UI is updated */ gtk_ui_manager_ensure_update (GTK_UI_MANAGER (window->ui_merge)); @@ -1853,6 +1878,7 @@ ephy_window_finalize (GObject *object) 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_save_to_disk_notifier_id); + eel_gconf_notification_remove (window->priv->browse_with_caret_notifier_id); if (window->priv->find_dialog) { -- cgit v1.2.3