forked from openlp/openlp
Cleanup code and fixes
bzr-revno: 558
This commit is contained in:
commit
483020e2f4
@ -85,7 +85,8 @@ class PluginManager(object):
|
||||
modulename = modulename[len(prefix) + 1:]
|
||||
modulename = modulename.replace(os.path.sep, '.')
|
||||
# import the modules
|
||||
log.debug(u'Importing %s from %s. Depth %d', modulename, path, thisdepth)
|
||||
log.debug(u'Importing %s from %s. Depth %d',
|
||||
modulename, path, thisdepth)
|
||||
try:
|
||||
__import__(modulename, globals(), locals(), [])
|
||||
except ImportError, e:
|
||||
@ -131,8 +132,10 @@ class PluginManager(object):
|
||||
if plugin.status == PluginStatus.Active:
|
||||
media_manager_item = plugin.get_media_manager_item()
|
||||
if media_manager_item is not None:
|
||||
log.debug(u'Inserting media manager item from %s' % plugin.name)
|
||||
mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
|
||||
log.debug(u'Inserting media manager item from %s' % \
|
||||
plugin.name)
|
||||
mediatoolbox.addItem(media_manager_item, plugin.icon,
|
||||
media_manager_item.title)
|
||||
|
||||
def hook_settings_tabs(self, settingsform=None):
|
||||
"""
|
||||
|
@ -31,7 +31,7 @@ from PyQt4 import QtGui, QtCore
|
||||
class Renderer(object):
|
||||
"""
|
||||
Genarates a pixmap image of a array of text. The Text is formatted to
|
||||
make sure it fits on the screen and if not extra frames a generated.
|
||||
make sure it fits on the screen and if not extra frames are generated.
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'Renderer')
|
||||
|
@ -629,23 +629,25 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
if ret == QtGui.QMessageBox.Save:
|
||||
self.ServiceManagerContents.onSaveService()
|
||||
self.mainDisplay.close()
|
||||
self.ServiceManagerContents.cleanUp()
|
||||
self.cleanUp()
|
||||
event.accept()
|
||||
elif ret == QtGui.QMessageBox.Discard:
|
||||
self.mainDisplay.close()
|
||||
self.ServiceManagerContents.cleanUp()
|
||||
self.cleanUp()
|
||||
event.accept()
|
||||
else:
|
||||
event.ignore()
|
||||
else:
|
||||
self.mainDisplay.close()
|
||||
self.ServiceManagerContents.cleanUp()
|
||||
self.cleanUp()
|
||||
event.accept()
|
||||
|
||||
def cleanUp(self):
|
||||
"""
|
||||
Runs all the cleanup code before OpenLP shuts down
|
||||
"""
|
||||
# Clean temporary files used by services
|
||||
self.ServiceManagerContents.cleanUp()
|
||||
# Call the cleanup method to shutdown plugins.
|
||||
log.info(u'cleanup plugins')
|
||||
self.plugin_manager.finalise_plugins()
|
||||
|
@ -21,7 +21,7 @@ be able to:
|
||||
* Render their display (on the projection screen and in a "shrunken form"
|
||||
for preview purposes)
|
||||
|
||||
These plugins need to be part of an service. This means they need to
|
||||
These plugins need to be part of a service. This means they need to
|
||||
* Be able to tell the service manager code what to put in the service for their
|
||||
"bit"
|
||||
* Have a "tab" in the media manager, which they can render on request
|
||||
@ -47,7 +47,7 @@ Funnily enough, the core lyrics engine fits those requirements, so could
|
||||
actually form a plugin...
|
||||
|
||||
Each service entry may be made up of multiple plugins (to do text on video), so
|
||||
each plugin that contributes to an service item will need a "layering"
|
||||
each plugin that contributes to a service item will need a "layering"
|
||||
priority.
|
||||
|
||||
Plugin management
|
||||
@ -62,7 +62,7 @@ These plugins are then queried for their capabilities/requirements and
|
||||
spaces made in the prefs UI as required, and in the media manager.
|
||||
|
||||
The service manager can find out what plugins it has available (we need to
|
||||
report missing plugins when an service is loaded).
|
||||
report missing plugins when a service is loaded).
|
||||
|
||||
The display manager will get a ref to a/some plugin(s) from the service
|
||||
manager when each service item is made live, and can then call on each to
|
||||
|
Loading…
Reference in New Issue
Block a user