Added method for gramps to handle url requests
svn: r15808
This commit is contained in:
parent
ecef5c1d26
commit
bdd07988c6
@ -21,6 +21,7 @@
|
||||
# $Id$
|
||||
|
||||
import const
|
||||
import config
|
||||
import locale
|
||||
import os
|
||||
|
||||
@ -73,10 +74,16 @@ def help(webpage='', section=''):
|
||||
link = link + '#' + section
|
||||
url(link)
|
||||
|
||||
def url(link):
|
||||
def url(link, uistate=None):
|
||||
"""
|
||||
Open the specified URL in a browser.
|
||||
"""
|
||||
if uistate and config.get('htmlview.url-handler'):
|
||||
if 'Web' in uistate.viewmanager.get_categories():
|
||||
uistate.viewmanager.goto_category('Web')
|
||||
page = uistate.viewmanager.get_category_page('Web')
|
||||
page.open(link)
|
||||
return
|
||||
if not run_file(link):
|
||||
run_browser(link)
|
||||
|
||||
|
@ -165,6 +165,7 @@ register('geoview.stylesheet', "")
|
||||
register('geoview.zoom', 0)
|
||||
|
||||
register('htmlview.start-url', "http://gramps-project.org")
|
||||
register('htmlview.url-handler', False)
|
||||
|
||||
register('interface.address-height', 450)
|
||||
register('interface.address-width', 650)
|
||||
|
@ -717,7 +717,8 @@ class StyledTextEditor(gtk.TextView):
|
||||
else:
|
||||
return
|
||||
# If ok, then let's open
|
||||
display_url(url)
|
||||
obj = find_parent_with_attr(self, attr="dbstate")
|
||||
display_url(url, obj.uistate)
|
||||
|
||||
def _copy_url_cb(self, menuitem, url, flavor):
|
||||
"""Copy url to both useful selections."""
|
||||
|
Loading…
Reference in New Issue
Block a user