Commit 7bc4035fc14dedc0917e92652ab1442165da1b50
1 parent
8b41ae5b5b
Exists in
master
enable startButton only if one channel is selected
Showing 1 changed file with 9 additions and 1 deletions Side-by-side Diff
datalogger-gui.py
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | self.startButton = QtGui.QPushButton() |
105 | 105 | self.startButton.setText('Start log') |
106 | 106 | self.layout.addWidget(self.startButton, 99, 1) |
107 | - self.startButton.setEnabled(True) | |
107 | + self.startButton.setEnabled(False) | |
108 | 108 | |
109 | 109 | self.stopButton = QtGui.QPushButton() |
110 | 110 | self.stopButton.setText('Stop log') |
... | ... | @@ -182,6 +182,14 @@ |
182 | 182 | self.vTypeToLog.append(str(self.chListVtypes[i].currentItem().text())) |
183 | 183 | else: |
184 | 184 | self.chListVtypes[i].setEnabled(False) |
185 | + | |
186 | + allChannelsUnchecked = False | |
187 | + for i in self.checkBoxChannels: | |
188 | + allChannelsUnchecked = allChannelsUnchecked or i.isChecked() | |
189 | + if allChannelsUnchecked == False: | |
190 | + self.startButton.setEnabled(False) | |
191 | + else: | |
192 | + self.startButton.setEnabled(True) | |
185 | 193 | |
186 | 194 | self.textDisplay.setText('>> %s@%s - %s - %s'%(self.instToLog, self.adressToLog, self.chToLog, self.vTypeToLog)) |
187 | 195 |