mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
include last modified time in description & plugin area
This commit is contained in:
parent
50275c74f1
commit
56d0e20cca
1 changed files with 9 additions and 4 deletions
|
@ -116,11 +116,14 @@ class GetShared(QDialog):
|
||||||
if self.type == 0:
|
if self.type == 0:
|
||||||
cols = (R_TITLE, R_FACTS, R_COUNT)
|
cols = (R_TITLE, R_FACTS, R_COUNT)
|
||||||
else:
|
else:
|
||||||
cols = (R_TITLE, R_COUNT)
|
cols = (R_TITLE, R_COUNT, R_MODIFIED)
|
||||||
for rc, r in enumerate(self.curList):
|
for rc, r in enumerate(self.curList):
|
||||||
for cc, c in enumerate(cols):
|
for cc, c in enumerate(cols):
|
||||||
if c == R_FACTS or c == R_COUNT:
|
if c == R_FACTS or c == R_COUNT:
|
||||||
txt = unicode("%15d" % r[c])
|
txt = unicode("%15d" % r[c])
|
||||||
|
elif c == R_MODIFIED:
|
||||||
|
days = int(((time.time() - r[c])/(24*60*60)))
|
||||||
|
txt = ngettext("%6d day ago", "%6d days ago", days) % days
|
||||||
else:
|
else:
|
||||||
txt = unicode(r[c])
|
txt = unicode(r[c])
|
||||||
item = QTableWidgetItem(txt)
|
item = QTableWidgetItem(txt)
|
||||||
|
@ -148,12 +151,14 @@ class GetShared(QDialog):
|
||||||
<b>Size</b>: %(size)0.2fKB<br>
|
<b>Size</b>: %(size)0.2fKB<br>
|
||||||
<b>Uploader</b>: %(author)s<br>
|
<b>Uploader</b>: %(author)s<br>
|
||||||
<b>Downloads</b>: %(count)s<br>
|
<b>Downloads</b>: %(count)s<br>
|
||||||
<b>Description</b>:<br>%(description)s""") % {
|
<b>Modified</b>: %(mod)s ago<br>
|
||||||
|
<br>%(description)s""") % {
|
||||||
'title': r[R_TITLE],
|
'title': r[R_TITLE],
|
||||||
'tags': r[R_TAGS],
|
'tags': r[R_TAGS],
|
||||||
'size': r[R_SIZE] / 1024.0,
|
'size': r[R_SIZE] / 1024.0,
|
||||||
'author': r[R_USERNAME],
|
'author': r[R_USERNAME],
|
||||||
'count': r[R_COUNT],
|
'count': r[R_COUNT],
|
||||||
|
'mod': fmtTimeSpan(time.time() - r[R_MODIFIED]),
|
||||||
'description': r[R_DESCRIPTION].replace("\n", "<br>"),
|
'description': r[R_DESCRIPTION].replace("\n", "<br>"),
|
||||||
})
|
})
|
||||||
self.form.scrollAreaWidgetContents.adjustSize()
|
self.form.scrollAreaWidgetContents.adjustSize()
|
||||||
|
@ -170,9 +175,9 @@ class GetShared(QDialog):
|
||||||
self.form.table.setHorizontalHeaderLabels([
|
self.form.table.setHorizontalHeaderLabels([
|
||||||
_("Title"), _("Facts"), _("Downloads")])
|
_("Title"), _("Facts"), _("Downloads")])
|
||||||
else:
|
else:
|
||||||
self.form.table.setColumnCount(2)
|
self.form.table.setColumnCount(3)
|
||||||
self.form.table.setHorizontalHeaderLabels([
|
self.form.table.setHorizontalHeaderLabels([
|
||||||
_("Title"), _("Downloads")])
|
_("Title"), _("Downloads"), _("Modified")])
|
||||||
self.form.table.horizontalHeader().setResizeMode(
|
self.form.table.horizontalHeader().setResizeMode(
|
||||||
0, QHeaderView.Stretch)
|
0, QHeaderView.Stretch)
|
||||||
self.form.table.verticalHeader().hide()
|
self.form.table.verticalHeader().hide()
|
||||||
|
|
Loading…
Reference in a new issue