create a working MainWindow

This commit is contained in:
Sebastian Wehling-Benatelli 2014-12-08 11:38:24 +01:00
parent ef8bd6572e
commit 9e7f20a9fb
3 changed files with 9 additions and 6 deletions

View File

@ -134,7 +134,6 @@ class MainWindow(QMainWindow):
self.fileMenu.addSeparator() self.fileMenu.addSeparator()
self.fileMenu.addAction(self.fileMenuActions[-1]) self.fileMenu.addAction(self.fileMenuActions[-1])
def loadData(self, fname=None): def loadData(self, fname=None):
if fname is None: if fname is None:
action = self.sender() action = self.sender()
@ -179,8 +178,6 @@ class MainWindow(QMainWindow):
statsButtons = layoutStationButtons(self.getData(), self.getComponent()) statsButtons = layoutStationButtons(self.getData(), self.getComponent())
_layout.addLayout(statsButtons) _layout.addLayout(statsButtons)
_layout.addWidget(self.DataPlot) _layout.addWidget(self.DataPlot)
self.setLayout(_layout)
self.setCentralWidget(_widget)
openIcon = self.style().standardIcon(QStyle.SP_DirOpenIcon) openIcon = self.style().standardIcon(QStyle.SP_DirOpenIcon)
quitIcon = self.style().standardIcon(QStyle.SP_MediaStop) quitIcon = self.style().standardIcon(QStyle.SP_MediaStop)
@ -235,6 +232,12 @@ class MainWindow(QMainWindow):
status.addPermanentWidget(self.eventLabel) status.addPermanentWidget(self.eventLabel)
status.showMessage("Ready", 500) status.showMessage("Ready", 500)
statsButtons = layoutStationButtons(self.getData(), self.getComponent())
_layout.addLayout(statsButtons)
_layout.addWidget(self.DataPlot)
_widget.setLayout(_layout)
self.setCentralWidget(_widget)
def okToContinue(self): def okToContinue(self):
if self.dirty: if self.dirty:
return self.saveData() return self.saveData()

View File

@ -1 +1 @@
9603-dirty ef8b-dirty

View File

@ -21,7 +21,7 @@ def layoutStationButtons(data, comp):
stationButtons.append(QPushButton('%s'.format(stat))) stationButtons.append(QPushButton('%s'.format(stat)))
except: except:
for n in range(5): for n in range(5):
stationButtons.append(QPushButton('ST%02d'.format(n))) stationButtons.append(QPushButton('ST{0:02d}'.format(n+1)))
for button in stationButtons: for button in stationButtons:
layout.addWidget(button) layout.addWidget(button)
return layout return layout