m2j has proposed merging lp:~m2j/openlp/work into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)
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/45504

Bug #698881 (accessing unavailable presentation controller)
Keep settings if the controller is not available
-- 
https://code.launchpad.net/~m2j/openlp/work/+merge/45504
Your team OpenLP Core is subscribed to branch 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 10:33:10 +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)
@@ -79,7 +81,12 @@
         for key in self.controllers:
             controller = self.controllers[key]
             checkbox = self.PresenterCheckboxes[controller.name]
-            checkbox.setText(controller.name)
+            if controller.available:
+                checkbox.setText(controller.name)
+            else:
+                checkbox.setText(
+                    unicode(translate('PresentationPlugin.PresentationTab',
+                    '%s (unvailable)')) % controller.name)
         self.AdvancedGroupBox.setTitle(
             translate('PresentationPlugin.PresentationTab',
             'Advanced'))
@@ -93,11 +100,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 +123,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():

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to