bzr-revno: 1349
This commit is contained in:
Mattias Põldaru 2011-03-04 09:24:51 +02:00 committed by Raoul Snyman
commit b01d6f7656

View File

@ -98,7 +98,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
match = self.verse_regex.match(text) match = self.verse_regex.match(text)
if match: if match:
verse_tag = match.group(1) verse_tag = match.group(1)
try:
verse_num = int(match.group(2)) verse_num = int(match.group(2))
except ValueError:
verse_num = 1
verse_type_index = VerseType.from_loose_input(verse_tag) verse_type_index = VerseType.from_loose_input(verse_tag)
if verse_type_index is not None: if verse_type_index is not None:
self.verseNumberBox.setValue(verse_num) self.verseNumberBox.setValue(verse_num)
@ -127,7 +130,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
if match: if match:
verse_type = match.group(1) verse_type = match.group(1)
verse_type_index = VerseType.from_loose_input(verse_type) verse_type_index = VerseType.from_loose_input(verse_type)
try:
verse_number = int(match.group(2)) verse_number = int(match.group(2))
except ValueError:
verse_number = 1
if verse_type_index is not None: if verse_type_index is not None:
self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseTypeComboBox.setCurrentIndex(verse_type_index)
self.verseNumberBox.setValue(verse_number) self.verseNumberBox.setValue(verse_number)