diff options
author | Wade Brainerd <wadetb@gmail.com> | 2008-05-10 04:25:46 (GMT) |
---|---|---|
committer | Wade Brainerd <wadetb@gmail.com> | 2008-05-10 04:25:46 (GMT) |
commit | 881567ae0042d8613ab74b461b41d8ca9b85b7c0 (patch) | |
tree | 2b94c43fc1d2fe6c5345a0ce4cea394de26eff15 /activity.py | |
parent | 282037db2097fb13f503633df9bc6a20791cf727 (diff) |
Add search toolbar to activity, it's wired to the wikiserver's search feature.
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/activity.py b/activity.py index a3932a6..56acdfe 100644 --- a/activity.py +++ b/activity.py @@ -1,3 +1,21 @@ +# Copyright (C) 2007, One Laptop Per Child +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + import os import sys import signal @@ -9,6 +27,8 @@ activity_info = registry.get_registry().get_activity('org.laptop.WebActivity') sys.path.append(activity_info.path) import webactivity +from searchtoolbar import SearchToolbar + # Default settings. HTTP_PORT = '8000' WIKIDB = '40ormore.xml.bz2' @@ -28,6 +48,10 @@ class WikipediaActivity(webactivity.WebActivity): handle.uri = 'http://localhost:%s%s' % (HTTP_PORT, HOME_PAGE) webactivity.WebActivity.__init__(self, handle) + + self.searchtoolbar = SearchToolbar(self) + self.toolbox.add_toolbar(_('Search'), self.searchtoolbar) + self.searchtoolbar.show() def kill_server(self): print "Stopping server...\n" |