del st['padding_top']
self.td(self.songTitle, style = st)
- # choix du niveau
+ # choix du mode de jeu
self.tr()
- self.td(self.createLabel("Niveau :"), style=STYLE_LEFT_COL)
+ self.td(self.createLabel("Mode :"), style=STYLE_LEFT_COL)
self.modeSelect = Select('NORMAL')
for k, caption in PLAYING_MODES :
self.modeSelect.add(self.createLabel(caption), k)
playerTable = Table()
self.selectedWiimote = Group(name='selectedWiimote', value=0)
- for i in range(self.nwiimotes):
+ for i in range(self.nwiimotes - 1):
r = Radio(self.selectedWiimote, i)
playerTable.td(r)
playerTable.td(self.createLabel(" %d " % (i+1)))
self.tr()
self.quitButton = Button(self.createLabel("Quitter"))
self.td(self.quitButton, style={'padding_top' : 50})
- self.playButton = Button(self.createLabel("Jouer"), disabled=not self.songFile)
+ self.playButton = Button(self.createLabel("Jouer"))
self.td(self.playButton, style={'padding_top' : 50})
@property
@selectedPlayMode.setter
def selectedPlayMode(self, value) :
self.modeSelect.value = value
+ if self.selectedPlayMode != 'IMPRO' and \
+ not self.songFile :
+ self.playButton.disabled = True
+ else :
+ self.playButton.disabled = False
@property
def selectedWiimoteIndex(self) :
self.browseButton.connect(CLICK, self.open_file_browser)
self.quitButton.connect(CLICK, self._exitApp)
self.playButton.connect(CLICK, self._exitHome)
+ self.modeSelect.connect(CHANGE, self._changeModeCB)
+
+ def _changeModeCB(self) :
+ if self.selectedPlayMode == 'IMPRO' :
+ self.playButton.disabled = False
+ elif not self.songFile :
+ self.playButton.disabled = True
def _exitApp(self, data=None) :
self.exitApp = True