forked from openlp/openlp
Plugin clean ups
bzr-revno: 661
This commit is contained in:
commit
1bedf56dc3
@ -139,14 +139,6 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
return True
|
||||
|
||||
def can_be_disabled(self):
|
||||
"""
|
||||
Indicates whether the plugin can be disabled by the plugin list.
|
||||
|
||||
Returns True or False.
|
||||
"""
|
||||
return False
|
||||
|
||||
def set_status(self):
|
||||
"""
|
||||
Sets the status of the plugin
|
||||
|
@ -105,10 +105,7 @@ class PluginManager(object):
|
||||
for plugin in plugins_list:
|
||||
if plugin.check_pre_conditions():
|
||||
log.debug(u'Plugin %s active', unicode(plugin.name))
|
||||
if plugin.can_be_disabled():
|
||||
plugin.set_status()
|
||||
else:
|
||||
plugin.status = PluginStatus.Active
|
||||
plugin.set_status()
|
||||
else:
|
||||
plugin.status = PluginStatus.Disabled
|
||||
self.plugins.append(plugin)
|
||||
|
@ -79,17 +79,16 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
self.StatusComboBox.setCurrentIndex(-1)
|
||||
self.VersionNumberLabel.setText(u'')
|
||||
self.AboutTextBrowser.setHtml(u'')
|
||||
self.StatusComboBox.setEnabled(False)
|
||||
|
||||
def _setDetails(self):
|
||||
log.debug('PluginStatus: %s', str(self.activePlugin.status))
|
||||
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:
|
||||
self.StatusComboBox.setEnabled(False)
|
||||
self.programaticChange = True
|
||||
self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
|
||||
self.StatusComboBox.setEnabled(True)
|
||||
self.programaticChange = False
|
||||
|
||||
def onPluginListWidgetSelectionChanged(self):
|
||||
if self.PluginListWidget.currentItem() is None:
|
||||
@ -108,7 +107,6 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
|
||||
def onStatusComboBoxChanged(self, status):
|
||||
if self.programaticChange:
|
||||
self.programaticChange = False
|
||||
return
|
||||
self.activePlugin.toggle_status(status)
|
||||
if status == PluginStatus.Active:
|
||||
|
@ -41,9 +41,6 @@ class BiblePlugin(Plugin):
|
||||
#Register the bible Manager
|
||||
self.biblemanager = None
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'bibles Initialising')
|
||||
if self.biblemanager is None:
|
||||
|
@ -54,9 +54,6 @@ class CustomPlugin(Plugin):
|
||||
# Create the CustomManagerItem object
|
||||
return CustomMediaItem(self, self.icon, self.name)
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
|
@ -37,9 +37,6 @@ class ImagePlugin(Plugin):
|
||||
self.weight = -7
|
||||
self.icon = buildIcon(u':/media/media_image.png')
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
@ -60,7 +57,7 @@ class ImagePlugin(Plugin):
|
||||
about_text = self.trUtf8(u'<b>Image Plugin</b><br>Allows images of '
|
||||
u'all types to be displayed. If a number of images are selected '
|
||||
u'together and presented on the live controller it is possible '
|
||||
u'to turn them into a timed loop.<br>From the plugin if the '
|
||||
u'to turn them into a timed loop.<br<br>From the plugin if the '
|
||||
u'<i>Override background</i> is chosen and an image is selected '
|
||||
u'any somgs which are rendered will use the selected image from '
|
||||
u'the background instead of the one provied by the theme.<br>')
|
||||
|
@ -42,9 +42,6 @@ class MediaPlugin(Plugin):
|
||||
def get_settings_tab(self):
|
||||
return MediaTab(self.name)
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Plugin Initialising')
|
||||
Plugin.initialise(self)
|
||||
|
@ -46,9 +46,6 @@ class PresentationPlugin(Plugin):
|
||||
"""
|
||||
return PresentationTab(self.name, self.controllers)
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.info(u'Presentations Initialising')
|
||||
Plugin.initialise(self)
|
||||
|
@ -40,9 +40,6 @@ class RemotesPlugin(Plugin):
|
||||
self.weight = -1
|
||||
self.server = None
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def initialise(self):
|
||||
log.debug(u'initialise')
|
||||
Plugin.initialise(self)
|
||||
|
@ -57,9 +57,6 @@ class SongsPlugin(Plugin):
|
||||
self.opensong_export_form = OpenSongExportForm()
|
||||
self.icon = buildIcon(u':/media/media_song.png')
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def get_settings_tab(self):
|
||||
return SongsTab(self.name)
|
||||
|
||||
|
@ -44,9 +44,6 @@ class SongUsagePlugin(Plugin):
|
||||
self.songusagemanager = None
|
||||
self.songusageActive = False
|
||||
|
||||
def can_be_disabled(self):
|
||||
return True
|
||||
|
||||
def add_tools_menu_item(self, tools_menu):
|
||||
"""
|
||||
Give the SongUsage plugin the opportunity to add items to the
|
||||
|
@ -1 +1 @@
|
||||
1.9.0-659
|
||||
1.9.0-661
|
||||
|
Loading…
Reference in New Issue
Block a user