openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06681
[Merge] lp:~googol-hush/openlp/tweaks into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/tweaks into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/52210
Hello
Set the "Show Desktop" menu item visible/invisible, when a screen is removed/added.
--
https://code.launchpad.net/~googol-hush/openlp/tweaks/+merge/52210
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/tweaks into lp:openlp.
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-02-24 05:47:38 +0000
+++ openlp/core/ui/slidecontroller.py 2011-03-04 15:52:55 +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,31 @@
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.desktopScreen.setVisible(self.screens.display_count > 1)
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 +189,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 +219,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 +295,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(),
@@ -411,6 +405,8 @@
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
Follow ups