From 1a29ebde6fc2dbf5a205204c7b1e13b7a528bc18 Mon Sep 17 00:00:00 2001 From: Lucian Branescu Mihaila Date: Mon, 05 Jul 2010 13:44:02 +0000 Subject: Fix bookmarks, various other fixes. --- diff --git a/browser.py b/browser.py index 6f09aa7..e2d2419 100644 --- a/browser.py +++ b/browser.py @@ -1,6 +1,7 @@ # Copyright (C) 2006, Red Hat, Inc. # Copyright (C) 2007, One Laptop Per Child # Copyright (C) 2009, Tomeu Vizoso, Simon Schampijer +# Copyright (C) 2010, Lucian Branescu Mihaila # # 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 @@ -40,11 +41,11 @@ _ZOOM_AMOUNT = 0.1 class TabbedView(gtk.Notebook): __gtype_name__ = 'TabbedView' - AGENT_SHEET = os.path.join(activity.get_bundle_path(), - 'agent-stylesheet.css') + #AGENT_SHEET = os.path.join(activity.get_bundle_path(), + # 'agent-stylesheet.css') USER_SHEET = os.path.join(env.get_profile_path(), 'webkit', 'user-stylesheet.css') - HOME_PAGE = 'http://sugarlabs.org' + #HOME_PAGE = 'http://sugarlabs.org' def __init__(self): gobject.GObject.__init__(self) @@ -57,7 +58,8 @@ class TabbedView(gtk.Notebook): def new_tab(self, uri=None): browser = Browser() self._append_tab(browser) - browser.load_uri(uri or self.HOME_PAGE) + if uri: + browser.load_uri(uri)# or self.HOME_PAGE) def _append_tab(self, browser): label = TabLabel(browser) @@ -66,10 +68,10 @@ class TabbedView(gtk.Notebook): #set stylesheets settings = browser.get_settings() - if os.path.exists(self.AGENT_SHEET): - # used to disable flash movies until you click them. - settings.set_property('user-stylesheet-uri', 'file:///' + - self.AGENT_SHEET) + #if os.path.exists(self.AGENT_SHEET): + # # used to disable flash movies until you click them. + # settings.set_property('user-stylesheet-uri', 'file:///' + + # self.AGENT_SHEET) if os.path.exists(self.USER_SHEET): settings.set_property('user-stylesheet-uri', 'file:///' + self.USER_SHEET) diff --git a/edittoolbar.py b/edittoolbar.py index 58cd761..5f18832 100644 --- a/edittoolbar.py +++ b/edittoolbar.py @@ -15,9 +15,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import gtk +import logging from gettext import gettext as _ +import gtk + from sugar.activity import activity from sugar.graphics import iconentry from sugar.graphics.toolbutton import ToolButton diff --git a/model.py b/model.py index 38154c4..b4ad62a 100644 --- a/model.py +++ b/model.py @@ -45,7 +45,7 @@ class Model(gobject.GObject): break self.data['shared_links'].insert(index, - {'hash':sha1.new(str(url)).hexdigest(), + {'hash':sha1(str(url)).hexdigest(), 'url':str(url), 'title':str(title), 'thumb':base64.b64encode(thumb), 'owner':str(owner), -- cgit v0.9.1