Head r1223

This commit is contained in:
Jon Tibble 2011-01-18 00:04:12 +00:00
commit cc0bfabaa2
4 changed files with 45 additions and 1 deletions

View File

@ -72,6 +72,14 @@ class AdvancedTab(SettingsTab):
u'enableAutoCloseCheckBox') u'enableAutoCloseCheckBox')
self.uiLayout.addRow(self.enableAutoCloseCheckBox) self.uiLayout.addRow(self.enableAutoCloseCheckBox)
self.leftLayout.addWidget(self.uiGroupBox) self.leftLayout.addWidget(self.uiGroupBox)
self.hideMouseGroupBox = QtGui.QGroupBox(self.leftColumn)
self.hideMouseGroupBox.setObjectName(u'hideMouseGroupBox')
self.hideMouseLayout = QtGui.QVBoxLayout(self.hideMouseGroupBox)
self.hideMouseLayout.setObjectName(u'hideMouseLayout')
self.hideMouseCheckBox = QtGui.QCheckBox(self.hideMouseGroupBox)
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
self.leftLayout.addWidget(self.hideMouseGroupBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) # self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox) # self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
@ -117,6 +125,10 @@ class AdvancedTab(SettingsTab):
'Expand new service items on creation')) 'Expand new service items on creation'))
self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab', self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab',
'Enable application exit confirmation')) 'Enable application exit confirmation'))
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
'Mouse Cursor'))
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
'Hide the mouse cursor when moved over the display window'))
# self.sharedDirGroupBox.setTitle( # self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store')) # translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText( # self.sharedCheckBox.setText(
@ -150,6 +162,8 @@ class AdvancedTab(SettingsTab):
self.enableAutoCloseCheckBox.setChecked( self.enableAutoCloseCheckBox.setChecked(
settings.value(u'enable exit confirmation', settings.value(u'enable exit confirmation',
QtCore.QVariant(True)).toBool()) QtCore.QVariant(True)).toBool())
self.hideMouseCheckBox.setChecked(
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
settings.endGroup() settings.endGroup()
def save(self): def save(self):
@ -168,6 +182,8 @@ class AdvancedTab(SettingsTab):
QtCore.QVariant(self.expandServiceItemCheckBox.isChecked())) QtCore.QVariant(self.expandServiceItemCheckBox.isChecked()))
settings.setValue(u'enable exit confirmation', settings.setValue(u'enable exit confirmation',
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
settings.setValue(u'hide mouse',
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
settings.endGroup() settings.endGroup()
# def onSharedCheckBoxChanged(self, checked): # def onSharedCheckBoxChanged(self, checked):

View File

@ -94,6 +94,7 @@ class DisplayWidget(QtGui.QGraphicsView):
else: else:
event.ignore() event.ignore()
class MainDisplay(DisplayWidget): class MainDisplay(DisplayWidget):
""" """
This is the display screen. This is the display screen.
@ -270,6 +271,8 @@ class MainDisplay(DisplayWidget):
else: else:
js = u'show_image("");' js = u'show_image("");'
self.frame.evaluateJavaScript(js) self.frame.evaluateJavaScript(js)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def resetImage(self): def resetImage(self):
""" """
@ -278,6 +281,8 @@ class MainDisplay(DisplayWidget):
""" """
log.debug(u'resetImage') log.debug(u'resetImage')
self.displayImage(self.serviceItem.bg_image_bytes) self.displayImage(self.serviceItem.bg_image_bytes)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def resetVideo(self): def resetVideo(self):
""" """
@ -292,6 +297,8 @@ class MainDisplay(DisplayWidget):
self.phononActive = False self.phononActive = False
else: else:
self.frame.evaluateJavaScript(u'show_video("close");') self.frame.evaluateJavaScript(u'show_video("close");')
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def videoPlay(self): def videoPlay(self):
""" """
@ -359,6 +366,8 @@ class MainDisplay(DisplayWidget):
self.webView.setVisible(False) self.webView.setVisible(False)
self.videoWidget.setVisible(True) self.videoWidget.setVisible(True)
self.audio.setVolume(vol) self.audio.setVolume(vol)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
return self.preview() return self.preview()
def isLoaded(self): def isLoaded(self):
@ -426,6 +435,14 @@ class MainDisplay(DisplayWidget):
# if was hidden keep it hidden # if was hidden keep it hidden
if self.hideMode and self.isLive: if self.hideMode and self.isLive:
self.hideDisplay(self.hideMode) self.hideDisplay(self.hideMode)
# Hide mouse cursor when moved over display if enabled in settings
settings = QtCore.QSettings()
if settings.value(u'advanced/hide mouse', QtCore.QVariant(False)).toBool():
self.setCursor(QtCore.Qt.BlankCursor)
self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
else:
self.setCursor(QtCore.Qt.ArrowCursor)
self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
def footer(self, text): def footer(self, text):
""" """
@ -475,6 +492,7 @@ class MainDisplay(DisplayWidget):
# Trigger actions when display is active again # Trigger actions when display is active again
Receiver.send_message(u'maindisplay_active') Receiver.send_message(u'maindisplay_active')
class AudioPlayer(QtCore.QObject): class AudioPlayer(QtCore.QObject):
""" """
This Class will play audio only allowing components to work with a This Class will play audio only allowing components to work with a

View File

@ -187,12 +187,15 @@ class ImageMediaItem(MediaManagerItem):
return False return False
def onResetClick(self): def onResetClick(self):
"""
Called to reset the Live backgound with the image selected,
"""
self.resetAction.setVisible(False) self.resetAction.setVisible(False)
self.parent.liveController.display.resetImage() self.parent.liveController.display.resetImage()
def onReplaceClick(self): def onReplaceClick(self):
""" """
Called to replace Live backgound with the video selected Called to replace Live backgound with the image selected.
""" """
if check_item_selected(self.listView, if check_item_selected(self.listView,
translate('ImagePlugin.MediaItem', translate('ImagePlugin.MediaItem',

View File

@ -40,6 +40,7 @@ class MediaListView(BaseListWithDnD):
self.PluginName = u'Media' self.PluginName = u'Media'
BaseListWithDnD.__init__(self, parent) BaseListWithDnD.__init__(self, parent)
class MediaMediaItem(MediaManagerItem): class MediaMediaItem(MediaManagerItem):
""" """
This is the custom media manager item for Media Slides. This is the custom media manager item for Media Slides.
@ -92,10 +93,16 @@ class MediaMediaItem(MediaManagerItem):
self.resetAction.setVisible(False) self.resetAction.setVisible(False)
def onResetClick(self): def onResetClick(self):
"""
Called to reset the Live backgound with the media selected,
"""
self.resetAction.setVisible(False) self.resetAction.setVisible(False)
self.parent.liveController.display.resetVideo() self.parent.liveController.display.resetVideo()
def onReplaceClick(self): def onReplaceClick(self):
"""
Called to replace Live backgound with the media selected.
"""
if check_item_selected(self.listView, if check_item_selected(self.listView,
translate('MediaPlugin.MediaItem', translate('MediaPlugin.MediaItem',
'You must select a media file to replace the background with.')): 'You must select a media file to replace the background with.')):