1 # -*- coding: utf-8 -*-
3 Created on 17 dec. 2009
8 import pgu
.gui
as pguGui
12 class MINWiiDialog(pguGui
.FileDialog
):
17 def __init__(self
, font
= None, width
= 800, height
= 600,path
=None):
18 pguGui
.FileDialog
.__init
__(self
,title_txt
= "Choisir une chanson", customFont
= font
,customWidth
= width
, customHeight
= height
,folderText
= "", fileText
= "",path
=path
,showCurDir
= False)
21 self
.input_dir
.value
= self
.curdir
22 self
.input_dir
.pos
= len(self
.curdir
)
23 self
.input_dir
.vpos
= 0
27 for i
in os
.listdir(self
.curdir
):
28 if os
.path
.isdir(os
.path
.join(self
.curdir
, i
)): dirs
.append(i
)
31 self
.input_file
.value
= "Opps! no access"
32 #if '..' not in dirs: dirs.append('..')
38 #item = ListItem(image=self.dir_img, text=i, value=i)
39 if self
.customFont
== None :
40 self
.list.add(i
,image
=self
.dir_img
,value
=i
)
42 if i
== ".." or i
[0] != ".":
43 label
= pguGui
.basic
.Label(i
,font
= self
.customFont
)
44 self
.list.add(label
,image
=self
.dir_img
,value
=i
)
46 #item = ListItem(image=None, text=i, value=i)
47 if self
.customFont
== None :
48 self
.list.add(i
,value
=i
)
50 if i
.endswith(".smwi"):
52 if key
in constants
.reversedReadabilityDict
:
53 label
= pguGui
.basic
.Label(constants
.reversedReadabilityDict
[key
],font
= self
.customFont
)
55 label
= pguGui
.basic
.Label(key
,font
= self
.customFont
)
56 self
.list.add(label
,value
=i
)
57 elif i
.endswith(".xml") :
58 # TODO : afficher le Titre de la chanson au lieu du nom
60 label
= pguGui
.basic
.Label(i
, font
=self
.customFont
)
61 self
.list.add(label
,value
=i
)
63 self
.list.set_vertical_scroll(0)
64 #self.list.repaintall()