Remove "Can_be_disabled" as no longer require

Sort out status handling in plugin form.
This commit is contained in:
Tim Bentley 2009-11-07 07:42:18 +00:00
parent 6148d845ae
commit 2e02f1c94f
11 changed files with 7 additions and 46 deletions

View File

@ -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

View File

@ -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)

View File

@ -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:
@ -107,9 +106,6 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self._clearDetails()
def onStatusComboBoxChanged(self, status):
if self.programaticChange:
self.programaticChange = False
return
self.activePlugin.toggle_status(status)
if status == PluginStatus.Active:
self.activePlugin.initialise()

View File

@ -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:

View File

@ -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)

View File

@ -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>')

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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