openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00797
[Merge] lp:~raoul-snyman/openlp/fixes into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
--
https://code.launchpad.net/~raoul-snyman/openlp/fixes/+merge/14461
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-11-03 18:14:25 +0000
+++ openlp/core/ui/maindisplay.py 2009-11-05 06:10:25 +0000
@@ -30,7 +30,7 @@
from openlp.core.lib import Receiver, str_to_bool
-class DisplayLabel(QtGui.QWidget):
+class DisplayWidget(QtGui.QWidget):
"""
Customised version of QTableWidget which can respond to keyboard
events.
@@ -40,7 +40,7 @@
log.info(u'MainDisplay loaded')
def __init__(self, parent=None, name=None):
- QQtGui.QWidget.__init__(self, parent)
+ QtGui.QWidget.__init__(self, parent)
self.parent = parent
def keyPressEvent(self, event):
@@ -65,7 +65,7 @@
else:
event.ignore()
-class MainDisplay(DisplayLabel):
+class MainDisplay(DisplayWidget):
"""
This is the form that is used to display things on the projector.
"""
@@ -84,7 +84,7 @@
The list of screens.
"""
log.debug(u'Initilisation started')
- QtGui.QWidget.__init__(self, None)
+ DisplayWidget.__init__(self, None)
self.parent = parent
self.setWindowTitle(u'OpenLP Display')
self.screens = screens
@@ -136,7 +136,8 @@
Sets up the screen on a particular screen.
@param (integer) screen This is the screen number.
"""
- log.debug(u'Setup %s for %s ' %(self.screens, screenNumber) )
+ log.debug(u'Setup %s for %s ' %(self.screens, screenNumber))
+ self.setVisible(False)
screen = self.screens[screenNumber]
if screen[u'number'] != screenNumber:
# We will most probably never actually hit this bit, but just in
@@ -147,26 +148,19 @@
screen = scrn
break
self.setGeometry(screen[u'size'])
- if not screen[u'primary']:
- self.showFullScreen()
- self.primary = False
- else:
- self.setVisible(False)
- self.primary = True
#Build a custom splash screen
- if str_to_bool(self.parent.generalConfig.get_config(u'show splash', u'True')):
- self.InitialFrame = QtGui.QImage(
- screen[u'size'].width(), screen[u'size'].height(),
- QtGui.QImage.Format_ARGB32_Premultiplied)
- splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
- painter_image = QtGui.QPainter()
- painter_image.begin(self.InitialFrame)
- painter_image.fillRect(self.InitialFrame.rect(), QtCore.Qt.white)
- painter_image.drawImage(
- (screen[u'size'].width() - splash_image.width()) / 2,
- (screen[u'size'].height() - splash_image.height()) / 2,
- splash_image)
- self.frameView(self.InitialFrame)
+ self.InitialFrame = QtGui.QImage(
+ screen[u'size'].width(), screen[u'size'].height(),
+ QtGui.QImage.Format_ARGB32_Premultiplied)
+ splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
+ painter_image = QtGui.QPainter()
+ painter_image.begin(self.InitialFrame)
+ painter_image.fillRect(self.InitialFrame.rect(), QtCore.Qt.white)
+ painter_image.drawImage(
+ (screen[u'size'].width() - splash_image.width()) / 2,
+ (screen[u'size'].height() - splash_image.height()) / 2,
+ splash_image)
+ self.frameView(self.InitialFrame)
#Build a Black screen
painter = QtGui.QPainter()
self.blankFrame = QtGui.QImage(
@@ -174,6 +168,13 @@
QtGui.QImage.Format_ARGB32_Premultiplied)
painter.begin(self.blankFrame)
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.black)
+ # To display or not to display?
+ if not screen[u'primary']:
+ self.showFullScreen()
+ self.primary = False
+ else:
+ self.setVisible(False)
+ self.primary = True
def resetDisplay(self):
if self.primary:
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-11-03 15:13:52 +0000
+++ openlp/core/ui/mainwindow.py 2009-11-05 06:10:25 +0000
@@ -544,7 +544,6 @@
monitor number does not exist.
"""
screen_number = int(self.generalConfig.get_config(u'Monitor', 0))
-
monitor_exists = False
for screen in self.screenList:
if screen[u'number'] == screen_number:
@@ -560,7 +559,9 @@
self.showMaximized()
screen_number = self.getMonitorNumber()
self.mainDisplay.setup(screen_number)
- self.setFocus()
+ if self.mainDisplay.isVisible():
+ self.mainDisplay.setFocus()
+ self.activateWindow()
if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)):
self.ServiceManagerContents.onLoadService(True)
if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \
@@ -601,6 +602,7 @@
if updated_display != self.RenderManager.current_display:
self.RenderManager.update_display(updated_display)
self.mainDisplay.setup(updated_display)
+ self.activateWindow()
def closeEvent(self, event):
"""
Follow ups