X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/928c4fcf26174df9b8cf62d67e0061ad703481e9..677d43acfb41f75b614b9cac0df9220906d95928:/src/gui/PGUConfiguration.py diff --git a/src/gui/PGUConfiguration.py b/src/gui/PGUConfiguration.py index 631932c..214a347 100644 --- a/src/gui/PGUConfiguration.py +++ b/src/gui/PGUConfiguration.py @@ -24,6 +24,7 @@ from cursor.WarpingCursor import * from controllers.Wiimote import Wiimote from logging.Log import Log from songs.Song import Song,loadSong +from songs.musicxmltosong import musicXml2Song from constants import * from MINWiiDialog import MINWiiDialog @@ -102,12 +103,17 @@ class PGUConfiguration(pguGui.Desktop): if dlg.value: if os.path.isfile(dlg.value): self.file = dlg.value - self.song = loadSong(self.file) - key = os.path.basename(self.file)[:-5] - if key in reversedReadabilityDict : - label = self.createLabel(reversedReadabilityDict[key]) - else : - label = self.createLabel(key) + if self.file.endswith('.smwi') : + self.song = loadSong(self.file) + key = os.path.basename(self.file)[:-5] + if key in reversedReadabilityDict : + label = self.createLabel(reversedReadabilityDict[key]) + else : + label = self.createLabel(key) + elif self.file.endswith('.xml') : + self.song = musicXml2Song(self.file, printNotes=True) + filename = os.path.basename(self.file) + label = self.createLabel(filename) self.browseButton = pguGui.Button(label) self.browseButton.connect(pguGui.CLICK, self.open_file_browser, None) if not self.songSwitch.value : @@ -115,6 +121,7 @@ class PGUConfiguration(pguGui.Desktop): self.mainTable.clear() self.fillMainTable() + def fillMainTable(self): self.mainTable.tr()