forked from openlp/openlp
Fix Bug #793091 - if plugin changed status from inactive to active plugin.appStartup now is called
bzr-revno: 1615 Fixes: https://launchpad.net/bugs/793091
This commit is contained in:
commit
e82a4e0972
@ -300,6 +300,12 @@ class Plugin(QtCore.QObject):
|
|||||||
if self.mediaItem:
|
if self.mediaItem:
|
||||||
self.mediadock.remove_dock(self.mediaItem)
|
self.mediadock.remove_dock(self.mediaItem)
|
||||||
|
|
||||||
|
def appStartup(self):
|
||||||
|
"""
|
||||||
|
Perform tasks on application starup
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
def usesTheme(self, theme):
|
def usesTheme(self, theme):
|
||||||
"""
|
"""
|
||||||
Called to find out if a plugin is currently using a theme.
|
Called to find out if a plugin is currently using a theme.
|
||||||
|
@ -655,7 +655,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# Give all the plugins a chance to perform some tasks at startup
|
# Give all the plugins a chance to perform some tasks at startup
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
for plugin in self.pluginManager.plugins:
|
for plugin in self.pluginManager.plugins:
|
||||||
if plugin.isActive() and hasattr(plugin, u'appStartup'):
|
if plugin.isActive():
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
plugin.appStartup()
|
plugin.appStartup()
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
@ -132,6 +132,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Active)
|
self.activePlugin.toggleStatus(PluginStatus.Active)
|
||||||
Receiver.send_message(u'cursor_normal')
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
self.activePlugin.appStartup()
|
||||||
else:
|
else:
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
|
Loading…
Reference in New Issue
Block a user