summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-11 23:04:11 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-11 23:04:11 +0200
commit94bf586228227a1740cd5f95dc50fc612986b0e1 (patch)
tree51378594365f38e70cbc17104872abd122c4eeb4 /module
parentrestart / quit buttons in webif (diff)
downloadpyload-94bf586228227a1740cd5f95dc50fc612986b0e1.tar.xz
patches from #392
Diffstat (limited to 'module')
-rw-r--r--module/gui/MainWindow.py26
-rw-r--r--module/gui/Queue.py29
2 files changed, 24 insertions, 31 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 1195a4436..c71112e9b 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -631,18 +631,18 @@ class MainWindow(QMainWindow):
types = self.connector.proxy.getAccountTypes()
self.accountEdit = AccountEdit.newAccount(types)
+ #TODO make more easy n1, n2, n3
def save(data):
if data["password"]:
self.accountEdit.close()
- a = AccountData()
- a.type = data["acctype"]
- a.login = data["login"]
- a.password = data["password"]
- self.connector.updateAccounts(a)
+ n1 = data["acctype"]
+ n2 = data["login"]
+ n3 = data["password"]
+ self.connector.updateAccount(n1, n2, n3, None)
self.accountEdit.connect(self.accountEdit, SIGNAL("done"), save)
self.accountEdit.show()
-
+
def slotEditAccount(self):
types = self.connector.getAccountTypes()
@@ -653,15 +653,17 @@ class MainWindow(QMainWindow):
data = data[0].internalPointer()
self.accountEdit = AccountEdit.editAccount(types, data)
-
+
+ #TODO make more easy n1, n2, n3
+ #TODO reload accounts tab after insert of edit account
+ #TODO if account does not exist give error
def save(data):
self.accountEdit.close()
- a = AccountData()
- a.type = data["acctype"]
- a.login = data["login"]
+ n1 = data["acctype"]
+ n2 = data["login"]
if data["password"]:
- a.password = data["password"]
- self.connector.updateAccounts(a)
+ n3 = data["password"]
+ self.connector.updateAccount(n1, n2, n3, None)
self.accountEdit.connect(self.accountEdit, SIGNAL("done"), save)
self.accountEdit.show()
diff --git a/module/gui/Queue.py b/module/gui/Queue.py
index 5bacab13c..0a0cbb810 100644
--- a/module/gui/Queue.py
+++ b/module/gui/Queue.py
@@ -32,7 +32,7 @@ class QueueModel(CollectorModel):
def __init__(self, view, connector):
CollectorModel.__init__(self, view, connector)
- self.cols = 7
+ self.cols = 6
self.wait_dict = {}
self.updater = self.QueueUpdater(self.interval)
@@ -154,13 +154,11 @@ class QueueModel(CollectorModel):
return QVariant(_("Status"))
elif section == 1:
return QVariant(_("Plugin"))
- #elif section == 3:
- # return QVariant(_("Priority"))
- elif section == 4:
+ elif section == 3:
return QVariant(_("Size"))
- elif section == 5:
+ elif section == 4:
return QVariant(_("ETA"))
- elif section == 6:
+ elif section == 5:
return QVariant(_("Progress"))
return QVariant()
@@ -278,13 +276,7 @@ class QueueModel(CollectorModel):
return QVariant(self.translateStatus(statusMapReverse[status]))
else:
return QVariant("%s (%s)" % (self.translateStatus(statusMapReverse[status]), formatSpeed(speed)))
- #elif index.column() == 3:
- # item = index.internalPointer()
- # if isinstance(item, Package):
- # return QVariant(item.data["priority"])
- # else:
- # return QVariant(item.package.data["priority"])
- elif index.column() == 4:
+ elif index.column() == 3:
item = index.internalPointer()
if isinstance(item, Link):
if item.data["status"] == 0: #TODO needs change??
@@ -317,7 +309,7 @@ class QueueModel(CollectorModel):
return QVariant(formatSize(ms))
else:
return QVariant("%s / %s" % (formatSize(cs), formatSize(ms)))
- elif index.column() == 5:
+ elif index.column() == 4:
item = index.internalPointer()
if isinstance(item, Link):
if item.data["downloading"]:
@@ -347,14 +339,13 @@ class QueueView(CollectorView):
self.setColumnWidth(0, 300)
self.setColumnWidth(1, 100)
self.setColumnWidth(2, 140)
- self.setColumnWidth(3, 50)
- self.setColumnWidth(4, 130)
- self.setColumnWidth(5, 70)
+ self.setColumnWidth(3, 180)
+ self.setColumnWidth(4, 70)
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.delegate = QueueProgressBarDelegate(self, self.model())
- self.setItemDelegateForColumn(6, self.delegate)
+ self.setItemDelegateForColumn(5, self.delegate)
class QueueProgressBarDelegate(QItemDelegate):
"""
@@ -371,7 +362,7 @@ class QueueProgressBarDelegate(QItemDelegate):
"""
if not index.isValid():
return
- if index.column() == 6:
+ if index.column() == 5:
item = index.internalPointer()
w = self.queue.getWaitingProgress(item)
wait = None