From 632c1f8ade6a577defc8f7a2e8a950dcf8f5cdb0 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 5 Mar 2011 19:38:33 +0100 Subject: [PATCH] display 'Show Desktop' even with one screen --- openlp/core/ui/maindisplay.py | 11 ++++++----- openlp/core/ui/slidecontroller.py | 33 +++++++++++++------------------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 5fd361268..47321eedf 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -319,7 +319,7 @@ class MainDisplay(DisplayWidget): Changes the volume of a running video """ log.debug(u'videoVolume %d' % volume) - vol = float(volume)/float(10) + vol = float(volume) / float(10) if self.phononActive: self.audio.setVolume(vol) else: @@ -335,7 +335,7 @@ class MainDisplay(DisplayWidget): # We are running a background theme self.override[u'theme'] = u'' self.override[u'video'] = True - vol = float(volume)/float(10) + vol = float(volume) / float(10) if isBackground or not self.usePhonon: js = u'show_video("init", "%s", %s, true); show_video("play");' % \ (videoPath.replace(u'\\', u'\\\\'), str(vol)) @@ -388,9 +388,10 @@ class MainDisplay(DisplayWidget): Receiver.send_message(u'openlp_process_events') # if was hidden keep it hidden if self.isLive: - self.setVisible(True) - if self.hideMode: - self.hideDisplay(self.hideMode) + if self.hideMode: + self.hideDisplay(self.hideMode) + else: + self.setVisible(True) preview = QtGui.QImage(self.screen[u'size'].width(), self.screen[u'size'].height(), QtGui.QImage.Format_ARGB32_Premultiplied) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 89d7ac162..0caa83e72 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -165,7 +165,6 @@ class SlideController(QtGui.QWidget): u':/slides/slide_desktop.png', False) self.desktopScreen.setText( translate('OpenLP.SlideController', 'Show Desktop')) - self.desktopScreen.setVisible(self.screens.display_count > 1) self.hideMenu.setDefaultAction(self.blankScreen) self.hideMenu.menu().addAction(self.blankScreen) 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 screen previews. """ - if self.isLive: - self.desktopScreen.setVisible(self.screens.display_count > 1) # rebuild display as screen size changed self.display = MainDisplay(self, self.screens, self.isLive) self.display.imageManager = self.parent.renderManager.image_manager @@ -465,6 +462,9 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() def receiveSpinDelay(self, value): + """ + Adjusts the value of the ``delaySpinBox`` to the given one. + """ self.delaySpinBox.setValue(int(value)) def enableToolBar(self, item): @@ -748,8 +748,7 @@ class SlideController(QtGui.QWidget): self.hideMenu.setDefaultAction(self.blankScreen) self.blankScreen.setChecked(checked) self.themeScreen.setChecked(False) - if self.screens.display_count > 1: - self.desktopScreen.setChecked(False) + self.desktopScreen.setChecked(False) if checked: Receiver.send_message(u'maindisplay_hide', HideMode.Blank) QtCore.QSettings().setValue( @@ -770,8 +769,7 @@ class SlideController(QtGui.QWidget): self.hideMenu.setDefaultAction(self.themeScreen) self.blankScreen.setChecked(False) self.themeScreen.setChecked(checked) - if self.screens.display_count > 1: - self.desktopScreen.setChecked(False) + self.desktopScreen.setChecked(False) if checked: Receiver.send_message(u'maindisplay_hide', HideMode.Theme) QtCore.QSettings().setValue( @@ -792,9 +790,6 @@ class SlideController(QtGui.QWidget): self.hideMenu.setDefaultAction(self.desktopScreen) self.blankScreen.setChecked(False) self.themeScreen.setChecked(False) - # On valid if more than 1 display - if self.screens.display_count <= 1: - return self.desktopScreen.setChecked(checked) if checked: 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 screen hide attributes """ + blank = None if self.blankScreen.isChecked: - self.blankScreen.setChecked(False) - self.hideMenu.setDefaultAction(self.blankScreen) + blank = 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( 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)