diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-04 20:01:17 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-04 20:01:17 +0100 |
commit | 78f061eed59e084f001f8a0cd9c5b585f6fc0ce0 (patch) | |
tree | 1c5cc3cbfa4eb993a5af0f2b6556e1ff5f0021c7 /pyLoadQtGui.py | |
parent | Convert read_url_list to new Plugin (diff) | |
download | pyload-78f061eed59e084f001f8a0cd9c5b585f6fc0ce0.tar.xz |
fixes, minimal gui changes
Diffstat (limited to 'pyLoadQtGui.py')
-rw-r--r-- | pyLoadQtGui.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/pyLoadQtGui.py b/pyLoadQtGui.py index 88882a159..a67e80d66 100644 --- a/pyLoadQtGui.py +++ b/pyLoadQtGui.py @@ -81,6 +81,11 @@ class main(QObject): item = QTreeWidgetItem() item.setData(0, Qt.UserRole, QVariant(data)) item.setData(0, Qt.DisplayRole, QVariant(data["package_name"])) + files = self.connector.getPackageFiles(data["id"]) + for id in files: + info = self.connector.getLinkInfo(id) + sub = QTreeWidgetItem(item) + sub.setData(0, Qt.DisplayRole, QVariant(info["filename"])) self.mainWindow.tabs["collector_packages"]["treewidget"].addTopLevelItem(item) #test for queue @@ -89,6 +94,12 @@ class main(QObject): item = QTreeWidgetItem() item.setData(0, Qt.UserRole, QVariant(data)) item.setData(0, Qt.DisplayRole, QVariant(data["package_name"])) + files = self.connector.getPackageFiles(data["id"]) + for id in files: + info = self.connector.getLinkInfo(id) + sub = QTreeWidgetItem(item) + sub.setData(0, Qt.DisplayRole, QVariant(info["filename"])) + sub.setData(1, Qt.DisplayRole, QVariant(info["status_type"])) self.mainWindow.tabs["queue"]["treewidget"].addTopLevelItem(item) class connector(QThread): @@ -154,6 +165,12 @@ class connector(QThread): grab queue return the data """ return self.proxy.get_queue() + + def getPackageFiles(self, id): + """ + grab package files and return ids + """ + return self.proxy.get_package_files(id) class mainWindow(QMainWindow): def __init__(self): @@ -197,8 +214,8 @@ class mainWindow(QMainWindow): self.tabs["collector_packages"] = {"w":QWidget()} self.tabs["collector_links"] = {"w":QWidget()} self.tabw.addTab(self.tabs["queue"]["w"], "Queue") - self.tabw.addTab(self.tabs["collector_packages"]["w"], "Link collector") - self.tabw.addTab(self.tabs["collector_links"]["w"], "Package collector") + self.tabw.addTab(self.tabs["collector_packages"]["w"], "Package collector") + self.tabw.addTab(self.tabs["collector_links"]["w"], "Link collector") #init tabs self.init_tabs() @@ -215,6 +232,8 @@ class mainWindow(QMainWindow): self.tabs["queue"]["w"].setLayout(self.tabs["queue"]["l"]) self.tabs["queue"]["treewidget"] = QTreeWidget() self.tabs["queue"]["l"].addWidget(self.tabs["queue"]["treewidget"]) + self.tabs["queue"]["treewidget"].setColumnCount(2) + self.tabs["queue"]["treewidget"].setHeaderLabels(["Name", "Status"]) #collector_packages self.tabs["collector_packages"]["l"] = QGridLayout() |