forked from openlp/openlp
phrase verse index decoding more pythonish
This commit is contained in:
parent
83968d8194
commit
0229b362af
@ -74,8 +74,6 @@ class VerseType(object):
|
|||||||
elif verse_type == \
|
elif verse_type == \
|
||||||
unicode(VerseType.to_string(VerseType.Other)).lower():
|
unicode(VerseType.to_string(VerseType.Other)).lower():
|
||||||
return VerseType.Other
|
return VerseType.Other
|
||||||
else:
|
|
||||||
return -1
|
|
||||||
|
|
||||||
from authorsform import AuthorsForm
|
from authorsform import AuthorsForm
|
||||||
from topicsform import TopicsForm
|
from topicsform import TopicsForm
|
||||||
|
@ -104,7 +104,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
verse_type = match.group(1)
|
verse_type = match.group(1)
|
||||||
verse_number = int(match.group(2))
|
verse_number = int(match.group(2))
|
||||||
verse_type_index = VerseType.from_string(verse_type)
|
verse_type_index = VerseType.from_string(verse_type)
|
||||||
if verse_type_index >= 0:
|
if not isinstance(verse_type_index, NoneType):
|
||||||
self.VerseTypeComboBox.setCurrentIndex(verse_type_index)
|
self.VerseTypeComboBox.setCurrentIndex(verse_type_index)
|
||||||
self.VerseNumberBox.setValue(verse_number)
|
self.VerseNumberBox.setValue(verse_number)
|
||||||
|
|
||||||
@ -112,8 +112,9 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
|
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
|
||||||
if single:
|
if single:
|
||||||
verse_type, verse_number = tag.split(u':')
|
verse_type, verse_number = tag.split(u':')
|
||||||
self.VerseTypeComboBox.setCurrentIndex(
|
verse_type_index = VerseType.from_string(verse_type)
|
||||||
VerseType.from_string(verse_type))
|
if not isinstance(verse_type_index, NoneType):
|
||||||
|
self.VerseTypeComboBox.setCurrentIndex(verse_type_index)
|
||||||
self.VerseNumberBox.setValue(int(verse_number))
|
self.VerseNumberBox.setValue(int(verse_number))
|
||||||
self.InsertButton.setVisible(False)
|
self.InsertButton.setVisible(False)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user