Skip to content

Commit

Permalink
QML UI: Show pubdate and file size (bug 1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Sep 24, 2012
1 parent c665edb commit 4c48f55
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion share/gpodder/ui/qml/ShowNotes.qml
Expand Up @@ -31,7 +31,17 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.Wrap
text: episode!=undefined?('<h3 color="#666">'+episode.qtitle+'</h3>\n\n'+episode.qdescription):'No episode selected'
text: episode!=undefined?('<h3 color="#666">'+episode.qtitle+'</h3><small>'+formatSubtitle()+'</small><p>'+episode.qdescription+'</p>'):'No episode selected'

function formatSubtitle() {
var pubdate = episode.qpubdate;
var filesize = episode.qfilesize;
if (filesize !== '') {
return pubdate + ' | ' + filesize;
} else {
return pubdate;
}
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/gpodder/qmlui/model.py
Expand Up @@ -115,6 +115,19 @@ def _filetype(self):

qfiletype = Property(unicode, _filetype, notify=never_changed)

def _pubdate(self):
return self._episode.cute_pubdate()

qpubdate = Property(unicode, _pubdate, notify=never_changed)

def _filesize(self):
if self._episode.file_size:
return util.format_filesize(self._episode.file_size)
else:
return ''

qfilesize = Property(unicode, _filesize, notify=changed)

def _downloaded(self):
return self._episode.was_downloaded(and_exists=True)

Expand Down

0 comments on commit 4c48f55

Please sign in to comment.