+ layout = QtGui.QHBoxLayout(self.centralWidget())
+ layout.addWidget(self.sideBar)
+ layout.addWidget(self.stackedWidget)
+ layout.setSpacing(0)
+ layout.setContentsMargins(0, 0, 0, 0)
+
+ self.resize(settings.mainwindow.size.value())
+ if settings.mainwindow.pos.value():
+ self.move(settings.mainwindow.pos.value())
+
+ def _setup_sidebar(self):
+ self.sideBar = QtGui.QToolBar(self)
+ self.sideBar.setOrientation(QtCore.Qt.Vertical)
+
+ actionGraph = self.sideBar.addAction('Instantaneous Values and Graphs')
+ actionGraph.setCheckable(True)
+ actionGraph.setIcon(icons.graph)
+ actionGraph.triggered.connect(self.showGraphPage)
+
+ #actionAdd = self.sideBar.addAction('Add Device')
+ #actionAdd.setCheckable(True)
+ #actionAdd.setIcon(icons.add)
+ #actionAdd.triggered.connect(self.showAddDevicePage)
+
+ #actionLog = self.sideBar.addAction('Logs')
+ #actionLog.setCheckable(True)
+ #actionLog.setIcon(icons.log)
+ #actionLog.triggered.connect(self.showLogPage)
+
+ #actionPreferences = self.sideBar.addAction('Preferences')
+ #actionPreferences.setCheckable(True)
+ #actionPreferences.setIcon(icons.preferences)
+ #actionPreferences.triggered.connect(self.showPreferencesPage)
+
+ # make the buttons at the top exclusive
+ self.actionGroup = QtGui.QActionGroup(self)
+ self.actionGroup.addAction(actionGraph)
+ #self.actionGroup.addAction(actionAdd)
+ #self.actionGroup.addAction(actionLog)
+ #self.actionGroup.addAction(actionPreferences)
+
+ # show graph at startup
+ actionGraph.setChecked(True)
+
+ # fill space between buttons on the top and on the bottom
+ fill = QtGui.QWidget(self)
+ fill.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
+ self.sideBar.addWidget(fill)
+
+ self.actionStartStop = self.sideBar.addAction('Start Acquisition')
+ self.actionStartStop.setIcon(icons.start)
+ self.actionStartStop.triggered.connect(self.start_stop_acquisition)
+
+ actionAbout = self.sideBar.addAction('About')
+ actionAbout.setIcon(icons.about)
+ actionAbout.triggered.connect(self.show_about)