Gtk UI: Remove WebKit1 support
WebKit1 for Gtk2 support is deprecated in Debian, we may want to re-introduce WebKit(2) support once we have ported gPodder to Gtk3 and its GObject Introspection-based Python bindings. See also: https://bugs.debian.org/790218
This commit is contained in:
parent
2a27cddf8c
commit
e44344a9fe
1
README
1
README
|
@ -51,7 +51,6 @@
|
|||
[ OPTIONAL DEPENDENCIES ]
|
||||
|
||||
- Bluetooth file sending: gnome-obex-send or bluetooth-sendto
|
||||
- HTML shownotes: python-webkit
|
||||
- Size detection on Windows: PyWin32
|
||||
- Native OS X support: ige-mac-integration
|
||||
- MP3 Player Sync Support: python-eyed3 (0.7 or newer)
|
||||
|
|
|
@ -128,7 +128,6 @@ defaults = {
|
|||
},
|
||||
|
||||
'toolbar': False,
|
||||
'html_shownotes': True,
|
||||
'new_episodes': 'show', # ignore, show, queue, download
|
||||
'live_search_delay': 200,
|
||||
|
||||
|
@ -211,7 +210,6 @@ gPodderSettings_LegacySupport = {
|
|||
'episode_list_descriptions': 'ui.gtk.episode_list.descriptions',
|
||||
'podcast_list_view_all': 'ui.gtk.podcast_list.all_episodes',
|
||||
'podcast_list_sections': 'ui.gtk.podcast_list.sections',
|
||||
'enable_html_shownotes': 'ui.gtk.html_shownotes',
|
||||
'episode_list_view_mode': 'ui.gtk.episode_list.view_mode',
|
||||
'podcast_list_view_mode': 'ui.gtk.podcast_list.view_mode',
|
||||
'podcast_list_hide_boring': 'ui.gtk.podcast_list.hide_empty',
|
||||
|
|
|
@ -140,10 +140,7 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
self.config.add_observer(self.on_config_changed)
|
||||
|
||||
self.shownotes_pane = gtk.HBox()
|
||||
if shownotes.have_webkit and self.config.enable_html_shownotes:
|
||||
self.shownotes_object = shownotes.gPodderShownotesHTML(self.shownotes_pane)
|
||||
else:
|
||||
self.shownotes_object = shownotes.gPodderShownotesText(self.shownotes_pane)
|
||||
self.shownotes_object = shownotes.gPodderShownotesText(self.shownotes_pane)
|
||||
|
||||
# Vertical paned for the episode list and shownotes
|
||||
self.vpaned = gtk.VPaned()
|
||||
|
|
|
@ -36,18 +36,6 @@ from gpodder import util
|
|||
from gpodder.gtkui.draw import draw_text_box_centered
|
||||
|
||||
|
||||
try:
|
||||
import webkit
|
||||
webview_signals = gobject.signal_list_names(webkit.WebView)
|
||||
if 'navigation-policy-decision-requested' in webview_signals:
|
||||
have_webkit = True
|
||||
else:
|
||||
logger.warn('Your WebKit is too old (gPodder bug 1001).')
|
||||
have_webkit = False
|
||||
except ImportError:
|
||||
have_webkit = False
|
||||
|
||||
|
||||
class gPodderShownotes:
|
||||
def __init__(self, shownotes_pane):
|
||||
self.shownotes_pane = shownotes_pane
|
||||
|
@ -142,48 +130,3 @@ class gPodderShownotesText(gPodderShownotes):
|
|||
self.text_buffer.insert_at_cursor('\n\n')
|
||||
self.text_buffer.insert(self.text_buffer.get_end_iter(), util.remove_html_tags(episode.description))
|
||||
self.text_buffer.place_cursor(self.text_buffer.get_start_iter())
|
||||
|
||||
|
||||
class gPodderShownotesHTML(gPodderShownotes):
|
||||
SHOWNOTES_HTML_TEMPLATE = """
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<span style="font-size: big; font-weight: bold;">%s</span>
|
||||
<br>
|
||||
<span style="font-size: small;">%s (%s)</span>
|
||||
<hr style="border: 1px #eeeeee solid;">
|
||||
<p>%s</p>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
def init(self):
|
||||
self.html_view = webkit.WebView()
|
||||
self.html_view.connect('navigation-policy-decision-requested',
|
||||
self._navigation_policy_decision)
|
||||
self.html_view.load_html_string('', '')
|
||||
return self.html_view
|
||||
|
||||
def _navigation_policy_decision(self, wv, fr, req, action, decision):
|
||||
REASON_LINK_CLICKED, REASON_OTHER = 0, 5
|
||||
if action.get_reason() == REASON_LINK_CLICKED:
|
||||
util.open_website(req.get_uri())
|
||||
decision.ignore()
|
||||
elif action.get_reason() == REASON_OTHER:
|
||||
decision.use()
|
||||
else:
|
||||
decision.ignore()
|
||||
|
||||
def update(self, heading, subheading, episode):
|
||||
html = self.SHOWNOTES_HTML_TEMPLATE % (
|
||||
cgi.escape(heading),
|
||||
cgi.escape(subheading),
|
||||
episode.get_play_info_string(),
|
||||
episode.description_html,
|
||||
)
|
||||
url = os.path.dirname(episode.channel.url)
|
||||
self.html_view.load_html_string(html, url)
|
||||
|
||||
|
|
Loading…
Reference in New Issue