aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-01-09 17:29:57 +0800
committerChristian Persch <chpe@src.gnome.org>2004-01-09 17:29:57 +0800
commit5a1f97224b86f734537637f36d8baa8a942b2f0a (patch)
tree37e7bedf154f702ce67d74297e6672606816e543 /src/ephy-window.c
parentd5db5ec63e219c783c64daf03dd80cd91351b9cc (diff)
downloadgsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar.gz
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar.bz2
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar.lz
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar.xz
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.tar.zst
gsoc2013-epiphany-5a1f97224b86f734537637f36d8baa8a942b2f0a.zip
Add an accellerator-only action (F7) to toggle caret browsing. Hook up
2004-01-09 Christian Persch <chpe@cvs.gnome.org> * 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.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c28
1 files changed, 27 insertions, 1 deletions
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
@@ -1741,6 +1746,20 @@ actions_notifier (GConfClient *client,
}
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)
{
EphyExtension *manager;
@@ -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)
{