From 1fcfec4e2bd558975d36f1f294cdc52abeb5f4e5 Mon Sep 17 00:00:00 2001 From: Jeix Date: Wed, 10 Nov 2010 16:27:17 +0100 Subject: some design improvements on gui --- module/gui/Accounts.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'module/gui/Accounts.py') diff --git a/module/gui/Accounts.py b/module/gui/Accounts.py index 0add1452b..23751d79f 100644 --- a/module/gui/Accounts.py +++ b/module/gui/Accounts.py @@ -30,18 +30,21 @@ class AccountModel(QAbstractItemModel): self.cols = 4 self.mutex = QMutex() - def reloadData(self, force=True): - data = self.connector.proxy.get_accounts(False, force) + def reloadData(self, force=False): + data = self.connector.proxy.get_accounts(force, False) + + accounts = [] + for li in data.values(): + accounts += li + + if self._data == accounts: + return if len(self._data) > 0: self.beginRemoveRows(QModelIndex(), 0, len(self._data)-1) self._data = [] self.endRemoveRows() - accounts = [] - for li in data.values(): - accounts += li - if len(accounts) > 0: self.beginInsertRows(QModelIndex(), 0, len(accounts)-1) self._data = accounts @@ -59,6 +62,8 @@ class AccountModel(QAbstractItemModel): elif index.column() == 1: return QVariant(self.toData(index)["login"]) elif index.column() == 2: + if not self.toData(index)["valid"]: + return QVariant(_("not valid")) if not self.toData(index)["validuntil"]: return QVariant(_("n/a")) until = int(self.toData(index)["validuntil"]) -- cgit v1.2.3