Fixed bug #789046 and cleaned up one or two other things.

This commit is contained in:
Raoul Snyman 2011-06-11 23:04:52 +02:00
parent b1b3583846
commit d337ecacb6
2 changed files with 14 additions and 10 deletions

View File

@ -483,7 +483,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
pluginpath = AppLocation.get_directory(AppLocation.PluginsDir) pluginpath = AppLocation.get_directory(AppLocation.PluginsDir)
self.pluginManager = PluginManager(pluginpath) self.pluginManager = PluginManager(pluginpath)
self.pluginHelpers = {} self.pluginHelpers = {}
self.image_manager = ImageManager() self.imageManager = ImageManager()
# Set up the interface # Set up the interface
self.setupUi(self) self.setupUi(self)
# Load settings after setupUi so default UI sizes are overwritten # Load settings after setupUi so default UI sizes are overwritten
@ -552,7 +552,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# warning cyclic dependency # warning cyclic dependency
# renderer needs to call ThemeManager and # renderer needs to call ThemeManager and
# ThemeManager needs to call Renderer # ThemeManager needs to call Renderer
self.renderer = Renderer(self.image_manager, self.themeManagerContents) self.renderer = Renderer(self.imageManager, self.themeManagerContents)
# Define the media Dock Manager # Define the media Dock Manager
self.mediaDockManager = MediaDockManager(self.mediaToolBox) self.mediaDockManager = MediaDockManager(self.mediaToolBox)
log.info(u'Load Plugins') log.info(u'Load Plugins')
@ -598,6 +598,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# Once all components are initialised load the Themes # Once all components are initialised load the Themes
log.info(u'Load Themes') log.info(u'Load Themes')
self.themeManagerContents.loadThemes(True) self.themeManagerContents.loadThemes(True)
# Hide/show the theme combobox on the service manager
Receiver.send_message(u'theme_update_global')
# Reset the cursor
Receiver.send_message(u'cursor_normal') Receiver.send_message(u'cursor_normal')
def setAutoLanguage(self, value): def setAutoLanguage(self, value):
@ -652,13 +655,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.modeLiveItem.setChecked(True) self.modeLiveItem.setChecked(True)
def appStartup(self): def appStartup(self):
# 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(): if plugin.isActive():
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')
def firstTime(self): def firstTime(self):
# Import themes if first time # Import themes if first time
@ -809,7 +813,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
""" """
log.debug(u'screenChanged') log.debug(u'screenChanged')
Receiver.send_message(u'cursor_busy') Receiver.send_message(u'cursor_busy')
self.image_manager.update_display() self.imageManager.update_display()
self.renderer.update_display() self.renderer.update_display()
self.previewController.screenSizeChanged() self.previewController.screenSizeChanged()
self.liveController.screenSizeChanged() self.liveController.screenSizeChanged()

View File

@ -63,7 +63,7 @@ class SlideController(QtGui.QWidget):
self.screens = ScreenList.get_instance() self.screens = ScreenList.get_instance()
self.ratio = float(self.screens.current[u'size'].width()) / \ self.ratio = float(self.screens.current[u'size'].width()) / \
float(self.screens.current[u'size'].height()) float(self.screens.current[u'size'].height())
self.image_manager = self.parent().image_manager self.imageManager = self.parent().imageManager
self.loopList = [ self.loopList = [
u'Play Slides Menu', u'Play Slides Menu',
u'Loop Separator', u'Loop Separator',
@ -425,7 +425,7 @@ class SlideController(QtGui.QWidget):
# rebuild display as screen size changed # rebuild display as screen size changed
if self.display: if self.display:
self.display.close() self.display.close()
self.display = MainDisplay(self, self.image_manager, self.isLive) self.display = MainDisplay(self, self.imageManager, self.isLive)
self.display.alertTab = self.alertTab self.display.alertTab = self.alertTab
self.display.setup() self.display.setup()
if self.isLive: if self.isLive:
@ -632,8 +632,8 @@ class SlideController(QtGui.QWidget):
# If current slide set background to image # If current slide set background to image
if framenumber == slideno: if framenumber == slideno:
self.serviceItem.bg_image_bytes = \ self.serviceItem.bg_image_bytes = \
self.image_manager.get_image_bytes(frame[u'title']) self.imageManager.get_image_bytes(frame[u'title'])
image = self.image_manager.get_image(frame[u'title']) image = self.imageManager.get_image(frame[u'title'])
label.setPixmap(QtGui.QPixmap.fromImage(image)) label.setPixmap(QtGui.QPixmap.fromImage(image))
self.previewListWidget.setCellWidget(framenumber, 0, label) self.previewListWidget.setCellWidget(framenumber, 0, label)
slideHeight = width * self.parent().renderer.screen_ratio slideHeight = width * self.parent().renderer.screen_ratio