diff options
author | mkaay <mkaay@mkaay.de> | 2010-09-06 19:14:02 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-09-06 19:14:02 +0200 |
commit | 0b6f0dd36f5b4c02a444825c77cae02cc5066f34 (patch) | |
tree | 6efe97789b316dc80f8d62d322ec19d63109b6fd /module/gui/Collector.py | |
parent | gui double logging fix (diff) | |
download | pyload-0b6f0dd36f5b4c02a444825c77cae02cc5066f34.tar.xz |
gui: status translation, core: added scheduler -> better account fetching UploadedTo + ShareonlineBiz account fix
Diffstat (limited to 'module/gui/Collector.py')
-rw-r--r-- | module/gui/Collector.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/module/gui/Collector.py b/module/gui/Collector.py index f7bfcbebf..08d82daf8 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -37,6 +37,8 @@ statusMap = { } statusMapReverse = dict((v,k) for k, v in statusMap.iteritems()) +translatedStatusMap = {} # -> CollectorModel.__init__ + class CollectorModel(QAbstractItemModel): def __init__(self, view, connector): QAbstractItemModel.__init__(self) @@ -46,6 +48,27 @@ class CollectorModel(QAbstractItemModel): self.cols = 3 self.interval = 1 self.mutex = QMutex() + + global translatedStatusMap # workaround because i18n is not running at import time + translatedStatusMap = { + "finished": _("finished"), + "offline": _("offline"), + "online": _("online"), + "queued": _("queued"), + "checking": _("checking"), + "waiting": _("waiting"), + "reconnected": _("reconnected"), + "starting": _("starting"), + "failed": _("failed"), + "aborted": _("aborted"), + "decrypting": _("decrypting"), + "custom": _("custom"), + "downloading": _("downloading"), + "processing": _("processing") + } + + def translateStatus(self, string): + return translatedStatusMap[string] def addEvent(self, event): locker = QMutexLocker(self.mutex) @@ -150,7 +173,7 @@ class CollectorModel(QAbstractItemModel): status = child.data["status"] else: status = item.data["status"] - return QVariant(statusMapReverse[status]) + return QVariant(self.translateStatus(statusMapReverse[status])) elif index.column() == 1: item = index.internalPointer() plugins = [] |