summaryrefslogtreecommitdiffstats
path: root/module/gui
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-27 14:45:22 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-27 14:45:22 +0100
commit757f025247d77b085b6168d5f625d2bbfa7c4c0d (patch)
tree5458f45d3c45d6e7da4945a376df8433ccf1e5bf /module/gui
parentFixed reconnect loop (easy doing) (diff)
downloadpyload-757f025247d77b085b6168d5f625d2bbfa7c4c0d.tar.xz
stop button works, closes #59
Diffstat (limited to 'module/gui')
-rw-r--r--module/gui/MainWindow.py24
-rw-r--r--module/gui/connector.py24
2 files changed, 45 insertions, 3 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 744518adb..74bf00b51 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -79,8 +79,13 @@ class MainWindow(QMainWindow):
self.tabs = {}
self.tabs["queue"] = {"w":QWidget()}
self.tabs["collector"] = {"w":QWidget()}
+ self.tabs["settings"] = {"w":QWidget()}
+ self.tabs["log"] = {"w":QWidget()}
self.tabw.addTab(self.tabs["queue"]["w"], "Queue")
self.tabw.addTab(self.tabs["collector"]["w"], "Collector")
+ self.tabw.addTab(self.tabs["settings"]["w"], "Settings")
+ self.tabw.addTab(self.tabs["log"]["w"], "Log")
+ self.tabw.setTabEnabled(2, False)
#init tabs
self.init_tabs()
@@ -159,6 +164,21 @@ class MainWindow(QMainWindow):
self.tabs["collector"]["package_view"].setContextMenuPolicy(Qt.CustomContextMenu)
self.tabs["collector"]["link_view"].setContextMenuPolicy(Qt.CustomContextMenu)
self.tabs["queue"]["view"].setContextMenuPolicy(Qt.CustomContextMenu)
+
+ #settings
+ self.tabs["settings"]["l"] = QGridLayout()
+ self.tabs["settings"]["w"].setLayout(self.tabs["settings"]["l"])
+ #self.tabs["settings"]["view"] = QTreeWidget()
+ #self.tabs["settings"]["l"].addWidget(self.tabs["settings"]["view"])
+
+ #log
+ self.tabs["log"]["l"] = QGridLayout()
+ self.tabs["log"]["w"].setLayout(self.tabs["log"]["l"])
+ self.tabs["log"]["text"] = QTextEdit()
+ self.tabs["log"]["text"].logOffset = 0
+ self.tabs["log"]["text"].setReadOnly(True)
+ self.connect(self.tabs["log"]["text"], SIGNAL("append(QString)"), self.tabs["log"]["text"].append)
+ self.tabs["log"]["l"].addWidget(self.tabs["log"]["text"])
def init_context(self):
"""
@@ -183,10 +203,8 @@ class MainWindow(QMainWindow):
def slotStatusStop(self):
"""
stop button (toolbar)
-
- dummy
"""
- print "stop!"
+ self.emit(SIGNAL("stopAllDownloads"))
def slotAdd(self):
"""
diff --git a/module/gui/connector.py b/module/gui/connector.py
index e52cf42ff..64c05ba8c 100644
--- a/module/gui/connector.py
+++ b/module/gui/connector.py
@@ -316,4 +316,28 @@ class connector(QThread):
self.emit(SIGNAL("proxy_error"), "uploadContainer")
finally:
self.mutex.unlock()
+
+ def getLog(self, offset):
+ """
+ get log
+ """
+ self.mutex.lock()
+ try:
+ return self.proxy.get_log(offset)
+ except:
+ self.emit(SIGNAL("proxy_error"), "getLog")
+ finally:
+ self.mutex.unlock()
+
+ def stopAllDownloads(self):
+ """
+ get log
+ """
+ self.mutex.lock()
+ try:
+ self.proxy.stop_downloads()
+ except:
+ self.emit(SIGNAL("proxy_error"), "stopAllDownloads")
+ finally:
+ self.mutex.unlock()