← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~phill-ridout/openlp/bug1222534_2.0 into lp:openlp/2.0

 

Phill has proposed merging lp:~phill-ridout/openlp/bug1222534_2.0 into lp:openlp/2.0.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1222534 in OpenLP: "KeyError when "Allow presentation application to be overridden" and Spanish language is selected"
  https://bugs.launchpad.net/openlp/+bug/1222534

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug1222534_2.0/+merge/195871

Fixed bug1222534 by using userData rather than relying on a translated string.
-- 
https://code.launchpad.net/~phill-ridout/openlp/bug1222534_2.0/+merge/195871
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/bug1222534_2.0 into lp:openlp/2.0.
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2013-08-20 18:30:15 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2013-11-19 22:15:22 +0000
@@ -153,7 +153,7 @@
             if self.controllers[item].enabled():
                 self.displayTypeComboBox.addItem(item)
         if self.displayTypeComboBox.count() > 1:
-            self.displayTypeComboBox.insertItem(0, self.Automatic)
+            self.displayTypeComboBox.insertItem(0, self.Automatic, userData=u'automatic')
             self.displayTypeComboBox.setCurrentIndex(0)
         if Settings().value(self.settingsSection + u'/override app',
             QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
@@ -277,13 +277,13 @@
         service_item.shortname = unicode(self.displayTypeComboBox.currentText())
         service_item.add_capability(ItemCapabilities.ProvidesOwnDisplay)
         service_item.add_capability(ItemCapabilities.HasDetailedTitleDisplay)
-        shortname = service_item.shortname
-        if not shortname:
+        if not service_item.shortname:
             return False
         for bitem in items:
             filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
             if os.path.exists(filename):
-                if shortname == self.Automatic:
+                if self.displayTypeComboBox.itemData(
+                    self.displayTypeComboBox.currentIndex()) == u'automatic':
                     service_item.shortname = self.findControllerByType(filename)
                     if not service_item.shortname:
                         return False


Follow ups