From a766542854f6bd696b115ceb59ec1f0a22576880 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 17 Apr 2010 08:53:06 +0100 Subject: [PATCH] Display Hook cleanups --- openlp/core/ui/maindisplay.py | 8 ++++++++ openlp/core/ui/mainwindow.py | 15 +++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index fe16e7d8b..f3a206a76 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -42,6 +42,14 @@ class DisplayManager(QtGui.QWidget): self.videoDisplay = VideoDisplay(self, screens) self.mainDisplay = MainDisplay(self, screens) + def setup(self): + self.videoDisplay.setup() + self.mainDisplay.setup() + + def close(self): + self.videoDisplay.close() + self.mainDisplay.close() + class DisplayWidget(QtGui.QWidget): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6035aaebc..1d97e4220 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -29,8 +29,8 @@ import time from PyQt4 import QtCore, QtGui from openlp.core.ui import AboutForm, SettingsForm, \ - ServiceManager, ThemeManager, MainDisplay, SlideController, \ - PluginForm, MediaDockManager, VideoDisplay, DisplayManager + ServiceManager, ThemeManager, SlideController, \ + PluginForm, MediaDockManager, DisplayManager from openlp.core.lib import RenderManager, PluginConfig, build_icon, \ OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool from openlp.core.utils import check_latest_version, AppLocation @@ -443,8 +443,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.serviceNotSaved = False self.settingsmanager = SettingsManager(screens) self.generalConfig = PluginConfig(u'General') - #self.videoDisplay = VideoDisplay(self, screens) - #self.mainDisplay = MainDisplay(self, screens) self.displayManager = DisplayManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) @@ -576,8 +574,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ self.showMaximized() #screen_number = self.getMonitorNumber() - self.displayManager.mainDisplay.setup() - self.displayManager.videoDisplay.setup() + self.displayManager.setup() if self.displayManager.mainDisplay.isVisible(): self.displayManager.mainDisplay.setFocus() self.activateWindow() @@ -631,8 +628,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): their locations """ self.RenderManager.update_display() - self.displayManager.mainDisplay.setup() - self.displayManager.videoDisplay.setup() + self.displayManager.setup() self.setFocus() self.activateWindow() @@ -672,8 +668,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): log.info(u'cleanup plugins') self.plugin_manager.finalise_plugins() #Close down the displays - self.displayManager.mainDisplay.close() - self.displayManager.videoDisplay.close() + self.displayManager.close() def serviceChanged(self, reset=False, serviceName=None): """