Hi all! Firstly, sorry for so long time without any feedback, I was working in other projects :$ but now I've changed the webbrowser widget, before it was using gtkmozembbed, now is using webkit (pywebkitgtk[1]) and is GtkWebkit[1] must be installed too
I've created a local branch of openobject-client-4.2 And I've applied my patches to add webbrowser widget [1] http://code.google.com/p/pywebkitgtk [2] http://live.gnome.org/WebKitGtk Here is the patch: --- old/bin/widget/view/form_gtk/parser.py 2008-01-29 15:27:34 +0000 +++ new/bin/widget/view/form_gtk/parser.py 2008-08-03 16:26:14 +0000 @@ -675,6 +675,7 @@ import picture import url import image +import webbrowser widgets_type = { @@ -703,6 +704,7 @@ 'callto' : (url.callto, 1, False, False), 'sip' : (url.sip, 1, False, False), 'image' : (image.image_wid, 1, False, False), + 'webbrowser': (webbrowser.webbrowser, 1, False, False), } # vim:noexpandtab: --- old/bin/widget/view/form_gtk/webbrowser.py 1970-01-01 00:00:00 +0000 +++ new/bin/widget/view/form_gtk/webbrowser.py 2008-08-03 16:26:14 +0000 @@ -0,0 +1,60 @@ +############################################################################## +# +# Copyright (c) 2008 Eduard Carreras i Nadal. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import interface +import gtk +import webkit + + + +class webbrowser(interface.widget_interface): + + def __init__(self, window, parent, model, attrs={}): + interface.widget_interface.__init__(self, window, parent=parent, attrs=attrs) + + self._about = """<html><head><title></title></head><body></body></html>""" + self.widget = gtk.ScrolledWindow() + self.widget.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC + self.widget.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC + + self._browser = webkit.WebView() + self.widget.add(self._browser) + + self.widget.show_all() + + def display(self, model, model_field): + super(webbrowser, self).display(model, model_field) + if not model_field or not model_field.get(model): + self._browser.load_string(self._about, "text/html", "utf-8", "about:") + else: + self._browser.open(model_field.get(model)) + + def destroy(self): + pass + + def set_value(self, model, model_field): + pass ------------------------ Eduard Carreras i Nadal <ecarreras> GISCE ENGINYERIA S.L. _______________________________________________ Tinyerp-users mailing list http://tiny.be/mailman/listinfo/tinyerp-users
