forked from openlp/openlp
Head r1868
This commit is contained in:
commit
25e9a960f3
@ -45,6 +45,7 @@ HTMLSRC = u"""
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
-webkit-user-select: none;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
%s;
|
%s;
|
||||||
|
@ -29,7 +29,7 @@ The :mod:`advancedtab` provides an advanced settings facility.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
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.lib.ui import UiStrings
|
||||||
from openlp.core.utils import get_images_filter
|
from openlp.core.utils import get_images_filter
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ class AdvancedTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
Initialise the settings tab
|
Initialise the settings tab
|
||||||
"""
|
"""
|
||||||
|
self.display_changed = False
|
||||||
advancedTranslated = translate('OpenLP.AdvancedTab', 'Advanced')
|
advancedTranslated = translate('OpenLP.AdvancedTab', 'Advanced')
|
||||||
self.default_image = u':/graphics/openlp-splash-screen.png'
|
self.default_image = u':/graphics/openlp-splash-screen.png'
|
||||||
self.default_color = u'#ffffff'
|
self.default_color = u'#ffffff'
|
||||||
@ -122,6 +123,14 @@ class AdvancedTab(SettingsTab):
|
|||||||
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
||||||
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
||||||
self.rightLayout.addWidget(self.hideMouseGroupBox)
|
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()
|
self.rightLayout.addStretch()
|
||||||
|
|
||||||
QtCore.QObject.connect(self.defaultColorButton,
|
QtCore.QObject.connect(self.defaultColorButton,
|
||||||
@ -130,6 +139,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
||||||
QtCore.QObject.connect(self.defaultRevertButton,
|
QtCore.QObject.connect(self.defaultRevertButton,
|
||||||
QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed)
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed)
|
||||||
|
QtCore.QObject.connect(self.x11BypassCheckBox,
|
||||||
|
QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
@ -167,6 +178,10 @@ class AdvancedTab(SettingsTab):
|
|||||||
'Browse for an image file to display.'))
|
'Browse for an image file to display.'))
|
||||||
self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab',
|
self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab',
|
||||||
'Revert to the default OpenLP logo.'))
|
'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):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -198,6 +213,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.QVariant(True)).toBool())
|
QtCore.QVariant(True)).toBool())
|
||||||
self.hideMouseCheckBox.setChecked(
|
self.hideMouseCheckBox.setChecked(
|
||||||
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
|
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',
|
self.default_color = settings.value(u'default color',
|
||||||
QtCore.QVariant(u'#ffffff')).toString()
|
QtCore.QVariant(u'#ffffff')).toString()
|
||||||
self.defaultFileEdit.setText(settings.value(u'default image',
|
self.defaultFileEdit.setText(settings.value(u'default image',
|
||||||
@ -227,9 +244,14 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
||||||
settings.setValue(u'hide mouse',
|
settings.setValue(u'hide mouse',
|
||||||
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
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 color', self.default_color)
|
||||||
settings.setValue(u'default image', self.defaultFileEdit.text())
|
settings.setValue(u'default image', self.defaultFileEdit.text())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
if self.display_changed:
|
||||||
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
self.display_changed = False
|
||||||
|
|
||||||
def onDefaultColorButtonPressed(self):
|
def onDefaultColorButtonPressed(self):
|
||||||
new_color = QtGui.QColorDialog.getColor(
|
new_color = QtGui.QColorDialog.getColor(
|
||||||
@ -252,3 +274,12 @@ class AdvancedTab(SettingsTab):
|
|||||||
def onDefaultRevertButtonPressed(self):
|
def onDefaultRevertButtonPressed(self):
|
||||||
self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
|
self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
|
||||||
self.defaultFileEdit.setFocus()
|
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
|
||||||
|
@ -134,7 +134,8 @@ class MainDisplay(Display):
|
|||||||
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
|
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
|
||||||
windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \
|
windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \
|
||||||
QtCore.Qt.WindowStaysOnTopHint
|
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
|
windowFlags = windowFlags | QtCore.Qt.X11BypassWindowManagerHint
|
||||||
# FIXME: QtCore.Qt.SplashScreen is workaround to make display screen
|
# FIXME: QtCore.Qt.SplashScreen is workaround to make display screen
|
||||||
# stay always on top on Mac OS X. For details see bug 906926.
|
# stay always on top on Mac OS X. For details see bug 906926.
|
||||||
|
@ -40,6 +40,7 @@ class PresentationTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
self.controllers = controllers
|
self.controllers = controllers
|
||||||
SettingsTab.__init__(self, parent, title, visible_title, icon_path)
|
SettingsTab.__init__(self, parent, title, visible_title, icon_path)
|
||||||
|
self.activated = False
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
"""
|
"""
|
||||||
@ -110,8 +111,12 @@ class PresentationTab(SettingsTab):
|
|||||||
|
|
||||||
def save(self):
|
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
|
changed = False
|
||||||
for key in self.controllers:
|
for key in self.controllers:
|
||||||
controller = self.controllers[key]
|
controller = self.controllers[key]
|
||||||
@ -140,6 +145,7 @@ class PresentationTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
Tab has just been made visible to the user
|
Tab has just been made visible to the user
|
||||||
"""
|
"""
|
||||||
|
self.activated = True
|
||||||
for key in self.controllers:
|
for key in self.controllers:
|
||||||
controller = self.controllers[key]
|
controller = self.controllers[key]
|
||||||
checkbox = self.PresenterCheckboxes[controller.name]
|
checkbox = self.PresenterCheckboxes[controller.name]
|
||||||
|
Loading…
Reference in New Issue
Block a user