Bugfixes en tout genre de la version 2.0.0.
authorpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Mon, 11 Jul 2011 14:30:05 +0000 (14:30 +0000)
committerpin <pin@fe552daf-6dbe-4428-90eb-1537e0879342>
Mon, 11 Jul 2011 14:30:05 +0000 (14:30 +0000)
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@371 fe552daf-6dbe-4428-90eb-1537e0879342

src/minwii/app.py
src/minwii/widgets/home.py
src/minwii/widgets/songfilebrowser.py
src/pywiiuse/pygame_wiimouse.py

index ab10bdf..29326fd 100755 (executable)
@@ -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
index 92a0e22..b395eb6 100755 (executable)
@@ -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()
 
 
index ba8c836..da2bdec 100755 (executable)
@@ -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 :
index b8b4c99..d26ce12 100755 (executable)
@@ -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):