openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #05381
[Merge] lp:~m2j/openlp/work into lp:openlp
m2j has proposed merging lp:~m2j/openlp/work into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
#609356 Web bibles don't download all their books on import
https://bugs.launchpad.net/bugs/609356
#661867 Invalid author added in song dialog
https://bugs.launchpad.net/bugs/661867
#686103 Labels in theme wizard out of alignment on Windows
https://bugs.launchpad.net/bugs/686103
#698881 Saving settings tries to use uno when unavailable
https://bugs.launchpad.net/bugs/698881
For more details, see:
https://code.launchpad.net/~m2j/openlp/work/+merge/45500
Bug #698881 (accessing unavailable presentation controller)
Keep settings if the controller is not available
--
https://code.launchpad.net/~m2j/openlp/work/+merge/45500
Your team OpenLP Core is requested to review the proposed merge of lp:~m2j/openlp/work into lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py 2011-01-03 11:25:30 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py 2011-01-07 09:52:58 +0000
@@ -53,7 +53,9 @@
for key in self.controllers:
controller = self.controllers[key]
checkbox = QtGui.QCheckBox(self.ControllersGroupBox)
- checkbox.setEnabled(controller.available)
+ if not controller.available:
+ checkbox.setTristate(True)
+ checkbox.setEnabled(False)
checkbox.setObjectName(controller.name + u'CheckBox')
self.PresenterCheckboxes[controller.name] = checkbox
self.ControllersLayout.addWidget(checkbox)
@@ -93,11 +95,16 @@
"""
for key in self.controllers:
controller = self.controllers[key]
- if controller.available:
- checkbox = self.PresenterCheckboxes[controller.name]
- checkbox.setChecked(QtCore.QSettings().value(
- self.settingsSection + u'/' + controller.name,
- QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0])
+ checkbox = self.PresenterCheckboxes[controller.name]
+ if QtCore.QSettings().value(
+ self.settingsSection + u'/' + controller.name,
+ QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0]:
+ if controller.available:
+ checkbox.setCheckState(QtCore.Qt.Checked)
+ else:
+ checkbox.setCheckState(QtCore.Qt.PartiallyChecked)
+ else:
+ checkbox.setCheckState(QtCore.Qt.Unchecked)
self.OverrideAppCheckBox.setChecked(QtCore.QSettings().value(
self.settingsSection + u'/override app',
QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
@@ -111,14 +118,15 @@
controller = self.controllers[key]
checkbox = self.PresenterCheckboxes[controller.name]
setting_key = self.settingsSection + u'/' + controller.name
- if QtCore.QSettings().value(setting_key) != checkbox.checkState():
- changed = True
- QtCore.QSettings().setValue(setting_key,
- QtCore.QVariant(checkbox.checkState()))
- if checkbox.checkState() == QtCore.Qt.Checked:
- controller.start_process()
- else:
- controller.kill()
+ if controller.check_available():
+ if QtCore.QSettings().value(setting_key) != checkbox.checkState():
+ changed = True
+ QtCore.QSettings().setValue(setting_key,
+ QtCore.QVariant(checkbox.checkState()))
+ if checkbox.isChecked():
+ controller.start_process()
+ else:
+ controller.kill()
setting_key = self.settingsSection + u'/override app'
if QtCore.QSettings().value(setting_key) != \
self.OverrideAppCheckBox.checkState():
Follow ups