openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #13891
[Merge] lp:~m2j/openlp/smallfix into lp:openlp
Meinert Jordan has proposed merging lp:~m2j/openlp/smallfix into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~m2j/openlp/smallfix/+merge/90560
I merged the custom screen position settings with the monitor selection.
--
https://code.launchpad.net/~m2j/openlp/smallfix/+merge/90560
Your team OpenLP Core is requested to review the proposed merge of lp:~m2j/openlp/smallfix into lp:openlp.
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2011-12-27 10:33:55 +0000
+++ openlp/core/ui/generaltab.py 2012-01-28 01:18:24 +0000
@@ -53,20 +53,54 @@
"""
self.setObjectName(u'GeneralTab')
SettingsTab.setupUi(self)
- self.monitorGroupBox = QtGui.QGroupBox(self.leftColumn)
- self.monitorGroupBox.setObjectName(u'monitorGroupBox')
- self.monitorLayout = QtGui.QFormLayout(self.monitorGroupBox)
- self.monitorLayout.setObjectName(u'monitorLayout')
- self.monitorLabel = QtGui.QLabel(self.monitorGroupBox)
- self.monitorLabel.setObjectName(u'monitorLabel')
- self.monitorLayout.addRow(self.monitorLabel)
- self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox)
- self.monitorComboBox.setObjectName(u'monitorComboBox')
- self.monitorLayout.addRow(self.monitorComboBox)
- self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
- self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
- self.monitorLayout.addRow(self.displayOnMonitorCheck)
- self.leftLayout.addWidget(self.monitorGroupBox)
+ self.screenGroupBox = QtGui.QGroupBox(self.leftColumn)
+ self.screenGroupBox.setObjectName(u'screenGroupBox')
+ self.screenLayout = QtGui.QFormLayout(self.screenGroupBox)
+ self.screenLayout.setObjectName(u'screenLayout')
+ self.screenLabel = QtGui.QLabel(self.screenGroupBox)
+ self.screenLabel.setObjectName(u'screenLabel')
+ self.screenComboBox = QtGui.QComboBox(self.screenGroupBox)
+ self.screenComboBox.setObjectName(u'screenComboBox')
+ self.screenLayout.addRow(self.screenLabel, self.screenComboBox)
+ self.customWidget = QtGui.QWidget(self.screenGroupBox)
+ self.customWidget.setObjectName(u'customWidget')
+ self.customLayout = QtGui.QGridLayout(self.customWidget)
+ self.customLayout.setObjectName(u'customLayout')
+ self.customLayout.setMargin(0)
+ self.customXLabel = QtGui.QLabel(self.customWidget)
+ self.customXLabel.setObjectName(u'customXLabel')
+ self.customLayout.addWidget(self.customXLabel, 0, 0)
+ self.customXValueEdit = QtGui.QSpinBox(self.customWidget)
+ self.customXValueEdit.setObjectName(u'customXValueEdit')
+ self.customXValueEdit.setRange(-9999, 9999)
+ self.customLayout.addWidget(self.customXValueEdit, 1, 0)
+ self.customYLabel = QtGui.QLabel(self.customWidget)
+ self.customYLabel.setObjectName(u'customYLabel')
+ self.customLayout.addWidget(self.customYLabel, 0, 1)
+ self.customYValueEdit = QtGui.QSpinBox(self.customWidget)
+ self.customYValueEdit.setObjectName(u'customYValueEdit')
+ self.customYValueEdit.setRange(-9999, 9999)
+ self.customLayout.addWidget(self.customYValueEdit, 1, 1)
+ self.customWidthLabel = QtGui.QLabel(self.customWidget)
+ self.customWidthLabel.setObjectName(u'customWidthLabel')
+ self.customLayout.addWidget(self.customWidthLabel, 0, 2)
+ self.customWidthValueEdit = QtGui.QSpinBox(self.customWidget)
+ self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
+ self.customWidthValueEdit.setMaximum(9999)
+ self.customLayout.addWidget(self.customWidthValueEdit, 1, 2)
+ self.customHeightLabel = QtGui.QLabel(self.customWidget)
+ self.customHeightLabel.setObjectName(u'customHeightLabel')
+ self.customLayout.addWidget(self.customHeightLabel, 0, 3)
+ self.customHeightValueEdit = QtGui.QSpinBox(self.customWidget)
+ self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
+ self.customHeightValueEdit.setMaximum(9999)
+ self.customLayout.addWidget(self.customHeightValueEdit, 1, 3)
+ self.screenLayout.addRow(self.customWidget)
+ self.screenOnSingleHeadCheck = QtGui.QCheckBox(self.screenGroupBox)
+ self.screenOnSingleHeadCheck.setObjectName(u'screenComboBox')
+ self.screenLayout.addRow(self.screenOnSingleHeadCheck)
+ self.leftLayout.addWidget(self.screenGroupBox)
+ # Startup settings
self.startupGroupBox = QtGui.QGroupBox(self.leftColumn)
self.startupGroupBox.setObjectName(u'startupGroupBox')
self.startupLayout = QtGui.QVBoxLayout(self.startupGroupBox)
@@ -131,45 +165,6 @@
self.passwordEdit.setObjectName(u'passwordEdit')
self.ccliLayout.addRow(self.passwordLabel, self.passwordEdit)
self.rightLayout.addWidget(self.ccliGroupBox)
- # Moved here from display tab
- self.displayGroupBox = QtGui.QGroupBox(self.rightColumn)
- self.displayGroupBox.setObjectName(u'displayGroupBox')
- self.displayLayout = QtGui.QGridLayout(self.displayGroupBox)
- self.displayLayout.setObjectName(u'displayLayout')
- self.overrideCheckBox = QtGui.QCheckBox(self.displayGroupBox)
- self.overrideCheckBox.setObjectName(u'overrideCheckBox')
- self.displayLayout.addWidget(self.overrideCheckBox, 2, 0, 1, 4)
- self.rightLayout.addWidget(self.displayGroupBox)
- # Custom position
- self.customXLabel = QtGui.QLabel(self.displayGroupBox)
- self.customXLabel.setObjectName(u'customXLabel')
- self.displayLayout.addWidget(self.customXLabel, 3, 0)
- self.customXValueEdit = QtGui.QSpinBox(self.displayGroupBox)
- self.customXValueEdit.setObjectName(u'customXValueEdit')
- self.customXValueEdit.setRange(-9999, 9999)
- self.displayLayout.addWidget(self.customXValueEdit, 4, 0)
- self.customYLabel = QtGui.QLabel(self.displayGroupBox)
- self.customYLabel.setObjectName(u'customYLabel')
- self.displayLayout.addWidget(self.customYLabel, 3, 1)
- self.customYValueEdit = QtGui.QSpinBox(self.displayGroupBox)
- self.customYValueEdit.setObjectName(u'customYValueEdit')
- self.customYValueEdit.setRange(-9999, 9999)
- self.displayLayout.addWidget(self.customYValueEdit, 4, 1)
- self.customWidthLabel = QtGui.QLabel(self.displayGroupBox)
- self.customWidthLabel.setObjectName(u'customWidthLabel')
- self.displayLayout.addWidget(self.customWidthLabel, 3, 2)
- self.customWidthValueEdit = QtGui.QSpinBox(self.displayGroupBox)
- self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
- self.customWidthValueEdit.setMaximum(9999)
- self.displayLayout.addWidget(self.customWidthValueEdit, 4, 2)
- self.customHeightLabel = QtGui.QLabel(self.displayGroupBox)
- self.customHeightLabel.setObjectName(u'customHeightLabel')
- self.displayLayout.addWidget(self.customHeightLabel, 3, 3)
- self.customHeightValueEdit = QtGui.QSpinBox(self.displayGroupBox)
- self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
- self.customHeightValueEdit.setMaximum(9999)
- self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
- self.rightLayout.addWidget(self.displayGroupBox)
# Background audio
self.audioGroupBox = QtGui.QGroupBox(self.rightColumn)
self.audioGroupBox.setObjectName(u'audioGroupBox')
@@ -181,8 +176,6 @@
self.rightLayout.addWidget(self.audioGroupBox)
self.rightLayout.addStretch()
# Signals and slots
- QtCore.QObject.connect(self.overrideCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
QtCore.QObject.connect(self.customHeightValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customWidthValueEdit,
@@ -191,7 +184,7 @@
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customXValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
- QtCore.QObject.connect(self.monitorComboBox,
+ QtCore.QObject.connect(self.screenComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
# Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -207,11 +200,15 @@
Translate the general settings tab to the currently selected language
"""
self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General')
- self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab',
- 'Monitors'))
- self.monitorLabel.setText(translate('OpenLP.GeneralTab',
- 'Select monitor for output display:'))
- self.displayOnMonitorCheck.setText(
+ self.screenGroupBox.setTitle(translate('OpenLP.GeneralTab',
+ 'Output Screen'))
+ self.screenLabel.setText(translate('OpenLP.GeneralTab',
+ 'Display Location:'))
+ self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
+ self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
+ self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
+ self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
+ self.screenOnSingleHeadCheck.setText(
translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startupGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Startup'))
@@ -243,15 +240,6 @@
translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect password:'))
- # Moved from display tab
- self.displayGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'Display Position'))
- self.overrideCheckBox.setText(translate('OpenLP.GeneralTab',
- 'Override display position'))
- self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
- self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
- self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
- self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
self.audioGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Background Audio'))
self.startPausedCheckBox.setText(
@@ -263,11 +251,27 @@
"""
settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection)
- self.monitorComboBox.clear()
- self.monitorComboBox.addItems(self.screens.get_screen_list())
- monitorNumber = settings.value(u'monitor',
+ self.screenComboBox.clear()
+ self.screenComboBox.addItems(self.screens.get_screen_list())
+ self.screenComboBox.addItem(translate('OpenLP.GeneralTab',
+ 'Custom Position'))
+ selectedItem = settings.value(u'monitor',
QtCore.QVariant(self.screens.display_count - 1)).toInt()[0]
- self.monitorComboBox.setCurrentIndex(monitorNumber)
+ override = settings.value(u'override position').toBool()
+ if override:
+ selectedItem = self.screens.display_count
+ else:
+ selectedItem = min(selectedItem, self.screens.display_count - 1)
+ self.screenComboBox.setCurrentIndex(selectedItem)
+ self.customWidget.setVisible(override)
+ self.customXValueEdit.setValue(settings.value(u'x position',
+ QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0])
+ self.customYValueEdit.setValue(settings.value(u'y position',
+ QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0])
+ self.customHeightValueEdit.setValue(settings.value(u'height',
+ QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
+ self.customWidthValueEdit.setValue(settings.value(u'width',
+ QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
self.numberEdit.setText(unicode(settings.value(
u'ccli number', QtCore.QVariant(u'')).toString()))
self.usernameEdit.setText(unicode(settings.value(
@@ -278,7 +282,7 @@
QtCore.QVariant(False)).toBool())
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank',
QtCore.QVariant(False)).toBool())
- self.displayOnMonitorCheck.setChecked(self.screens.display)
+ self.screenOnSingleHeadCheck.setChecked(self.screens.display)
self.warningCheckBox.setChecked(settings.value(u'blank warning',
QtCore.QVariant(False)).toBool())
self.autoOpenCheckBox.setChecked(settings.value(u'auto open',
@@ -293,23 +297,9 @@
QtCore.QVariant(True)).toBool())
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
QtCore.QVariant(5)).toInt()[0])
- self.overrideCheckBox.setChecked(settings.value(u'override position',
- QtCore.QVariant(False)).toBool())
- self.customXValueEdit.setValue(settings.value(u'x position',
- QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0])
- self.customYValueEdit.setValue(settings.value(u'y position',
- QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0])
- self.customHeightValueEdit.setValue(settings.value(u'height',
- QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
- self.customWidthValueEdit.setValue(settings.value(u'width',
- QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
self.startPausedCheckBox.setChecked(settings.value(
u'audio start paused', QtCore.QVariant(True)).toBool())
settings.endGroup()
- self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
- self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
- self.customHeightValueEdit.setEnabled(self.overrideCheckBox.isChecked())
- self.customWidthValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.display_changed = False
def save(self):
@@ -318,10 +308,22 @@
"""
settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection)
- settings.setValue(u'monitor',
- QtCore.QVariant(self.monitorComboBox.currentIndex()))
+ override = \
+ (self.screenComboBox.currentIndex() == self.screens.display_count)
+ if not override:
+ settings.setValue(u'monitor',
+ QtCore.QVariant(self.screenComboBox.currentIndex()))
+ settings.setValue(u'override position', QtCore.QVariant(override))
+ settings.setValue(u'x position',
+ QtCore.QVariant(self.customXValueEdit.value()))
+ settings.setValue(u'y position',
+ QtCore.QVariant(self.customYValueEdit.value()))
+ settings.setValue(u'height',
+ QtCore.QVariant(self.customHeightValueEdit.value()))
+ settings.setValue(u'width',
+ QtCore.QVariant(self.customWidthValueEdit.value()))
settings.setValue(u'display on monitor',
- QtCore.QVariant(self.displayOnMonitorCheck.isChecked()))
+ QtCore.QVariant(self.screenOnSingleHeadCheck.isChecked()))
settings.setValue(u'blank warning',
QtCore.QVariant(self.warningCheckBox.isChecked()))
settings.setValue(u'auto open',
@@ -346,16 +348,6 @@
QtCore.QVariant(self.usernameEdit.displayText()))
settings.setValue(u'songselect password',
QtCore.QVariant(self.passwordEdit.displayText()))
- settings.setValue(u'x position',
- QtCore.QVariant(self.customXValueEdit.value()))
- settings.setValue(u'y position',
- QtCore.QVariant(self.customYValueEdit.value()))
- settings.setValue(u'height',
- QtCore.QVariant(self.customHeightValueEdit.value()))
- settings.setValue(u'width',
- QtCore.QVariant(self.customWidthValueEdit.value()))
- settings.setValue(u'override position',
- QtCore.QVariant(self.overrideCheckBox.isChecked()))
settings.setValue(u'audio start paused',
QtCore.QVariant(self.startPausedCheckBox.isChecked()))
settings.endGroup()
@@ -372,36 +364,25 @@
# Do not continue on start up.
if not postUpdate:
return
- self.screens.set_current_display(self.monitorComboBox.currentIndex())
- self.screens.display = self.displayOnMonitorCheck.isChecked()
- self.screens.override[u'size'] = QtCore.QRect(
- self.customXValueEdit.value(),
- self.customYValueEdit.value(),
- self.customWidthValueEdit.value(),
- self.customHeightValueEdit.value())
- if self.overrideCheckBox.isChecked():
+ if self.screenComboBox.currentIndex() == self.screens.display_count:
+ self.screens.override[u'size'] = QtCore.QRect(
+ self.customXValueEdit.value(),
+ self.customYValueEdit.value(),
+ self.customWidthValueEdit.value(),
+ self.customHeightValueEdit.value())
self.screens.set_override_display()
else:
+ self.screens.set_current_display(self.screenComboBox.currentIndex())
self.screens.reset_current_display()
+ self.screens.display = self.screenOnSingleHeadCheck.isChecked()
if self.display_changed:
Receiver.send_message(u'config_screen_changed')
self.display_changed = False
- def onOverrideCheckBoxToggled(self, checked):
- """
- Toggle screen state depending on check box state.
-
- ``checked``
- The state of the check box (boolean).
- """
- self.customXValueEdit.setEnabled(checked)
- self.customYValueEdit.setEnabled(checked)
- self.customHeightValueEdit.setEnabled(checked)
- self.customWidthValueEdit.setEnabled(checked)
- self.display_changed = True
-
def onDisplayChanged(self):
"""
- Called when the width, height, x position or y position has changed.
+ Called if display settings were changed.
"""
+ self.customWidget.setVisible(
+ self.screenComboBox.currentIndex() == self.screens.display_count)
self.display_changed = True
=== modified file 'openlp/plugins/alerts/lib/alertstab.py'
--- openlp/plugins/alerts/lib/alertstab.py 2011-12-27 10:33:55 +0000
+++ openlp/plugins/alerts/lib/alertstab.py 2012-01-28 01:18:24 +0000
@@ -52,19 +52,15 @@
self.fontLayout.addRow(self.fontLabel, self.fontComboBox)
self.fontColorLabel = QtGui.QLabel(self.fontGroupBox)
self.fontColorLabel.setObjectName(u'fontColorLabel')
- self.colorLayout = QtGui.QHBoxLayout()
- self.colorLayout.setObjectName(u'colorLayout')
self.fontColorButton = QtGui.QPushButton(self.fontGroupBox)
self.fontColorButton.setObjectName(u'fontColorButton')
- self.colorLayout.addWidget(self.fontColorButton)
- self.colorLayout.addSpacing(20)
+ self.fontLayout.addRow(self.fontColorLabel, self.fontColorButton)
self.backgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
self.backgroundColorLabel.setObjectName(u'backgroundColorLabel')
- self.colorLayout.addWidget(self.backgroundColorLabel)
self.backgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
self.backgroundColorButton.setObjectName(u'backgroundColorButton')
- self.colorLayout.addWidget(self.backgroundColorButton)
- self.fontLayout.addRow(self.fontColorLabel, self.colorLayout)
+ self.fontLayout.addRow(self.backgroundColorLabel,
+ self.backgroundColorButton)
self.fontSizeLabel = QtGui.QLabel(self.fontGroupBox)
self.fontSizeLabel.setObjectName(u'fontSizeLabel')
self.fontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
=== modified file 'openlp/plugins/images/lib/imagetab.py'
--- openlp/plugins/images/lib/imagetab.py 2011-12-27 10:33:55 +0000
+++ openlp/plugins/images/lib/imagetab.py 2012-01-28 01:18:24 +0000
@@ -53,6 +53,7 @@
self.formLayout.addRow(self.colorLayout)
self.informationLabel = QtGui.QLabel(self.bgColorGroupBox)
self.informationLabel.setObjectName(u'InformationLabel')
+ self.informationLabel.setWordWrap(True)
self.formLayout.addRow(self.informationLabel)
self.leftLayout.addWidget(self.bgColorGroupBox)
self.leftLayout.addStretch()
Follow ups