b3acce8a057786ae7c4918293180fd54c93d5bf5
1 # -*- coding: utf-8 -*-
3 Boîte de dialogue pour sélection des chansons.
9 from pgu
.gui
import FileDialog
12 class FileOpenDialog(FileDialog
):
16 def __init__(self
, path
):
17 FileDialog
.__init
__(self
,
18 title_txt
="Ouvrir une chanson",
21 #folderText = "Folder",
31 self
.input_dir
.value
= self
.curdir
32 self
.input_dir
.pos
= len(self
.curdir
)
33 self
.input_dir
.vpos
= 0
37 for i
in os
.listdir(self
.curdir
):
38 if os
.path
.isdir(os
.path
.join(self
.curdir
, i
)): dirs
.append(i
)
41 self
.input_file
.value
= "Opps! no access"
42 #if '..' not in dirs: dirs.append('..')
48 if i
.startswith('.') and i
!= '..' :
50 #item = ListItem(image=self.dir_img, text=i, value=i)
51 if self
.customFont
== None :
52 self
.list.add(i
,image
=self
.dir_img
,value
=i
)
54 label
= basic
.Label(i
,font
= self
.customFont
)
55 self
.list.add(label
,image
=self
.dir_img
,value
=i
)
57 #item = ListItem(image=None, text=i, value=i)
58 if i
.startswith('.') or (not i
.endswith('.xml')) :
60 if self
.customFont
== None :
61 self
.list.add(i
,value
=i
)
63 label
= basic
.Label(i
,font
= self
.customFont
)
64 self
.list.add(label
,value
=i
)
66 self
.list.set_vertical_scroll(0)
67 #self.list.repaintall()