This one is a little strange, since I added some code to handle the
non-XO case when it loads up an about:blank page instead.  It's still
pretty small, though.

- Eben
From f78fca75e0a99393c9a33d1bc8db6816ff419b7d Mon Sep 17 00:00:00 2001
From: Eben Eliason <[EMAIL PROTECTED](none)>
Date: Tue, 17 Jun 2008 20:05:03 -0400
Subject: [PATCH] Focus location entry when activity launches

---
 webactivity.py |    1 +
 webtoolbar.py  |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/webactivity.py b/webactivity.py
index 8ca7043..6b84eb3 100755
--- a/webactivity.py
+++ b/webactivity.py
@@ -142,6 +142,7 @@ class WebActivity(activity.Activity):
         self.connect('key-press-event', self._key_press_cb)
                      
         self.toolbox.set_current_toolbar(_TOOLBAR_BROWSE)
+        self._web_toolbar.entry.grab_focus()
         
         if handle.uri:
             self._browser.load_uri(handle.uri)        
diff --git a/webtoolbar.py b/webtoolbar.py
index 3cfbba3..8e9cc08 100755
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -73,6 +73,11 @@ class WebEntry(AddressEntry):
         self.emit('activate')
 
     def _set_address(self, address):
+        if address == "about:blank":
+            address = ''
+        if self._address == None or self._address == '':
+            self._set_text(address)
+            self.select_region(0, -1)
         self._address = address
 
     address = gobject.property(type=str, setter=_set_address)
-- 
1.5.4.3

_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar

Reply via email to