From 89c904ba750859ba636ca63b2a48d679af3235ec Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Fri, 13 Jun 2008 11:02:53 +0000 Subject: Add find in context functionality - placed in the edittoolbar - use ctrl+f to grab focus of the search entry - use enter to get the next occurrence - use the next and prev buttons to find other occurrences --- (limited to 'webactivity.py') diff --git a/webactivity.py b/webactivity.py index 4b4544a..f0d5021 100755 --- a/webactivity.py +++ b/webactivity.py @@ -83,6 +83,7 @@ SERVICE = "org.laptop.WebActivity" IFACE = SERVICE PATH = "/org/laptop/WebActivity" +_TOOLBAR_EDIT = 1 _TOOLBAR_BROWSE = 2 _logger = logging.getLogger('web-activity') @@ -347,6 +348,11 @@ class WebActivity(activity.Activity): _logger.debug('keyboard: Add link: %s.' % self.current) self._add_link() return True + elif gtk.gdk.keyval_name(event.keyval) == "f": + _logger.debug('keyboard: Find') + self.toolbox.set_current_toolbar(_TOOLBAR_EDIT) + self._edit_toolbar.search_entry.grab_focus() + return True elif gtk.gdk.keyval_name(event.keyval) == "u": _logger.debug('keyboard: Show source of the current page') self._show_source() -- cgit v0.9.1