From 307e960d34cdf6654d9c020dda1021be02c5ac88 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Fri, 9 May 2014 15:00:08 +0200 Subject: [PATCH] pushbutton layout implemented (variable number of buttons according to the number of stations used) --- pylot/QtPyLoT.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pylot/QtPyLoT.py b/pylot/QtPyLoT.py index 834ee723..e5b61f1b 100755 --- a/pylot/QtPyLoT.py +++ b/pylot/QtPyLoT.py @@ -107,7 +107,18 @@ class MainWindow(QMainWindow): def layoutStationButtons(self, numStations): layout = QVBoxLayout() for n in range(numStations): - stationButtons[n] = QPushButton('%s'.format(self.)) + tr = data.select(component=self.dispOptions.comp) + try: + stationButtons[n] = QPushButton('%s'.format( + tr[n].stats.station)) + except IndexError: + error = QErrorMessage(self) + errorString = QString() + errorString.setText('''Number of stations does not match number + of traces!''') + error.showMessage(errorString) + self.__del__() + layout.addWidget(stationButtons) def helpHelp(self): if internet_on():