forked from openlp/openlp
- clean ups
bzr-revno: 1984
This commit is contained in:
commit
6c981afedc
@ -268,7 +268,7 @@ class Receiver(object):
|
|||||||
<<ACTION>>
|
<<ACTION>>
|
||||||
)``
|
)``
|
||||||
"""
|
"""
|
||||||
eventreceiver = EventReceiver()
|
__eventreceiver__ = EventReceiver()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def send_message(event, msg=None):
|
def send_message(event, msg=None):
|
||||||
@ -281,11 +281,11 @@ class Receiver(object):
|
|||||||
``msg``
|
``msg``
|
||||||
Defaults to *None*. The message to send with the event.
|
Defaults to *None*. The message to send with the event.
|
||||||
"""
|
"""
|
||||||
Receiver.eventreceiver.send_message(event, msg)
|
Receiver.__eventreceiver__.send_message(event, msg)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_receiver():
|
def get_receiver():
|
||||||
"""
|
"""
|
||||||
Get the global ``eventreceiver`` instance.
|
Get the global ``__eventreceiver__`` instance.
|
||||||
"""
|
"""
|
||||||
return Receiver.eventreceiver
|
return Receiver.__eventreceiver__
|
||||||
|
@ -41,13 +41,13 @@ class PluginManager(object):
|
|||||||
and executes all the hooks, as and when necessary.
|
and executes all the hooks, as and when necessary.
|
||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager loaded')
|
log.info(u'Plugin manager loaded')
|
||||||
|
__instance__ = None
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_instance():
|
def get_instance():
|
||||||
"""
|
"""
|
||||||
Obtain a single instance of class.
|
Obtain a single instance of class.
|
||||||
"""
|
"""
|
||||||
return PluginManager.instance
|
return PluginManager.__instance__
|
||||||
|
|
||||||
def __init__(self, plugin_dir):
|
def __init__(self, plugin_dir):
|
||||||
"""
|
"""
|
||||||
@ -58,7 +58,7 @@ class PluginManager(object):
|
|||||||
The directory to search for plugins.
|
The directory to search for plugins.
|
||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager Initialising')
|
log.info(u'Plugin manager Initialising')
|
||||||
PluginManager.instance = self
|
PluginManager.__instance__ = self
|
||||||
if not plugin_dir in sys.path:
|
if not plugin_dir in sys.path:
|
||||||
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
||||||
sys.path.insert(0, plugin_dir)
|
sys.path.insert(0, plugin_dir)
|
||||||
|
@ -303,7 +303,7 @@ class Renderer(object):
|
|||||||
try:
|
try:
|
||||||
text_to_render, text = \
|
text_to_render, text = \
|
||||||
text.split(u'\n[---]\n', 1)
|
text.split(u'\n[---]\n', 1)
|
||||||
except:
|
except ValueError:
|
||||||
text_to_render = text.split(u'\n[---]\n')[0]
|
text_to_render = text.split(u'\n[---]\n')[0]
|
||||||
text = u''
|
text = u''
|
||||||
text_to_render, raw_tags, html_tags = \
|
text_to_render, raw_tags, html_tags = \
|
||||||
|
@ -100,9 +100,8 @@ class Display(QtGui.QGraphicsView):
|
|||||||
self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal,
|
self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal,
|
||||||
QtCore.Qt.ScrollBarAlwaysOff)
|
QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
def resizeEvent(self, ev):
|
def resizeEvent(self, event):
|
||||||
self.webView.setGeometry(0, 0,
|
self.webView.setGeometry(0, 0, self.width(), self.height())
|
||||||
self.width(), self.height())
|
|
||||||
|
|
||||||
def isWebLoaded(self):
|
def isWebLoaded(self):
|
||||||
"""
|
"""
|
||||||
@ -120,7 +119,6 @@ class MainDisplay(Display):
|
|||||||
Display.__init__(self, parent, live, controller)
|
Display.__init__(self, parent, live, controller)
|
||||||
self.imageManager = imageManager
|
self.imageManager = imageManager
|
||||||
self.screens = ScreenList()
|
self.screens = ScreenList()
|
||||||
self.plugins = PluginManager.get_instance().plugins
|
|
||||||
self.rebuildCSS = False
|
self.rebuildCSS = False
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
self.override = {}
|
self.override = {}
|
||||||
|
@ -335,8 +335,7 @@ class MediaController(object):
|
|||||||
if controller.isLive and \
|
if controller.isLive and \
|
||||||
(QtCore.QSettings().value(u'general/auto unblank',
|
(QtCore.QSettings().value(u'general/auto unblank',
|
||||||
QtCore.QVariant(False)).toBool() or \
|
QtCore.QVariant(False)).toBool() or \
|
||||||
controller.media_info.is_background == True) or \
|
controller.media_info.is_background) or not controller.isLive:
|
||||||
controller.isLive == False:
|
|
||||||
if not self.video_play([controller]):
|
if not self.video_play([controller]):
|
||||||
critical_error_message_box(
|
critical_error_message_box(
|
||||||
translate('MediaPlugin.MediaItem', 'Unsupported File'),
|
translate('MediaPlugin.MediaItem', 'Unsupported File'),
|
||||||
@ -495,7 +494,7 @@ class MediaController(object):
|
|||||||
return
|
return
|
||||||
controller = self.parent.liveController
|
controller = self.parent.liveController
|
||||||
for display in self.curDisplayMediaPlayer.keys():
|
for display in self.curDisplayMediaPlayer.keys():
|
||||||
if display.controller != controller or \
|
if display.controller != controller or \
|
||||||
self.curDisplayMediaPlayer[display].state != MediaState.Playing:
|
self.curDisplayMediaPlayer[display].state != MediaState.Playing:
|
||||||
continue
|
continue
|
||||||
self.curDisplayMediaPlayer[display].pause(display)
|
self.curDisplayMediaPlayer[display].pause(display)
|
||||||
|
@ -38,21 +38,21 @@ from openlp.core.ui.media import MediaState
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
ADDITIONAL_EXT = {
|
ADDITIONAL_EXT = {
|
||||||
u'audio/ac3': [u'.ac3'],
|
u'audio/ac3': [u'.ac3'],
|
||||||
u'audio/flac': [u'.flac'],
|
u'audio/flac': [u'.flac'],
|
||||||
u'audio/x-m4a': [u'.m4a'],
|
u'audio/x-m4a': [u'.m4a'],
|
||||||
u'audio/midi': [u'.mid', u'.midi'],
|
u'audio/midi': [u'.mid', u'.midi'],
|
||||||
u'audio/x-mp3': [u'.mp3'],
|
u'audio/x-mp3': [u'.mp3'],
|
||||||
u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'],
|
u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'],
|
||||||
u'audio/qcelp': [u'.qcp'],
|
u'audio/qcelp': [u'.qcp'],
|
||||||
u'audio/x-wma': [u'.wma'],
|
u'audio/x-wma': [u'.wma'],
|
||||||
u'audio/x-ms-wma': [u'.wma'],
|
u'audio/x-ms-wma': [u'.wma'],
|
||||||
u'video/x-flv': [u'.flv'],
|
u'video/x-flv': [u'.flv'],
|
||||||
u'video/x-matroska': [u'.mpv', u'.mkv'],
|
u'video/x-matroska': [u'.mpv', u'.mkv'],
|
||||||
u'video/x-wmv': [u'.wmv'],
|
u'video/x-wmv': [u'.wmv'],
|
||||||
u'video/x-mpg': [u'.mpg'],
|
u'video/x-mpg': [u'.mpg'],
|
||||||
u'video/mpeg' : [u'.mp4', u'.mts'],
|
u'video/mpeg' : [u'.mp4', u'.mts'],
|
||||||
u'video/x-ms-wmv': [u'.wmv']}
|
u'video/x-ms-wmv': [u'.wmv']}
|
||||||
|
|
||||||
|
|
||||||
class PhononPlayer(MediaPlayer):
|
class PhononPlayer(MediaPlayer):
|
||||||
@ -101,7 +101,7 @@ class PhononPlayer(MediaPlayer):
|
|||||||
display.mediaObject = Phonon.MediaObject(display)
|
display.mediaObject = Phonon.MediaObject(display)
|
||||||
Phonon.createPath(display.mediaObject, display.phononWidget)
|
Phonon.createPath(display.mediaObject, display.phononWidget)
|
||||||
if display.hasAudio:
|
if display.hasAudio:
|
||||||
display.audio = Phonon.AudioOutput( \
|
display.audio = Phonon.AudioOutput(
|
||||||
Phonon.VideoCategory, display.mediaObject)
|
Phonon.VideoCategory, display.mediaObject)
|
||||||
Phonon.createPath(display.mediaObject, display.audio)
|
Phonon.createPath(display.mediaObject, display.audio)
|
||||||
display.phononWidget.raise_()
|
display.phononWidget.raise_()
|
||||||
@ -148,18 +148,17 @@ class PhononPlayer(MediaPlayer):
|
|||||||
controller.media_info.start_time > 0:
|
controller.media_info.start_time > 0:
|
||||||
start_time = controller.media_info.start_time
|
start_time = controller.media_info.start_time
|
||||||
display.mediaObject.play()
|
display.mediaObject.play()
|
||||||
if self.media_state_wait(display, Phonon.PlayingState):
|
if not self.media_state_wait(display, Phonon.PlayingState):
|
||||||
if start_time > 0:
|
|
||||||
self.seek(display, controller.media_info.start_time*1000)
|
|
||||||
self.volume(display, controller.media_info.volume)
|
|
||||||
controller.media_info.length = \
|
|
||||||
int(display.mediaObject.totalTime()/1000)
|
|
||||||
controller.seekSlider.setMaximum(controller.media_info.length*1000)
|
|
||||||
self.state = MediaState.Playing
|
|
||||||
display.phononWidget.raise_()
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
if start_time > 0:
|
||||||
|
self.seek(display, controller.media_info.start_time * 1000)
|
||||||
|
self.volume(display, controller.media_info.volume)
|
||||||
|
controller.media_info.length = \
|
||||||
|
int(display.mediaObject.totalTime() / 1000)
|
||||||
|
controller.seekSlider.setMaximum(controller.media_info.length * 1000)
|
||||||
|
self.state = MediaState.Playing
|
||||||
|
display.phononWidget.raise_()
|
||||||
|
return True
|
||||||
|
|
||||||
def pause(self, display):
|
def pause(self, display):
|
||||||
display.mediaObject.pause()
|
display.mediaObject.pause()
|
||||||
@ -198,9 +197,9 @@ class PhononPlayer(MediaPlayer):
|
|||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.end_time > 0:
|
if controller.media_info.end_time > 0:
|
||||||
if display.mediaObject.currentTime() > \
|
if display.mediaObject.currentTime() > \
|
||||||
controller.media_info.end_time*1000:
|
controller.media_info.end_time * 1000:
|
||||||
self.stop(display)
|
self.stop(display)
|
||||||
self.set_visible(display, False)
|
self.set_visible(display, False)
|
||||||
if not controller.seekSlider.isSliderDown():
|
if not controller.seekSlider.isSliderDown():
|
||||||
controller.seekSlider.setSliderPosition( \
|
controller.seekSlider.setSliderPosition(
|
||||||
display.mediaObject.currentTime())
|
display.mediaObject.currentTime())
|
||||||
|
@ -62,7 +62,7 @@ if VLC_AVAILABLE:
|
|||||||
log.debug(u'VLC could not be loaded: %s' % version)
|
log.debug(u'VLC could not be loaded: %s' % version)
|
||||||
|
|
||||||
AUDIO_EXT = [
|
AUDIO_EXT = [
|
||||||
u'*.mp3'
|
u'*.mp3'
|
||||||
, u'*.wav'
|
, u'*.wav'
|
||||||
, u'*.ogg'
|
, u'*.ogg'
|
||||||
]
|
]
|
||||||
@ -130,9 +130,9 @@ class VlcPlayer(MediaPlayer):
|
|||||||
# this is platform specific!
|
# this is platform specific!
|
||||||
# you have to give the id of the QFrame (or similar object) to
|
# you have to give the id of the QFrame (or similar object) to
|
||||||
# vlc, different platforms have different functions for this
|
# vlc, different platforms have different functions for this
|
||||||
if sys.platform == "win32": # for Windows
|
if sys.platform == "win32":
|
||||||
display.vlcMediaPlayer.set_hwnd(int(display.vlcWidget.winId()))
|
display.vlcMediaPlayer.set_hwnd(int(display.vlcWidget.winId()))
|
||||||
elif sys.platform == "darwin": # for MacOS
|
elif sys.platform == "darwin":
|
||||||
display.vlcMediaPlayer.set_agl(int(display.vlcWidget.winId()))
|
display.vlcMediaPlayer.set_agl(int(display.vlcWidget.winId()))
|
||||||
else:
|
else:
|
||||||
# for Linux using the X Server
|
# for Linux using the X Server
|
||||||
@ -181,17 +181,16 @@ class VlcPlayer(MediaPlayer):
|
|||||||
if controller.media_info.start_time > 0:
|
if controller.media_info.start_time > 0:
|
||||||
start_time = controller.media_info.start_time
|
start_time = controller.media_info.start_time
|
||||||
display.vlcMediaPlayer.play()
|
display.vlcMediaPlayer.play()
|
||||||
if self.media_state_wait(display, vlc.State.Playing):
|
if not self.media_state_wait(display, vlc.State.Playing):
|
||||||
if start_time > 0:
|
|
||||||
self.seek(display, controller.media_info.start_time * 1000)
|
|
||||||
controller.media_info.length = \
|
|
||||||
int(display.vlcMediaPlayer.get_media().get_duration() / 1000)
|
|
||||||
controller.seekSlider.setMaximum(controller.media_info.length * 1000)
|
|
||||||
self.state = MediaState.Playing
|
|
||||||
display.vlcWidget.raise_()
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
if start_time > 0:
|
||||||
|
self.seek(display, controller.media_info.start_time * 1000)
|
||||||
|
controller.media_info.length = \
|
||||||
|
int(display.vlcMediaPlayer.get_media().get_duration() / 1000)
|
||||||
|
controller.seekSlider.setMaximum(controller.media_info.length * 1000)
|
||||||
|
self.state = MediaState.Playing
|
||||||
|
display.vlcWidget.raise_()
|
||||||
|
return True
|
||||||
|
|
||||||
def pause(self, display):
|
def pause(self, display):
|
||||||
if display.vlcMedia.get_state() != vlc.State.Playing:
|
if display.vlcMedia.get_state() != vlc.State.Playing:
|
||||||
|
@ -227,33 +227,33 @@ FLASH_HTML = u"""
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
VIDEO_EXT = [
|
VIDEO_EXT = [
|
||||||
u'*.3gp'
|
u'*.3gp'
|
||||||
, u'*.3gpp'
|
, u'*.3gpp'
|
||||||
, u'*.3g2'
|
, u'*.3g2'
|
||||||
, u'*.3gpp2'
|
, u'*.3gpp2'
|
||||||
, u'*.aac'
|
, u'*.aac'
|
||||||
, u'*.flv'
|
, u'*.flv'
|
||||||
, u'*.f4a'
|
, u'*.f4a'
|
||||||
, u'*.f4b'
|
, u'*.f4b'
|
||||||
, u'*.f4p'
|
, u'*.f4p'
|
||||||
, u'*.f4v'
|
, u'*.f4v'
|
||||||
, u'*.mov'
|
, u'*.mov'
|
||||||
, u'*.m4a'
|
, u'*.m4a'
|
||||||
, u'*.m4b'
|
, u'*.m4b'
|
||||||
, u'*.m4p'
|
, u'*.m4p'
|
||||||
, u'*.m4v'
|
, u'*.m4v'
|
||||||
, u'*.mkv'
|
, u'*.mkv'
|
||||||
, u'*.mp4'
|
, u'*.mp4'
|
||||||
, u'*.ogv'
|
, u'*.ogv'
|
||||||
, u'*.webm'
|
, u'*.webm'
|
||||||
, u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi'
|
, u'*.mpg', u'*.wmv', u'*.mpeg', u'*.avi'
|
||||||
, u'*.swf'
|
, u'*.swf'
|
||||||
]
|
]
|
||||||
|
|
||||||
AUDIO_EXT = [
|
AUDIO_EXT = [
|
||||||
u'*.mp3'
|
u'*.mp3'
|
||||||
, u'*.ogg'
|
, u'*.ogg'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class WebkitPlayer(MediaPlayer):
|
class WebkitPlayer(MediaPlayer):
|
||||||
@ -339,7 +339,7 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
else:
|
else:
|
||||||
display.frame.evaluateJavaScript(u'show_video("play");')
|
display.frame.evaluateJavaScript(u'show_video("play");')
|
||||||
if start_time > 0:
|
if start_time > 0:
|
||||||
self.seek(display, controller.media_info.start_time*1000)
|
self.seek(display, controller.media_info.start_time * 1000)
|
||||||
# TODO add playing check and get the correct media length
|
# TODO add playing check and get the correct media length
|
||||||
controller.media_info.length = length
|
controller.media_info.length = length
|
||||||
self.state = MediaState.Playing
|
self.state = MediaState.Playing
|
||||||
@ -375,11 +375,11 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.is_flash:
|
if controller.media_info.is_flash:
|
||||||
seek = seekVal
|
seek = seekVal
|
||||||
display.frame.evaluateJavaScript( \
|
display.frame.evaluateJavaScript(
|
||||||
u'show_flash("seek", null, null, "%s");' % (seek))
|
u'show_flash("seek", null, null, "%s");' % (seek))
|
||||||
else:
|
else:
|
||||||
seek = float(seekVal)/1000
|
seek = float(seekVal) / 1000
|
||||||
display.frame.evaluateJavaScript( \
|
display.frame.evaluateJavaScript(
|
||||||
u'show_video("seek", null, null, null, "%f");' % (seek))
|
u'show_video("seek", null, null, null, "%f");' % (seek))
|
||||||
|
|
||||||
def reset(self, display):
|
def reset(self, display):
|
||||||
@ -406,24 +406,24 @@ class WebkitPlayer(MediaPlayer):
|
|||||||
def update_ui(self, display):
|
def update_ui(self, display):
|
||||||
controller = display.controller
|
controller = display.controller
|
||||||
if controller.media_info.is_flash:
|
if controller.media_info.is_flash:
|
||||||
currentTime = display.frame.evaluateJavaScript( \
|
currentTime = display.frame.evaluateJavaScript(
|
||||||
u'show_flash("currentTime");').toInt()[0]
|
u'show_flash("currentTime");').toInt()[0]
|
||||||
length = display.frame.evaluateJavaScript( \
|
length = display.frame.evaluateJavaScript(
|
||||||
u'show_flash("length");').toInt()[0]
|
u'show_flash("length");').toInt()[0]
|
||||||
else:
|
else:
|
||||||
if display.frame.evaluateJavaScript( \
|
if display.frame.evaluateJavaScript(
|
||||||
u'show_video("isEnded");').toString() == 'true':
|
u'show_video("isEnded");').toString() == 'true':
|
||||||
self.stop(display)
|
self.stop(display)
|
||||||
(currentTime, ok) = display.frame.evaluateJavaScript( \
|
(currentTime, ok) = display.frame.evaluateJavaScript(
|
||||||
u'show_video("currentTime");').toFloat()
|
u'show_video("currentTime");').toFloat()
|
||||||
# check if conversion was ok and value is not 'NaN'
|
# check if conversion was ok and value is not 'NaN'
|
||||||
if ok and currentTime != float('inf'):
|
if ok and currentTime != float('inf'):
|
||||||
currentTime = int(currentTime*1000)
|
currentTime = int(currentTime * 1000)
|
||||||
(length, ok) = display.frame.evaluateJavaScript( \
|
(length, ok) = display.frame.evaluateJavaScript(
|
||||||
u'show_video("length");').toFloat()
|
u'show_video("length");').toFloat()
|
||||||
# check if conversion was ok and value is not 'NaN'
|
# check if conversion was ok and value is not 'NaN'
|
||||||
if ok and length != float('inf'):
|
if ok and length != float('inf'):
|
||||||
length = int(length*1000)
|
length = int(length * 1000)
|
||||||
if currentTime > 0:
|
if currentTime > 0:
|
||||||
controller.media_info.length = length
|
controller.media_info.length = length
|
||||||
controller.seekSlider.setMaximum(length)
|
controller.seekSlider.setMaximum(length)
|
||||||
|
@ -102,9 +102,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
self.versionNumberLabel.setText(self.activePlugin.version)
|
self.versionNumberLabel.setText(self.activePlugin.version)
|
||||||
self.aboutTextBrowser.setHtml(self.activePlugin.about())
|
self.aboutTextBrowser.setHtml(self.activePlugin.about())
|
||||||
self.programaticChange = True
|
self.programaticChange = True
|
||||||
status = 1
|
status = PluginStatus.Active
|
||||||
if self.activePlugin.status == PluginStatus.Active:
|
if self.activePlugin.status == PluginStatus.Active:
|
||||||
status = 0
|
status = PluginStatus.Inactive
|
||||||
self.statusComboBox.setCurrentIndex(status)
|
self.statusComboBox.setCurrentIndex(status)
|
||||||
self.statusComboBox.setEnabled(True)
|
self.statusComboBox.setEnabled(True)
|
||||||
self.programaticChange = False
|
self.programaticChange = False
|
||||||
@ -129,7 +129,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
def onStatusComboBoxChanged(self, status):
|
def onStatusComboBoxChanged(self, status):
|
||||||
if self.programaticChange or status == PluginStatus.Disabled:
|
if self.programaticChange or status == PluginStatus.Disabled:
|
||||||
return
|
return
|
||||||
if status == 0:
|
if status == PluginStatus.Inactive:
|
||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Active)
|
self.activePlugin.toggleStatus(PluginStatus.Active)
|
||||||
Receiver.send_message(u'cursor_normal')
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
@ -580,10 +580,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
return self.saveFileAs()
|
return self.saveFileAs()
|
||||||
self.mainwindow.addRecentFile(path_file_name)
|
self.mainwindow.addRecentFile(path_file_name)
|
||||||
self.setModified(False)
|
self.setModified(False)
|
||||||
try:
|
delete_file(temp_file_name)
|
||||||
delete_file(temp_file_name)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return success
|
return success
|
||||||
|
|
||||||
def saveFileAs(self):
|
def saveFileAs(self):
|
||||||
|
@ -172,17 +172,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
def loadThemes(self, theme_list):
|
def loadThemes(self, theme_list):
|
||||||
self.themeComboBox.clear()
|
self.themeComboBox.clear()
|
||||||
self.themeComboBox.addItem(u'')
|
self.themeComboBox.addItem(u'')
|
||||||
self.themes = []
|
self.themes = theme_list
|
||||||
for theme in theme_list:
|
self.themeComboBox.addItems(theme_list)
|
||||||
self.themeComboBox.addItem(theme)
|
|
||||||
self.themes.append(theme)
|
|
||||||
set_case_insensitive_completer(self.themes, self.themeComboBox)
|
set_case_insensitive_completer(self.themes, self.themeComboBox)
|
||||||
|
|
||||||
def loadMediaFiles(self):
|
def loadMediaFiles(self):
|
||||||
self.audioAddFromMediaButton.setVisible(False)
|
self.audioAddFromMediaButton.setVisible(False)
|
||||||
for plugin in self.parent().pluginManager.plugins:
|
for plugin in self.parent().pluginManager.plugins:
|
||||||
if plugin.name == u'media' and \
|
if plugin.name == u'media' and plugin.status == PluginStatus.Active:
|
||||||
plugin.status == PluginStatus.Active:
|
|
||||||
self.audioAddFromMediaButton.setVisible(True)
|
self.audioAddFromMediaButton.setVisible(True)
|
||||||
self.mediaForm.populateFiles(
|
self.mediaForm.populateFiles(
|
||||||
plugin.mediaItem.getList(MediaType.Audio))
|
plugin.mediaItem.getList(MediaType.Audio))
|
||||||
|
Loading…
Reference in New Issue
Block a user