GTK3: Htmlview working again based on WebKit gobject instrospection

svn: r20149
This commit is contained in:
Benny Malengier 2012-07-30 18:54:41 +00:00
parent f080cb1b3c
commit 130b987367
3 changed files with 19 additions and 17 deletions

View File

@ -27,7 +27,7 @@
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
MODULE_VERSION="3.5" MODULE_VERSION="4.0"
try : try :
NEWGTK = False NEWGTK = False

View File

@ -34,13 +34,13 @@ MOZILLA = 2
TOOLKIT = NOWEB TOOLKIT = NOWEB
try: try:
import webkit from gi.repository import WebKit
TOOLKIT = WEBKIT TOOLKIT = WEBKIT
except: except:
try: ##try:
import gtkmozembed ## import gtkmozembed
TOOLKIT = MOZILLA ## TOOLKIT = MOZILLA
except: ##except:
pass pass
#no interfaces present, we do not register these plugins #no interfaces present, we do not register these plugins
@ -50,7 +50,7 @@ if not (TOOLKIT == NOWEB):
name = _("Html View"), name = _("Html View"),
description = _("A view showing html pages embedded in Gramps"), description = _("A view showing html pages embedded in Gramps"),
version = '1.0', version = '1.0',
gramps_target_version = '3.5', gramps_target_version = '4.0',
status = STABLE, status = STABLE,
fname = 'htmlrenderer.py', fname = 'htmlrenderer.py',
authors = [u"The Gramps project"], authors = [u"The Gramps project"],

View File

@ -125,16 +125,17 @@ user_pref("general.useragent.locale, %(lang)s);
TOOLKIT = NOWEB TOOLKIT = NOWEB
try: try:
import webkit from gi.repository import WebKit as webkit
TOOLKIT = WEBKIT TOOLKIT = WEBKIT
except: except:
pass pass
try: #TODO GTK3: gtkmozembed not for GTK3
import gtkmozembed ##try:
TOOLKIT += MOZILLA ## import gtkmozembed
except: ## TOOLKIT += MOZILLA
pass ##except:
## pass
#no interfaces present, raise Error so that options for GeoView do not show #no interfaces present, raise Error so that options for GeoView do not show
if TOOLKIT == NOWEB : if TOOLKIT == NOWEB :
@ -457,7 +458,7 @@ class HtmlView(NavigationView):
self.filter = Gtk.HBox() self.filter = Gtk.HBox()
self.table = "" self.table = ""
self.browser = NOWEB self.browser = NOWEB
self.bootstrap_handler = None #self.bootstrap_handler = None
self.box = None self.box = None
self.toolkit = None self.toolkit = None
@ -471,7 +472,7 @@ class HtmlView(NavigationView):
""" """
self.box = Gtk.VBox(False, 4) self.box = Gtk.VBox(False, 4)
#top widget at the top #top widget at the top
self.box.pack_start(self.top_widget(, True, True, 0), False, False, 0 ) self.box.pack_start(self.top_widget(), False, False, 0 )
#web page under it in a scrolled window #web page under it in a scrolled window
self.table = Gtk.Table(1, 1, False) self.table = Gtk.Table(1, 1, False)
frames = Gtk.HBox(False, 4) frames = Gtk.HBox(False, 4)
@ -500,8 +501,8 @@ class HtmlView(NavigationView):
frame = Gtk.Frame() frame = Gtk.Frame()
frame.set_size_request(100,100) frame.set_size_request(100,100)
frame.add(self.table) frame.add(self.table)
self.bootstrap_handler = self.box.connect("size-request", #self.bootstrap_handler = self.box.connect("size-request",
self.init_parent_signals_for_map) # self.init_parent_signals_for_map)
self.table.get_parent().set_shadow_type(Gtk.ShadowType.NONE) self.table.get_parent().set_shadow_type(Gtk.ShadowType.NONE)
self.table.set_row_spacings(1) self.table.set_row_spacings(1)
self.table.set_col_spacings(0) self.table.set_col_spacings(0)
@ -662,6 +663,7 @@ class HtmlView(NavigationView):
def init_parent_signals_for_map(self, widget, event): def init_parent_signals_for_map(self, widget, event):
""" """
TODO GTK3: No longer called
Required to properly bootstrap the signal handlers. Required to properly bootstrap the signal handlers.
This handler is connected by build_widget. This handler is connected by build_widget.
After the outside ViewManager has placed this widget we are After the outside ViewManager has placed this widget we are