forked from openlp/openlp
add a setting to the advanced tab to allow hiding the mouse cursor
This commit is contained in:
parent
149f0bd31e
commit
e664205282
@ -72,6 +72,14 @@ class AdvancedTab(SettingsTab):
|
||||
u'enableAutoCloseCheckBox')
|
||||
self.uiLayout.addRow(self.enableAutoCloseCheckBox)
|
||||
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.setObjectName(u'sharedDirGroupBox')
|
||||
# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
|
||||
@ -117,6 +125,10 @@ class AdvancedTab(SettingsTab):
|
||||
'Expand new service items on creation'))
|
||||
self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab',
|
||||
'Enable application exit confirmation'))
|
||||
self.hideMouseGroupBox.setTitle(translate('OpenLP.GeneralTab',
|
||||
'Mouse Cursor'))
|
||||
self.hideMouseCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||
'Hide the Mouse Cursor'))
|
||||
# self.sharedDirGroupBox.setTitle(
|
||||
# translate('AdvancedTab', 'Central Data Store'))
|
||||
# self.sharedCheckBox.setText(
|
||||
@ -150,6 +162,9 @@ class AdvancedTab(SettingsTab):
|
||||
self.enableAutoCloseCheckBox.setChecked(
|
||||
settings.value(u'enable exit confirmation',
|
||||
QtCore.QVariant(True)).toBool())
|
||||
self.hideMouseCheckBox.setChecked(
|
||||
settings.value(u'hide mouse',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
settings.endGroup()
|
||||
|
||||
def save(self):
|
||||
@ -168,6 +183,8 @@ class AdvancedTab(SettingsTab):
|
||||
QtCore.QVariant(self.expandServiceItemCheckBox.isChecked()))
|
||||
settings.setValue(u'enable exit confirmation',
|
||||
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
||||
settings.setValue(u'hide mouse',
|
||||
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
||||
settings.endGroup()
|
||||
|
||||
# def onSharedCheckBoxChanged(self, checked):
|
||||
|
@ -117,6 +117,7 @@ class MainDisplay(DisplayWidget):
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
||||
|
||||
self.advancedSettingsSection = u'advanced'
|
||||
def retranslateUi(self):
|
||||
"""
|
||||
Setup the interface translation strings.
|
||||
@ -205,6 +206,7 @@ class MainDisplay(DisplayWidget):
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
self.frame.evaluateJavaScript(u'show_text("%s")' % \
|
||||
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||
self.hideMouseCursor()
|
||||
return self.preview()
|
||||
|
||||
def alert(self, text):
|
||||
@ -270,6 +272,7 @@ class MainDisplay(DisplayWidget):
|
||||
else:
|
||||
js = u'show_image("");'
|
||||
self.frame.evaluateJavaScript(js)
|
||||
self.hideMouseCursor()
|
||||
|
||||
def resetImage(self):
|
||||
"""
|
||||
@ -359,6 +362,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.webView.setVisible(False)
|
||||
self.videoWidget.setVisible(True)
|
||||
self.audio.setVolume(vol)
|
||||
self.hideMouseCursor()
|
||||
return self.preview()
|
||||
|
||||
def isLoaded(self):
|
||||
@ -474,6 +478,19 @@ class MainDisplay(DisplayWidget):
|
||||
self.hideMode = None
|
||||
# Trigger actions when display is active again
|
||||
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.advancedSettingsSection,
|
||||
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user