openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #08148
[Merge] lp:~floft/openlp/dontblank into lp:openlp
Garrett has proposed merging lp:~floft/openlp/dontblank into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~floft/openlp/dontblank/+merge/58157
When the "Display if a single screen" setting is unchecked and there is only one monitor, don't allow the user to blank/unblank the screen.
--
https://code.launchpad.net/~floft/openlp/dontblank/+merge/58157
Your team OpenLP Core is requested to review the proposed merge of lp:~floft/openlp/dontblank into lp:openlp.
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-04-15 21:43:59 +0000
+++ openlp/core/ui/slidecontroller.py 2011-04-18 16:25:15 +0000
@@ -817,39 +817,47 @@
"""
Blank/Hide the display screen within a plugin if required.
"""
- hide_mode = self.hideMode()
- log.debug(u'blankPlugin %s ', hide_mode)
- if self.serviceItem is not None:
- if hide_mode:
- if not self.serviceItem.is_command():
- Receiver.send_message(u'maindisplay_hide', hide_mode)
- Receiver.send_message(u'%s_blank'
- % self.serviceItem.name.lower(),
- [self.serviceItem, self.isLive, hide_mode])
- else:
- if not self.serviceItem.is_command():
- Receiver.send_message(u'maindisplay_show')
- Receiver.send_message(u'%s_unblank'
- % self.serviceItem.name.lower(),
- [self.serviceItem, self.isLive])
+ # Don't blank if one screen and display single monitor setting is false
+ if self.screens.monitor_number != 0 or QtCore.QSettings().value(
+ self.parent.generalSettingsSection + u'/display on monitor',
+ QtCore.QVariant(True)).toBool():
+ hide_mode = self.hideMode()
+ log.debug(u'blankPlugin %s ', hide_mode)
+ if self.serviceItem is not None:
+ if hide_mode:
+ if not self.serviceItem.is_command():
+ Receiver.send_message(u'maindisplay_hide', hide_mode)
+ Receiver.send_message(u'%s_blank'
+ % self.serviceItem.name.lower(),
+ [self.serviceItem, self.isLive, hide_mode])
+ else:
+ if not self.serviceItem.is_command():
+ Receiver.send_message(u'maindisplay_show')
+ Receiver.send_message(u'%s_unblank'
+ % self.serviceItem.name.lower(),
+ [self.serviceItem, self.isLive])
def hidePlugin(self, hide):
"""
Tell the plugin to hide the display screen.
"""
- log.debug(u'hidePlugin %s ', hide)
- if self.serviceItem is not None:
- if hide:
- Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
- Receiver.send_message(u'%s_hide'
- % self.serviceItem.name.lower(),
- [self.serviceItem, self.isLive])
- else:
- if not self.serviceItem.is_command():
- Receiver.send_message(u'maindisplay_show')
- Receiver.send_message(u'%s_unblank'
- % self.serviceItem.name.lower(),
- [self.serviceItem, self.isLive])
+ # Don't blank if one screen and display single monitor setting is false
+ if self.screens.monitor_number != 0 or QtCore.QSettings().value(
+ self.parent.generalSettingsSection + u'/display on monitor',
+ QtCore.QVariant(True)).toBool():
+ log.debug(u'hidePlugin %s ', hide)
+ if self.serviceItem is not None:
+ if hide:
+ Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
+ Receiver.send_message(u'%s_hide'
+ % self.serviceItem.name.lower(),
+ [self.serviceItem, self.isLive])
+ else:
+ if not self.serviceItem.is_command():
+ Receiver.send_message(u'maindisplay_show')
+ Receiver.send_message(u'%s_unblank'
+ % self.serviceItem.name.lower(),
+ [self.serviceItem, self.isLive])
def onSlideSelected(self, start=False):
"""
@@ -1150,4 +1158,4 @@
elif self.desktopScreen.isChecked():
return HideMode.Screen
else:
- return None
\ No newline at end of file
+ return None
Follow ups