diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-21 00:41:08 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-21 00:41:08 +0100 |
commit | 9f342ea3f73148154054515c4a3d3fa8ab35bf51 (patch) | |
tree | c6dca7bc2bc83f2ae4bf3b7ad3f2f17d42cbcf4a | |
parent | Normal linklist plugin (diff) | |
download | pyload-9f342ea3f73148154054515c4a3d3fa8ab35bf51.tar.xz |
GUI: new docks
-rw-r--r-- | module/gui/MainWindow.py | 23 | ||||
-rwxr-xr-x | pyLoadGui.py | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index f9d2d0fb8..9c972dea1 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -19,6 +19,9 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * +from module.gui.PackageDock import * +from module.gui.LinkDock import * + class MainWindow(QMainWindow): def __init__(self): """ @@ -30,6 +33,11 @@ class MainWindow(QMainWindow): self.setWindowIcon(QIcon("icons/logo.png")) self.resize(750,500) + self.newPackDock = NewPackageDock() + self.addDockWidget(Qt.RightDockWidgetArea, self.newPackDock) + self.newLinkDock = NewLinkDock() + self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) + #central widget, layout self.masterlayout = QVBoxLayout() lw = QWidget() @@ -92,7 +100,12 @@ class MainWindow(QMainWindow): self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop) + self.addMenu = QMenu() + packageAction = self.addMenu.addAction("Package") + linkAction = self.addMenu.addAction("Links") self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) + self.connect(packageAction, SIGNAL("triggered()"), self.slotAddPackage) + self.connect(linkAction, SIGNAL("triggered()"), self.slotAddLinks) def init_tabs(self): """ @@ -125,7 +138,15 @@ class MainWindow(QMainWindow): print "stop!" def slotAdd(self): - print "add" + self.addMenu.exec_(QCursor.pos()) + + def slotAddPackage(self): + self.tabw.setCurrentIndex(1) + self.newPackDock.show() + + def slotAddLinks(self): + self.tabw.setCurrentIndex(1) + self.newLinkDock.show() def slotShowConnector(self): self.emit(SIGNAL("connector")) diff --git a/pyLoadGui.py b/pyLoadGui.py index 7ac576f4e..77fe54ca0 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -110,6 +110,8 @@ class main(QObject): only for testing ;) """ #test for link collector + self.mainWindow.tabs["collector"]["package_view"].setColumnCount(1) + self.mainWindow.tabs["collector"]["package_view"].setHeaderLabels(["Name"]) ids = self.connector.getLinkCollector() for id in ids: data = self.connector.getLinkInfo(id) |