display 'Show Desktop' even with one screen

This commit is contained in:
Andreas Preikschat 2011-03-05 19:38:33 +01:00
parent 1ac13fa3ba
commit 632c1f8ade
2 changed files with 20 additions and 24 deletions

View File

@ -388,9 +388,10 @@ class MainDisplay(DisplayWidget):
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
# if was hidden keep it hidden # if was hidden keep it hidden
if self.isLive: if self.isLive:
self.setVisible(True)
if self.hideMode: if self.hideMode:
self.hideDisplay(self.hideMode) self.hideDisplay(self.hideMode)
else:
self.setVisible(True)
preview = QtGui.QImage(self.screen[u'size'].width(), preview = QtGui.QImage(self.screen[u'size'].width(),
self.screen[u'size'].height(), self.screen[u'size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied) QtGui.QImage.Format_ARGB32_Premultiplied)

View File

@ -165,7 +165,6 @@ class SlideController(QtGui.QWidget):
u':/slides/slide_desktop.png', False) u':/slides/slide_desktop.png', False)
self.desktopScreen.setText( self.desktopScreen.setText(
translate('OpenLP.SlideController', 'Show Desktop')) translate('OpenLP.SlideController', 'Show Desktop'))
self.desktopScreen.setVisible(self.screens.display_count > 1)
self.hideMenu.setDefaultAction(self.blankScreen) self.hideMenu.setDefaultAction(self.blankScreen)
self.hideMenu.menu().addAction(self.blankScreen) self.hideMenu.menu().addAction(self.blankScreen)
self.hideMenu.menu().addAction(self.themeScreen) self.hideMenu.menu().addAction(self.themeScreen)
@ -405,8 +404,6 @@ class SlideController(QtGui.QWidget):
Settings dialog has changed the screen size of adjust output and Settings dialog has changed the screen size of adjust output and
screen previews. screen previews.
""" """
if self.isLive:
self.desktopScreen.setVisible(self.screens.display_count > 1)
# rebuild display as screen size changed # rebuild display as screen size changed
self.display = MainDisplay(self, self.screens, self.isLive) self.display = MainDisplay(self, self.screens, self.isLive)
self.display.imageManager = self.parent.renderManager.image_manager self.display.imageManager = self.parent.renderManager.image_manager
@ -465,6 +462,9 @@ class SlideController(QtGui.QWidget):
self.onSlideSelected() self.onSlideSelected()
def receiveSpinDelay(self, value): def receiveSpinDelay(self, value):
"""
Adjusts the value of the ``delaySpinBox`` to the given one.
"""
self.delaySpinBox.setValue(int(value)) self.delaySpinBox.setValue(int(value))
def enableToolBar(self, item): def enableToolBar(self, item):
@ -748,7 +748,6 @@ class SlideController(QtGui.QWidget):
self.hideMenu.setDefaultAction(self.blankScreen) self.hideMenu.setDefaultAction(self.blankScreen)
self.blankScreen.setChecked(checked) self.blankScreen.setChecked(checked)
self.themeScreen.setChecked(False) self.themeScreen.setChecked(False)
if self.screens.display_count > 1:
self.desktopScreen.setChecked(False) self.desktopScreen.setChecked(False)
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Blank) Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
@ -770,7 +769,6 @@ class SlideController(QtGui.QWidget):
self.hideMenu.setDefaultAction(self.themeScreen) self.hideMenu.setDefaultAction(self.themeScreen)
self.blankScreen.setChecked(False) self.blankScreen.setChecked(False)
self.themeScreen.setChecked(checked) self.themeScreen.setChecked(checked)
if self.screens.display_count > 1:
self.desktopScreen.setChecked(False) self.desktopScreen.setChecked(False)
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Theme) Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
@ -792,9 +790,6 @@ class SlideController(QtGui.QWidget):
self.hideMenu.setDefaultAction(self.desktopScreen) self.hideMenu.setDefaultAction(self.desktopScreen)
self.blankScreen.setChecked(False) self.blankScreen.setChecked(False)
self.themeScreen.setChecked(False) self.themeScreen.setChecked(False)
# On valid if more than 1 display
if self.screens.display_count <= 1:
return
self.desktopScreen.setChecked(checked) self.desktopScreen.setChecked(checked)
if checked: if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen) Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
@ -1099,15 +1094,15 @@ class SlideController(QtGui.QWidget):
Used by command items which provide their own displays to reset the Used by command items which provide their own displays to reset the
screen hide attributes screen hide attributes
""" """
blank = None
if self.blankScreen.isChecked: if self.blankScreen.isChecked:
self.blankScreen.setChecked(False) blank = self.blankScreen
self.hideMenu.setDefaultAction(self.blankScreen) if self.themeScreen.isChecked:
blank = self.themeScreen
if self.desktopScreen.isChecked:
blank = self.desktopScreen
if blank:
blank.setChecked(False)
self.hideMenu.setDefaultAction(blank)
QtCore.QSettings().remove( QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank') self.parent.generalSettingsSection + u'/screen blank')
if self.themeScreen.isChecked:
self.themeScreen.setChecked(False)
self.hideMenu.setDefaultAction(self.themeScreen)
if self.screens.display_count > 1:
if self.desktopScreen.isChecked:
self.desktopScreen.setChecked(False)
self.hideMenu.setDefaultAction(self.desktopScreen)