diff options
-rw-r--r-- | icons/gui/toolbar_add.png | bin | 0 -> 932 bytes | |||
-rw-r--r-- | icons/gui/toolbar_pause.png | bin | 0 -> 943 bytes | |||
-rw-r--r-- | icons/gui/toolbar_remove.png | bin | 0 -> 496 bytes | |||
-rw-r--r-- | icons/gui/toolbar_start.png | bin | 0 -> 1504 bytes | |||
-rw-r--r-- | icons/gui/toolbar_stop.png | bin | 0 -> 523 bytes | |||
-rw-r--r-- | module/gui/MainWindow.py | 31 |
6 files changed, 31 insertions, 0 deletions
diff --git a/icons/gui/toolbar_add.png b/icons/gui/toolbar_add.png Binary files differnew file mode 100644 index 000000000..17003e9f0 --- /dev/null +++ b/icons/gui/toolbar_add.png diff --git a/icons/gui/toolbar_pause.png b/icons/gui/toolbar_pause.png Binary files differnew file mode 100644 index 000000000..b7a727b71 --- /dev/null +++ b/icons/gui/toolbar_pause.png diff --git a/icons/gui/toolbar_remove.png b/icons/gui/toolbar_remove.png Binary files differnew file mode 100644 index 000000000..1e9c00e16 --- /dev/null +++ b/icons/gui/toolbar_remove.png diff --git a/icons/gui/toolbar_start.png b/icons/gui/toolbar_start.png Binary files differnew file mode 100644 index 000000000..1123266e6 --- /dev/null +++ b/icons/gui/toolbar_start.png diff --git a/icons/gui/toolbar_stop.png b/icons/gui/toolbar_stop.png Binary files differnew file mode 100644 index 000000000..b388e3d72 --- /dev/null +++ b/icons/gui/toolbar_stop.png diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index fad98d9da..5878d18d4 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -56,6 +56,10 @@ class MainWindow(QMainWindow): self.menus["file"].addAction(self.mactions["exit"]) self.menus["connections"].addAction(self.mactions["manager"]) + #toolbar + self.actions = {} + self.init_toolbar() + #tabs self.tabw = QTabWidget() self.tabs = {} @@ -72,6 +76,24 @@ class MainWindow(QMainWindow): #layout self.masterlayout.addWidget(self.tabw) + def init_toolbar(self): + self.toolbar = self.addToolBar("main") + self.toolbar.setIconSize(QSize(40,40)) + self.actions["toggle_status"] = self.toolbar.addAction("Toggle Pause/Resume") + pricon = QIcon() + pricon.addFile("icons/gui/toolbar_start.png", QSize(), QIcon.Normal, QIcon.Off) + pricon.addFile("icons/gui/toolbar_pause.png", QSize(), QIcon.Normal, QIcon.On) + self.actions["toggle_status"].setIcon(pricon) + self.actions["toggle_status"].setCheckable(True) + self.actions["status_stop"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_stop.png"), "Stop") + self.toolbar.addSeparator() + self.actions["add"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_add.png"), "Add") + #self.toolbar.addAction(QIcon("icons/gui/toolbar_remove.png"), "Remove") + + self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) + self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop) + self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) + def init_tabs(self): """ create tabs @@ -93,3 +115,12 @@ class MainWindow(QMainWindow): self.tabs["collector_links"]["w"].setLayout(self.tabs["collector_links"]["l"]) self.tabs["collector_links"]["listwidget"] = QListWidget() self.tabs["collector_links"]["l"].addWidget(self.tabs["collector_links"]["listwidget"]) + + def slotToggleStatus(self, status): + print "toggle status", status + + def slotStatusStop(self): + print "stop!" + + def slotAdd(self): + print "add" |