def on_file_button_pressed(self): caption = _("Choose Sound") sound_dir = get_data_file('media', 'sounds') file_filter = _("Sounds (*.mp3 *.ogg *.wav);;MP3 (*.mp3);;Ogg (*.ogg);;WAVE (*.wav)") (filename, selected_filter) = QFileDialog.getOpenFileName(self, caption, sound_dir, file_filter) self.file_edit.setText(filename)
def on_file_button_pressed(self): caption = _("Choose Sound") sound_dir = get_data_file('media', 'sounds') file_filter = _( "Sounds (*.mp3 *.ogg *.wav);;MP3 (*.mp3);;Ogg (*.ogg);;WAVE (*.wav)" ) (filename, selected_filter) = QFileDialog.getOpenFileName( self, caption, sound_dir, file_filter) self.file_edit.setText(filename)
def get_media_file(media_file_name): media_filename = get_data_file('media', '%s' % (media_file_name, )) if not os.path.exists(media_filename): media_filename = None return "file:///" + media_filename
def get_media_file(media_file_name): media_filename = get_data_file('media', '%s' % (media_file_name,)) if not os.path.exists(media_filename): media_filename = None return "file:///" + media_filename