Skip to content

Commit

Permalink
QML UI: Show cover art in "All episodes" (bug 1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Jun 3, 2012
1 parent 6153734 commit e27564d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
11 changes: 10 additions & 1 deletion share/gpodder/ui/qml/EpisodeItem.qml
Expand Up @@ -38,7 +38,16 @@ SelectableItem {

Image {
id: icon
source: 'artwork/' + modelData.qfiletype + (modelData.qdownloading?'-downloading':(modelData.qplaying?'-playing':'')) + '.png'
source: {
if (episodeModel.is_subset_view) {
Util.formatCoverURL(modelData.qpodcast)
} else {
'artwork/' + modelData.qfiletype + (modelData.qdownloading?'-downloading':(modelData.qplaying?'-playing':'')) + '.png'
}
}
sourceSize.width: width
sourceSize.height: height

width: Config.iconSize
height: Config.iconSize
anchors.verticalCenter: parent.verticalCenter
Expand Down
16 changes: 16 additions & 0 deletions src/gpodder/qmlui/__init__.py
Expand Up @@ -659,10 +659,24 @@ def __init__(self, config):
gPodderListModel.__init__(self)
self._filter = config.ui.qml.state.episode_list_filter
self._filtered = []
self._is_subset_view = False

self._config = config
config.add_observer(self._on_config_changed)

is_subset_view_changed = Signal()

def get_is_subset_view(self):
return self._is_subset_view

def set_is_subset_view(self, is_subset_view):
if is_subset_view != self.is_subset_view:
self._is_subset_view = is_subset_view
self.is_subset_view_changed.emit()

is_subset_view = Property(bool, get_is_subset_view,
set_is_subset_view, notify=is_subset_view_changed)

def _on_config_changed(self, name, old_value, new_value):
if name == 'ui.qml.state.episode_list_filter':
self._filter = new_value
Expand Down Expand Up @@ -944,10 +958,12 @@ def select_podcast(self, podcast):
# Normal QPodcast instance
wrap = functools.partial(self.wrap_episode, podcast)
objects = podcast.get_all_episodes()
self.episode_model.set_is_subset_view(False)
else:
# EpisodeSubsetView
wrap = lambda args: self.wrap_episode(*args)
objects = podcast.get_all_episodes_with_podcast()
self.episode_model.set_is_subset_view(True)

self.episode_model.set_objects(map(wrap, objects))
self.main.state = 'episodes'
Expand Down

0 comments on commit e27564d

Please sign in to comment.