forked from openlp/openlp
Fix double loading
This commit is contained in:
parent
68a7fbcf56
commit
28a223bc06
@ -256,7 +256,6 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
Called by plugin to replace toolbar
|
||||
"""
|
||||
# Not sure self.media_item is being set properly
|
||||
if self.media_item is not None:
|
||||
self.mediadock.insert_dock(self.media_item, self.icon, self.weight)
|
||||
if self.settings_tab is not None:
|
||||
|
@ -136,10 +136,6 @@ class PluginManager(object):
|
||||
for plugin in self.plugins:
|
||||
if plugin.status is not PluginStatus.Disabled:
|
||||
plugin.media_item = plugin.get_media_manager_item()
|
||||
if plugin.media_item is not None:
|
||||
log.debug(u'Inserting media manager item from %s' % \
|
||||
plugin.name)
|
||||
mediadock.add_dock(plugin.media_item, plugin.icon, plugin.weight)
|
||||
|
||||
def hook_settings_tabs(self, settingsform=None):
|
||||
"""
|
||||
|
@ -55,6 +55,6 @@ class MediaDockManager(object):
|
||||
log.debug(u'remove %s dock' % name)
|
||||
for dock_index in range(0, self.media_dock.count()):
|
||||
if self.media_dock.widget(dock_index) is not None:
|
||||
if self.media_dock.widget(dock_index).ConfigSection == name.lower():
|
||||
if self.media_dock.widget(dock_index).ConfigSection == name:
|
||||
self.media_dock.widget(dock_index).hide()
|
||||
self.media_dock.removeItem(dock_index)
|
||||
|
@ -37,6 +37,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.activePlugin = None
|
||||
self.programaticChange = False
|
||||
self.setupUi(self)
|
||||
self.load()
|
||||
self._clearDetails()
|
||||
@ -84,6 +85,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
self.VersionNumberLabel.setText(self.activePlugin.version)
|
||||
self.AboutTextBrowser.setHtml(self.activePlugin.about())
|
||||
if self.activePlugin.can_be_disabled():
|
||||
self.programaticChange = True
|
||||
self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
|
||||
self.StatusComboBox.setEnabled(True)
|
||||
else:
|
||||
@ -105,6 +107,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
self._clearDetails()
|
||||
|
||||
def onStatusComboBoxChanged(self, status):
|
||||
if self.programaticChange is True:
|
||||
self.programaticChange = False
|
||||
return
|
||||
self.activePlugin.toggle_status(status)
|
||||
if status == PluginStatus.Active:
|
||||
self.activePlugin.initialise()
|
||||
@ -119,4 +124,3 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
status_text = 'Disabled'
|
||||
self.PluginListWidget.currentItem().setText(
|
||||
u'%s (%s)' % (self.activePlugin.name, status_text))
|
||||
|
||||
|
@ -49,6 +49,7 @@ class BiblePlugin(Plugin):
|
||||
if self.biblemanager is None:
|
||||
self.biblemanager = BibleManager(self.config)
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
self.ImportBibleItem.setVisible(True)
|
||||
self.ExportBibleItem.setVisible(True)
|
||||
|
||||
|
@ -60,6 +60,7 @@ class CustomPlugin(Plugin):
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
|
@ -43,6 +43,7 @@ class ImagePlugin(Plugin):
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
|
@ -48,6 +48,7 @@ class MediaPlugin(Plugin):
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
|
@ -52,6 +52,7 @@ class PresentationPlugin(Plugin):
|
||||
def initialise(self):
|
||||
log.info(u'Presentations Initialising')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
|
||||
def finalise(self):
|
||||
log.info(u'Plugin Finalise')
|
||||
|
@ -46,6 +46,7 @@ class RemotesPlugin(Plugin):
|
||||
def initialise(self):
|
||||
log.debug(u'initialise')
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
self.server = QtNetwork.QUdpSocket()
|
||||
self.server.bind(int(self.config.get_config(u'remote port', 4316)))
|
||||
QtCore.QObject.connect(self.server,
|
||||
|
@ -68,6 +68,7 @@ class SongsPlugin(Plugin):
|
||||
#if self.songmanager is None:
|
||||
# self.songmanager = SongManager(self.config)
|
||||
Plugin.initialise(self)
|
||||
self.insert_toolbox_item()
|
||||
self.ImportSongMenu.menuAction().setVisible(True)
|
||||
self.ExportSongMenu.menuAction().setVisible(True)
|
||||
self.media_item.displayResultsSong(self.songmanager.get_songs())
|
||||
|
Loading…
Reference in New Issue
Block a user