forked from openlp/openlp
error message update
This commit is contained in:
parent
0540453892
commit
77613086bf
@ -174,14 +174,16 @@ class PluginManager(RegistryBase, LogMixin, RegistryProperties):
|
||||
except Exception:
|
||||
uninitialised_plugins.append(plugin.name.title())
|
||||
self.log_exception('Unable to initialise plugin {plugin}'.format(plugin=plugin.name))
|
||||
display_text = None
|
||||
display_text = ''
|
||||
if uninitialised_plugins:
|
||||
display_text = translate('OpenLP.PluginManager',
|
||||
'Unable to initialise the following plugins:') + \
|
||||
'\n\n'.join(uninitialised_plugins) + '\n\n'
|
||||
error_text = State().get_text()
|
||||
if error_text:
|
||||
display_text = display_text + error_text + '\n'
|
||||
if display_text:
|
||||
display_text = display_text + \
|
||||
translate('OpenLP.PluginManager', 'See the log file for more details')
|
||||
display_text = display_text + translate('OpenLP.PluginManager', 'See the log file for more details')
|
||||
QtWidgets.QMessageBox.critical(None, UiStrings().Error, display_text,
|
||||
QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Ok))
|
||||
|
||||
|
@ -102,6 +102,17 @@ class State(LogMixin):
|
||||
"""
|
||||
self.modules[name].text = text
|
||||
|
||||
def get_text(self):
|
||||
"""
|
||||
return an string of error text
|
||||
:return: a string of text
|
||||
"""
|
||||
error_text = ''
|
||||
for mod in self.modules:
|
||||
if self.modules[mod].text:
|
||||
error_text = error_text + self.modules[mod].text + '\n'
|
||||
return error_text
|
||||
|
||||
def update_pre_conditions(self, name, status):
|
||||
"""
|
||||
Updates the preconditions state of a module
|
||||
@ -151,6 +162,10 @@ class State(LogMixin):
|
||||
return self.modules[mod].pass_preconditions
|
||||
|
||||
def list_plugins(self):
|
||||
"""
|
||||
Return a list of plugins
|
||||
:return: an array of plugins
|
||||
"""
|
||||
plugins = []
|
||||
for mod in self.modules:
|
||||
if self.modules[mod].is_plugin:
|
||||
|
Loading…
Reference in New Issue
Block a user