From: pin Date: Mon, 11 Jul 2011 14:30:05 +0000 (+0000) Subject: Bugfixes en tout genre de la version 2.0.0. X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/commitdiff_plain/27f5c5b477613baebb83d3af27d57f8ee506a585 Bugfixes en tout genre de la version 2.0.0. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@371 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/app.py b/src/minwii/app.py index ab10bdf..29326fd 100755 --- a/src/minwii/app.py +++ b/src/minwii/app.py @@ -110,7 +110,9 @@ class MinWii(object): self.screen = SCREEN_HOME exit, songFile, playMode, displayNotes, wiimoteIndex = \ self.selectSongAndOptions(songFile, playMode, displayNotes, wiimoteIndex) - if exit : break + if exit : + WT.quit() + break self.screen = SCREEN_INSTRUMENTS diff --git a/src/minwii/widgets/home.py b/src/minwii/widgets/home.py index 92a0e22..b395eb6 100755 --- a/src/minwii/widgets/home.py +++ b/src/minwii/widgets/home.py @@ -54,6 +54,7 @@ class Home(object, Table) : self.selectedPlayMode = params.get('playMode', 'NORMAL') self.displayNotes = params.get('displayNotes', True) self.selectedWiimoteIndex = params.get('wiimoteIndex', 0) + self.exitApp = False self._initLocalListeners() diff --git a/src/minwii/widgets/songfilebrowser.py b/src/minwii/widgets/songfilebrowser.py index ba8c836..da2bdec 100755 --- a/src/minwii/widgets/songfilebrowser.py +++ b/src/minwii/widgets/songfilebrowser.py @@ -111,10 +111,10 @@ class FileOpenDialog(FileDialog): style = {} if iw > ih : style['width'] = PICTURE_ITEM_SIZE - style['height'] = PICTURE_ITEM_SIZE * float(ih) / iw + style['height'] = int(round(PICTURE_ITEM_SIZE * float(ih) / iw)) else : style['heigth'] = PICTURE_ITEM_SIZE - style['width'] = PICTURE_ITEM_SIZE * float(iw) / ih + style['width'] = int(round(PICTURE_ITEM_SIZE * float(iw) / ih)) img = basic.Image(img, style=style) else : diff --git a/src/pywiiuse/pygame_wiimouse.py b/src/pywiiuse/pygame_wiimouse.py index b8b4c99..d26ce12 100755 --- a/src/pywiiuse/pygame_wiimouse.py +++ b/src/pywiiuse/pygame_wiimouse.py @@ -88,23 +88,6 @@ class wiimote_thread(Thread): def selectWiimote(self, wiimoteIndex) : self.selectedWiimoteIndex = wiimoteIndex -# for i in range(self.actual_nmotes) : -# wm = self.wiimotes[i] -# if i == wiimoteIndex : -# self.do(wiiuse.set_ir, wm, 1) -# self.do(wiiuse.set_ir_vres, wm, *self.screenResolution) -# if self.position == 'ABOVE' : -# position = wiiuse.IR_ABOVE -# elif self.position == 'BELOW' : -# position = wiiuse.IR_BELOW -# else : -# position = wiiuse.IR_ABOVE -# self.do(wiiuse.set_ir_position, wm, position) -# # TODO aspect ratio -# #self.do(wiiuse.set_aspect_ratio, wm, aspect) -# -# else : -# self.do(wiiuse.set_ir, wm, 0) def do(self, func, *args): '''Run the function in the thread handling the wiimote''' @@ -127,9 +110,10 @@ class wiimote_thread(Thread): def quit(self): '''Go away.''' - for i in range(self.nmotes): - wiiuse.set_leds(self.wiimotes[i], 0) - wiiuse.disconnect(self.wiimotes[i]) + # TODO will crash if self.nmotes > 4 + # for i in range(self.nmotes): + # wiiuse.set_leds(self.wiimotes[i], 0) + # wiiuse.disconnect(self.wiimotes[i]) self.go = False def get_count(self):