forked from openlp/openlp
Automate Media type list from phonon
bzr-revno: 718
This commit is contained in:
commit
69af99f5dc
@ -61,9 +61,9 @@ class MediaMediaItem(MediaManagerItem):
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = self.trUtf8('Select Media')
|
||||
self.OnNewFileMasks = self.trUtf8('Videos (*.avi *.mpeg *.mpg *.wmv '
|
||||
'*.mov *.mp4 *.flv);;Audio (*.ogg *.mp3 *.wma *.wav *.flac)'
|
||||
';;All files (*)')
|
||||
self.OnNewFileMasks = self.trUtf8('Videos (%s);;'
|
||||
'Audio (%s);;'
|
||||
'All files (*)' % (self.parent.video_list, self.parent.audio_list))
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
@ -41,9 +41,25 @@ class MediaPlugin(Plugin):
|
||||
# passed with drag and drop messages
|
||||
self.dnd_id = u'Media'
|
||||
self.status = PluginStatus.Active
|
||||
# print Phonon.BackendCapabilities.availableMimeTypes()
|
||||
# for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||
# print mimetype
|
||||
self.audio_list = u''
|
||||
self.video_list = u''
|
||||
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
|
||||
mimetype = unicode(mimetype)
|
||||
type = mimetype.split(u'audio/x-')
|
||||
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype)
|
||||
type = mimetype.split(u'audio/')
|
||||
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype)
|
||||
type = mimetype.split(u'video/x-')
|
||||
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
|
||||
type = mimetype.split(u'video/')
|
||||
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
|
||||
|
||||
def _add_to_list(self, list, value, type):
|
||||
if len(value) == 2:
|
||||
if list.find(value[1]) == -1:
|
||||
list += u'*.%s ' % value[1]
|
||||
type = u''
|
||||
return list, type
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
|
@ -1 +1 @@
|
||||
1.9.0-716
|
||||
1.9.0-718
|
||||
|
Loading…
Reference in New Issue
Block a user