openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06727
[Merge] lp:~googol-hush/openlp/tweaks into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/tweaks into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/52327
Hello
- fix "Show Desktop" being not visible (now it's visible all the time)
- fix a bug: sending an image live when you hide the desktop, the image was visible for a short moment
--
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/52327
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2011-03-03 17:07:36 +0000
+++ openlp/core/ui/maindisplay.py 2011-03-06 15:39:12 +0000
@@ -233,9 +233,6 @@
image = self.imageManager.get_image_bytes(name)
self.resetVideo()
self.displayImage(image)
- # show screen
- if self.isLive:
- self.setVisible(True)
return self.preview()
def displayImage(self, image):
@@ -319,7 +316,7 @@
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 +332,7 @@
# 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 +385,10 @@
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)
+ else:
+ self.setVisible(True)
preview = QtGui.QImage(self.screen[u'size'].width(),
self.screen[u'size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied)
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-03-04 17:21:50 +0000
+++ openlp/core/ui/slidecontroller.py 2011-03-06 15:39:12 +0000
@@ -32,7 +32,7 @@
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
ItemCapabilities, translate
-from openlp.core.lib.ui import UiStrings, shortcut_action
+from openlp.core.lib.ui import icon_action, UiStrings, shortcut_action
from openlp.core.ui import HideMode, MainDisplay
log = logging.getLogger(__name__)
@@ -114,8 +114,7 @@
self.previewListWidget = SlideList(self)
self.previewListWidget.setColumnCount(1)
self.previewListWidget.horizontalHeader().setVisible(False)
- self.previewListWidget.setColumnWidth(
- 0, self.controller.width())
+ self.previewListWidget.setColumnWidth(0, self.controller.width())
self.previewListWidget.isLive = self.isLive
self.previewListWidget.setObjectName(u'PreviewListWidget')
self.previewListWidget.setSelectionBehavior(1)
@@ -146,36 +145,30 @@
u':/slides/slide_next.png',
translate('OpenLP.SlideController', 'Move to next'),
self.onSlideSelectedNext)
+ self.toolbar.addToolbarSeparator(u'Close Separator')
if self.isLive:
- self.toolbar.addToolbarSeparator(u'Close Separator')
self.hideMenu = QtGui.QToolButton(self.toolbar)
self.hideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
self.hideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
self.toolbar.addToolbarWidget(u'Hide Menu', self.hideMenu)
self.hideMenu.setMenu(QtGui.QMenu(
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
- self.blankScreen = QtGui.QAction(QtGui.QIcon(
- u':/slides/slide_blank.png'),
- translate('OpenLP.SlideController',
- 'Blank Screen'), self.hideMenu)
- self.blankScreen.setCheckable(True)
- self.themeScreen = QtGui.QAction(QtGui.QIcon(
- u':/slides/slide_theme.png'),
- translate('OpenLP.SlideController',
- 'Blank to Theme'), self.hideMenu)
- self.themeScreen.setCheckable(True)
+ self.blankScreen = icon_action(self.hideMenu, u'Blank Screen',
+ u':/slides/slide_blank.png', False)
+ self.blankScreen.setText(
+ translate('OpenLP.SlideController', 'Blank Screen'))
+ self.themeScreen = icon_action(self.hideMenu, u'Blank Theme',
+ u':/slides/slide_theme.png', False)
+ self.themeScreen.setText(
+ translate('OpenLP.SlideController', 'Blank to Theme'))
+ self.desktopScreen = icon_action(self.hideMenu, u'Desktop Screen',
+ u':/slides/slide_desktop.png', False)
+ self.desktopScreen.setText(
+ translate('OpenLP.SlideController', 'Show Desktop'))
self.hideMenu.setDefaultAction(self.blankScreen)
self.hideMenu.menu().addAction(self.blankScreen)
self.hideMenu.menu().addAction(self.themeScreen)
- if self.screens.display_count > 1:
- self.desktopScreen = QtGui.QAction(QtGui.QIcon(
- u':/slides/slide_desktop.png'),
- translate('OpenLP.SlideController',
- 'Show Desktop'), self.hideMenu)
- self.hideMenu.menu().addAction(self.desktopScreen)
- self.desktopScreen.setCheckable(True)
- QtCore.QObject.connect(self.desktopScreen,
- QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
+ self.hideMenu.menu().addAction(self.desktopScreen)
self.toolbar.addToolbarSeparator(u'Loop Separator')
self.toolbar.addToolbarButton(
# Does not need translating - control string.
@@ -195,7 +188,6 @@
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
'Delay between slides in seconds'))
else:
- self.toolbar.addToolbarSeparator(u'Close Separator')
self.toolbar.addToolbarButton(
# Does not need translating - control string.
u'Go Live', u':/general/general_live.png',
@@ -226,8 +218,7 @@
if self.isLive:
# Build the Song Toolbar
self.songMenu = QtGui.QToolButton(self.toolbar)
- self.songMenu.setText(translate('OpenLP.SlideController',
- 'Go To'))
+ self.songMenu.setText(translate('OpenLP.SlideController', 'Go To'))
self.songMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
self.toolbar.addToolbarWidget(u'Song Menu', self.songMenu)
self.songMenu.setMenu(QtGui.QMenu(
@@ -303,6 +294,8 @@
QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay)
QtCore.QObject.connect(self.themeScreen,
QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay)
+ QtCore.QObject.connect(self.desktopScreen,
+ QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
QtCore.QObject.connect(self.volumeSlider,
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -469,6 +462,9 @@
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):
@@ -752,8 +748,7 @@
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(
@@ -774,8 +769,7 @@
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(
@@ -796,9 +790,6 @@
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)
@@ -1103,15 +1094,15 @@
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)
- QtCore.QSettings().remove(
- self.parent.generalSettingsSection + u'/screen blank')
+ blank = self.blankScreen
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)
+ 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')
Follow ups