forked from openlp/openlp
Add a setting to hide the mouse cursor on the display.
This commit is contained in:
parent
149f0bd31e
commit
4414d7e421
@ -213,6 +213,14 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
|
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
|
||||||
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
|
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
|
||||||
self.rightLayout.addWidget(self.displayGroupBox)
|
self.rightLayout.addWidget(self.displayGroupBox)
|
||||||
|
self.hideMouseGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||||
|
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.rightLayout.addWidget(self.hideMouseGroupBox)
|
||||||
self.rightLayout.addStretch()
|
self.rightLayout.addStretch()
|
||||||
# Signals and slots
|
# Signals and slots
|
||||||
QtCore.QObject.connect(self.overrideCheckBox,
|
QtCore.QObject.connect(self.overrideCheckBox,
|
||||||
@ -287,6 +295,10 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customHeightLabel.setText(
|
self.customHeightLabel.setText(
|
||||||
translate('OpenLP.GeneralTab', 'Height'))
|
translate('OpenLP.GeneralTab', 'Height'))
|
||||||
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
|
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
|
||||||
|
self.hideMouseGroupBox.setTitle(translate('OpenLP.GeneralTab',
|
||||||
|
'Mouse Cursor'))
|
||||||
|
self.hideMouseCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||||
|
'Hide the Mouse Cursor'))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -341,6 +353,8 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customWidthValueEdit.setText(
|
self.customWidthValueEdit.setText(
|
||||||
settings.value(u'width', QtCore.QVariant(
|
settings.value(u'width', QtCore.QVariant(
|
||||||
self.screens.current[u'size'].width())).toString())
|
self.screens.current[u'size'].width())).toString())
|
||||||
|
self.hideMouseCheckBox.setChecked(settings.value(u'hide mouse',
|
||||||
|
QtCore.QVariant(False)).toBool())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
@ -385,6 +399,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.customWidthValueEdit.text()))
|
QtCore.QVariant(self.customWidthValueEdit.text()))
|
||||||
settings.setValue(u'override position',
|
settings.setValue(u'override position',
|
||||||
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'hide mouse',
|
||||||
|
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.screens.display = self.displayOnMonitorCheck.isChecked()
|
self.screens.display = self.displayOnMonitorCheck.isChecked()
|
||||||
# Monitor Number has changed.
|
# Monitor Number has changed.
|
||||||
|
@ -117,6 +117,8 @@ class MainDisplay(DisplayWidget):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
||||||
|
|
||||||
|
self.generalSettingsSection = u'general'
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
Setup the interface translation strings.
|
Setup the interface translation strings.
|
||||||
@ -205,6 +207,8 @@ class MainDisplay(DisplayWidget):
|
|||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
self.frame.evaluateJavaScript(u'show_text("%s")' % \
|
self.frame.evaluateJavaScript(u'show_text("%s")' % \
|
||||||
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||||
|
|
||||||
|
self.hideMouseCursor()
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def alert(self, text):
|
def alert(self, text):
|
||||||
@ -270,6 +274,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
else:
|
else:
|
||||||
js = u'show_image("");'
|
js = u'show_image("");'
|
||||||
self.frame.evaluateJavaScript(js)
|
self.frame.evaluateJavaScript(js)
|
||||||
|
self.hideMouseCursor()
|
||||||
|
|
||||||
def resetImage(self):
|
def resetImage(self):
|
||||||
"""
|
"""
|
||||||
@ -359,6 +364,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)
|
||||||
|
|
||||||
|
self.hideMouseCursor()
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def isLoaded(self):
|
def isLoaded(self):
|
||||||
@ -474,6 +481,19 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
# 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')
|
||||||
|
|
||||||
|
def hideMouseCursor(self):
|
||||||
|
"""
|
||||||
|
Hide the mouse cursor if enabled in settings
|
||||||
|
"""
|
||||||
|
settings = QtCore.QSettings()
|
||||||
|
if settings.value(u'%s/hide mouse' % self.generalSettingsSection,
|
||||||
|
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"')
|
||||||
|
|
||||||
class AudioPlayer(QtCore.QObject):
|
class AudioPlayer(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user