diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-01-09 17:29:57 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-01-09 17:29:57 +0800 |
commit | 5a1f97224b86f734537637f36d8baa8a942b2f0a (patch) | |
tree | 37e7bedf154f702ce67d74297e6672606816e543 | |
parent | d5db5ec63e219c783c64daf03dd80cd91351b9cc (diff) | |
download | gsoc2013-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.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | data/epiphany.schemas.in | 11 | ||||
-rw-r--r-- | data/ui/epiphany-ui.xml | 2 | ||||
-rw-r--r-- | embed/ephy-embed-prefs.h | 1 | ||||
-rw-r--r-- | embed/mozilla/mozilla-notifiers.cpp | 1 | ||||
-rw-r--r-- | src/ephy-window.c | 28 | ||||
-rw-r--r-- | src/window-commands.c | 10 | ||||
-rw-r--r-- | src/window-commands.h | 2 |
8 files changed, 69 insertions, 1 deletions
@@ -1,3 +1,18 @@ +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. + 2004-01-09 Roozbeh Pournader <roozbeh@sharif.edu> * lib/ephy-state.c: Fixed a logic error in using & instead of && diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in index c98dbd080..0d33cdc41 100644 --- a/data/epiphany.schemas.in +++ b/data/epiphany.schemas.in @@ -484,5 +484,16 @@ <long>Enable JavaScript.</long> </locale> </schema> + <schema> + <key>/schemas/apps/epiphany/web/browse_with_caret</key> + <applyto>/apps/epiphany/web/browse_with_caret</applyto> + <owner>epiphany</owner> + <type>bool</type> + <default>false</default> + <locale name="C"> + <short>Browse with caret</short> + <long>Use caret browsing mode.</long> + </locale> + </schema> </schemalist> </gconfschemafile> diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml index 12c0dbbe4..a4b862072 100644 --- a/data/ui/epiphany-ui.xml +++ b/data/ui/epiphany-ui.xml @@ -163,4 +163,6 @@ <menuitem name="CopyImageLocationILP" action="CopyImageLocation"/> </popup> +<accelerator name="BrowseWithCaretAccel" action="BrowseWithCaret"/> + </ui> diff --git a/embed/ephy-embed-prefs.h b/embed/ephy-embed-prefs.h index 33b86da97..090770724 100644 --- a/embed/ephy-embed-prefs.h +++ b/embed/ephy-embed-prefs.h @@ -12,6 +12,7 @@ #define CONF_SECURITY_COOKIES_ACCEPT "/apps/epiphany/web/cookie_accept" #define CONF_LANGUAGE_AUTODETECT_ENCODING "/apps/epiphany/web/autodetect_encoding" #define CONF_LANGUAGE_DEFAULT_ENCODING "/apps/epiphany/web/default_encoding" +#define CONF_BROWSE_WITH_CARET "/apps/epiphany/web/browse_with_caret" /* These are defined gnome wide now */ #define CONF_NETWORK_PROXY_MODE "/system/proxy/mode" diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp index 3a0314ddf..cb0deec5a 100644 --- a/embed/mozilla/mozilla-notifiers.cpp +++ b/embed/mozilla/mozilla-notifiers.cpp @@ -151,6 +151,7 @@ conversion_table [] = { CONF_NETWORK_SOCKS_PROXY_PORT, INT_PREF, "network.proxy.socks_port" }, { CONF_LANGUAGE_DEFAULT_ENCODING, STRING_PREF, "intl.charset.default" }, { CONF_LANGUAGE_AUTODETECT_ENCODING, STRING_PREF, "intl.charset.detector" }, + { CONF_BROWSE_WITH_CARET, BOOL_PREF, "accessibility.browsewithcaret" }, { NULL, 0, NULL } }; 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) { diff --git a/src/window-commands.c b/src/window-commands.c index 4b809321c..bb98bf12e 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -31,6 +31,7 @@ #include "print-dialog.h" #include "eel-gconf-extensions.h" #include "ephy-prefs.h" +#include "ephy-embed-prefs.h" #include "ephy-dialog.h" #include "ephy-bookmarks-editor.h" #include "ephy-history-window.h" @@ -1105,3 +1106,12 @@ window_cmd_load_location (GtkAction *action, } } +void +window_cmd_browse_with_caret (GtkAction *action, + EphyWindow *window) +{ + gboolean active; + + active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + eel_gconf_set_boolean (CONF_BROWSE_WITH_CARET, active); +} diff --git a/src/window-commands.h b/src/window-commands.h index 228434c27..b6aa7505c 100644 --- a/src/window-commands.h +++ b/src/window-commands.h @@ -172,3 +172,5 @@ void window_cmd_tabs_detach (GtkAction *action, void window_cmd_load_location (GtkAction *action, EphyWindow *window); +void window_cmd_browse_with_caret (GtkAction *action, + EphyWindow *window); |