diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index dbdc1d104..b90b895b4 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -45,6 +45,7 @@ HTMLSRC = u""" padding: 0; border: 0; overflow: hidden; + -webkit-user-select: none; } body { %s; diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 50e330362..045d38a7e 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -29,7 +29,7 @@ The :mod:`advancedtab` provides an advanced settings facility. """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, build_icon +from openlp.core.lib import SettingsTab, translate, build_icon, Receiver from openlp.core.lib.ui import UiStrings from openlp.core.utils import get_images_filter @@ -42,6 +42,7 @@ class AdvancedTab(SettingsTab): """ Initialise the settings tab """ + self.display_changed = False advancedTranslated = translate('OpenLP.AdvancedTab', 'Advanced') self.default_image = u':/graphics/openlp-splash-screen.png' self.default_color = u'#ffffff' @@ -122,6 +123,14 @@ class AdvancedTab(SettingsTab): self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox') self.hideMouseLayout.addWidget(self.hideMouseCheckBox) self.rightLayout.addWidget(self.hideMouseGroupBox) + self.x11GroupBox = QtGui.QGroupBox(self.leftColumn) + self.x11GroupBox.setObjectName(u'x11GroupBox') + self.x11Layout = QtGui.QVBoxLayout(self.x11GroupBox) + self.x11Layout.setObjectName(u'x11Layout') + self.x11BypassCheckBox = QtGui.QCheckBox(self.x11GroupBox) + self.x11BypassCheckBox.setObjectName(u'x11BypassCheckBox') + self.x11Layout.addWidget(self.x11BypassCheckBox) + self.rightLayout.addWidget(self.x11GroupBox) self.rightLayout.addStretch() QtCore.QObject.connect(self.defaultColorButton, @@ -130,6 +139,8 @@ class AdvancedTab(SettingsTab): QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed) QtCore.QObject.connect(self.defaultRevertButton, QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed) + QtCore.QObject.connect(self.x11BypassCheckBox, + QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled) def retranslateUi(self): """ @@ -167,6 +178,10 @@ class AdvancedTab(SettingsTab): 'Browse for an image file to display.')) self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.')) + self.x11GroupBox.setTitle(translate('OpenLP.AdvancedTab', + 'X11')) + self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab', + 'Bypass X11 Window Manager')) def load(self): """ @@ -198,6 +213,8 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(True)).toBool()) self.hideMouseCheckBox.setChecked( settings.value(u'hide mouse', QtCore.QVariant(False)).toBool()) + self.x11BypassCheckBox.setChecked( + settings.value(u'x11 bypass wm', QtCore.QVariant(True)).toBool()) self.default_color = settings.value(u'default color', QtCore.QVariant(u'#ffffff')).toString() self.defaultFileEdit.setText(settings.value(u'default image', @@ -227,9 +244,14 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) + settings.setValue(u'x11 bypass wm', + QtCore.QVariant(self.x11BypassCheckBox.isChecked())) settings.setValue(u'default color', self.default_color) settings.setValue(u'default image', self.defaultFileEdit.text()) settings.endGroup() + if self.display_changed: + Receiver.send_message(u'config_screen_changed') + self.display_changed = False def onDefaultColorButtonPressed(self): new_color = QtGui.QColorDialog.getColor( @@ -252,3 +274,12 @@ class AdvancedTab(SettingsTab): def onDefaultRevertButtonPressed(self): self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png') self.defaultFileEdit.setFocus() + + def onX11BypassCheckBoxToggled(self, checked): + """ + Toggle X11 bypass flag on maindisplay depending on check box state. + + ``checked`` + The state of the check box (boolean). + """ + self.display_changed = True diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 9e4bc9083..8a43ccc36 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -134,7 +134,8 @@ class MainDisplay(Display): self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;') windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \ QtCore.Qt.WindowStaysOnTopHint - if os.environ.get(u'XDG_CURRENT_DESKTOP') == u'Unity': + if QtCore.QSettings().value(u'advanced/x11 bypass wm', + QtCore.QVariant(True)).toBool(): windowFlags = windowFlags | QtCore.Qt.X11BypassWindowManagerHint # FIXME: QtCore.Qt.SplashScreen is workaround to make display screen # stay always on top on Mac OS X. For details see bug 906926. diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index aaa1fd21a..93174b3da 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -40,6 +40,7 @@ class PresentationTab(SettingsTab): """ self.controllers = controllers SettingsTab.__init__(self, parent, title, visible_title, icon_path) + self.activated = False def setupUi(self): """ @@ -110,8 +111,12 @@ class PresentationTab(SettingsTab): def save(self): """ - Save the settings. + Save the settings. If the tab hasn't been made visible to the user + then there is nothing to do, so exit. This removes the need to + start presentation applications unnecessarily. """ + if not self.activated: + return changed = False for key in self.controllers: controller = self.controllers[key] @@ -140,6 +145,7 @@ class PresentationTab(SettingsTab): """ Tab has just been made visible to the user """ + self.activated = True for key in self.controllers: controller = self.controllers[key] checkbox = self.PresenterCheckboxes[controller.name]