biblestab.py: minor changes in naming objects

mediaitem.py: rearrange code for better readability
This commit is contained in:
Oliver Wieland 2013-08-26 19:14:52 +02:00
parent b591a091fd
commit 0a0d7dca84
2 changed files with 15 additions and 15 deletions

View File

@ -59,7 +59,7 @@ class BiblesTab(SettingsTab):
self.verse_display_layout = QtGui.QFormLayout(self.verse_display_group_box)
self.verse_display_layout.setObjectName(u'verse_display_layout')
self.is_verse_number_visible_check_box = QtGui.QCheckBox(self.verse_display_group_box)
self.is_verse_number_visible_check_box.setObjectName(u'verse_display_check_box')
self.is_verse_number_visible_check_box.setObjectName(u'is_verse_number_visible_check_box')
self.verse_display_layout.addRow(self.is_verse_number_visible_check_box)
self.new_chapters_check_box = QtGui.QCheckBox(self.verse_display_group_box)
self.new_chapters_check_box.setObjectName(u'new_chapters_check_box')
@ -160,7 +160,7 @@ class BiblesTab(SettingsTab):
def retranslateUi(self):
self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
self.is_verse_number_visible_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Is verse number visible'))
self.is_verse_number_visible_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Show verse numbers'))
self.new_chapters_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Only show new chapter numbers'))
self.layout_style_label.setText(UiStrings().LayoutStyle)
self.display_style_label.setText(UiStrings().DisplayStyle)

View File

@ -943,19 +943,19 @@ class BibleMediaItem(MediaManagerItem):
The verse number (int).
"""
verse_separator = get_reference_separator(u'sep_v_display')
if self.settings.is_verse_number_visible:
if not self.settings.show_new_chapters or old_chapter != chapter:
verse_text = unicode(chapter) + verse_separator + unicode(verse)
else:
verse_text = unicode(verse)
if self.settings.display_style == DisplayStyle.Round:
return u'{su}(%s){/su}' % verse_text
elif self.settings.display_style == DisplayStyle.Curly:
return u'{su}{%s}{/su}' % verse_text
elif self.settings.display_style == DisplayStyle.Square:
return u'{su}[%s]{/su}' % verse_text
return u'{su}%s{/su}' % verse_text
return u''
if not self.settings.is_verse_number_visible:
return u''
if not self.settings.show_new_chapters or old_chapter != chapter:
verse_text = unicode(chapter) + verse_separator + unicode(verse)
else:
verse_text = unicode(verse)
if self.settings.display_style == DisplayStyle.Round:
return u'{su}(%s){/su}' % verse_text
elif self.settings.display_style == DisplayStyle.Curly:
return u'{su}{%s}{/su}' % verse_text
elif self.settings.display_style == DisplayStyle.Square:
return u'{su}[%s]{/su}' % verse_text
return u'{su}%s{/su}' % verse_text
def search(self, string, showError):
"""