Permalink
Browse files

Flattr: Flattr-on-play for QML UI, fixes for Gtk UI

  • Loading branch information...
thp committed Jul 24, 2012
1 parent 2d01c50 commit 7894ab25ebed0698bfc7d167f92a2971adf10f9e
Showing with 19 additions and 6 deletions.
  1. +7 −4 share/gpodder/ui/qml/Main.qml
  2. +4 −2 src/gpodder/gtkui/main.py
  3. +8 −0 src/gpodder/qmlui/__init__.py
@@ -103,10 +103,13 @@ Image {
}
function togglePlayback(episode) {
if (episode !== undefined && episode.qfiletype == 'video') {
controller.playVideo(episode)
} else {
mediaPlayer.togglePlayback(episode)
if (episode !== undefined) {
if (episode.qfiletype == 'video') {
controller.playVideo(episode);
} else {
mediaPlayer.togglePlayback(episode);
}
controller.onPlayback(episode);
}
}
@@ -1908,9 +1908,11 @@ def error_handler(filename, err):
logger.error('Calling Panucci using D-Bus', exc_info=True)
# flattr episode if auto-flattr is enabled
if self.config.flattr.token and self.config.flattr.flattr_on_play:
if (episode.payment_url and self.config.flattr.token and
self.config.flattr.flattr_on_play):
success, message = self.flattr.flattr_url(episode.payment_url)
self.show_message(message, title=_('Flattr status'), important=not success)
self.show_message(message, title=_('Flattr status'),
important=not success)
groups[player].append(filename)
@@ -168,6 +168,14 @@ def getFlattrButtonText(self):
flattrButtonText = Property(unicode, getFlattrButtonText,
setFlattrButtonText, notify=flattrButtonTextChanged)
@Slot(QObject)
def onPlayback(self, qepisode):
if (qepisode.payment_url and self.root.config.flattr.token and
self.root.config.flattr.flattr_on_play):
success, message = self._flattr.flattr_url(qepisode.payment_url)
if not success:
logger.warn('Flattr message on playback action: %s', message)
@Slot(QObject)
def updateFlattrButtonText(self, qepisode):
self.setFlattrButtonText('')

0 comments on commit 7894ab2

Please sign in to comment.