Small fix ups and corrections. Plugin list obeys can_be_diabled

This commit is contained in:
Tim Bentley 2009-10-11 20:31:46 +01:00
commit 7ee0549df2
3 changed files with 16 additions and 14 deletions

View File

@ -90,7 +90,7 @@ class PluginManager(object):
try: try:
__import__(modulename, globals(), locals(), []) __import__(modulename, globals(), locals(), [])
except ImportError, e: except ImportError, e:
log.error(u'Failed to import module %s on path %s for reason %s', log.exception(u'Failed to import module %s on path %s for reason %s',
modulename, path, e.args[0]) modulename, path, e.args[0])
plugin_classes = Plugin.__subclasses__() plugin_classes = Plugin.__subclasses__()
self.plugins = [] self.plugins = []

View File

@ -528,18 +528,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.versionCheck() self.versionCheck()
def versionCheck(self): def versionCheck(self):
# We do not want this in development! applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
if not log.isEnabledFor(logging.DEBUG): version = LatestVersion(self.generalConfig).checkVersion(applicationVersion)
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0') if applicationVersion != version:
version = LatestVersion(self.generalConfig).checkVersion(applicationVersion) QtGui.QMessageBox.question(None,
if applicationVersion != version: translate(u'mainWindow', u'OpenLP version Updated'),
QtGui.QMessageBox.question(None, translate(u'mainWindow', u'OpenLP version %s has been updated to version %s'
translate(u'mainWindow', u'OpenLP version Updated'), % (applicationVersion, version)),
translate(u'mainWindow', u'OpenLP version %s has been updated to version %s' QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
% (applicationVersion, version)), QtGui.QMessageBox.Ok)
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), self.generalConfig.set_config(u'Application version', version)
QtGui.QMessageBox.Ok)
self.generalConfig.set_config(u'Application version', version)
def getMonitorNumber(self): def getMonitorNumber(self):

View File

@ -83,7 +83,11 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
log.debug('PluginStatus: %s', str(self.activePlugin.status)) log.debug('PluginStatus: %s', str(self.activePlugin.status))
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.StatusComboBox.setCurrentIndex(int(self.activePlugin.status)) if self.activePlugin.can_be_disabled():
self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
self.StatusComboBox.setEnabled(True)
else:
self.StatusComboBox.setEnabled(False)
def onPluginListWidgetSelectionChanged(self): def onPluginListWidgetSelectionChanged(self):
if self.PluginListWidget.currentItem() is None: if self.PluginListWidget.currentItem() is None: