Show download status in episode list
This commit is contained in:
parent
90b4f04e35
commit
24f686fad6
3 changed files with 27 additions and 1 deletions
2
main.py
2
main.py
|
@ -116,6 +116,7 @@ class gPotherSide:
|
|||
'id': episode.id,
|
||||
'title': episode.title,
|
||||
'progress': episode.download_progress(),
|
||||
'downloadState': episode.state,
|
||||
}
|
||||
|
||||
def load_episodes(self, id):
|
||||
|
@ -142,6 +143,7 @@ class gPotherSide:
|
|||
'podcast': episode.channel.title,
|
||||
'published': util.format_date(episode.published),
|
||||
'progress': episode.download_progress(),
|
||||
'downloadState': episode.state,
|
||||
}
|
||||
|
||||
def get_fresh_episodes(self):
|
||||
|
|
|
@ -47,7 +47,7 @@ ButtonArea {
|
|||
PLabel {
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
right: downloadStatusIcon.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: 30 * pgst.scalef
|
||||
}
|
||||
|
@ -55,5 +55,23 @@ ButtonArea {
|
|||
elide: Text.ElideRight
|
||||
text: title
|
||||
}
|
||||
|
||||
Image {
|
||||
id: downloadStatusIcon
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
margins: 30 * pgst.scalef
|
||||
}
|
||||
|
||||
source: {
|
||||
switch (downloadState) {
|
||||
case Constants.state.normal: return '';
|
||||
case Constants.state.downloaded: return 'images/play.png';
|
||||
case Constants.state.deleted: return 'images/delete.png';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,3 +31,9 @@ var colors = {
|
|||
playback: '#729fcf', /* playback blue */
|
||||
};
|
||||
|
||||
var state = {
|
||||
normal: 0,
|
||||
downloaded: 1,
|
||||
deleted: 2,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue