openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #21255
[Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
Oliver Wieland has proposed merging lp:~oliwee/openlp/HideBibleVerses into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
Related bugs:
Bug #1051699 in OpenLP: "Bibles add option to not display chapter and verse numbers"
https://bugs.launchpad.net/openlp/+bug/1051699
For more details, see:
https://code.launchpad.net/~oliwee/openlp/HideBibleVerses/+merge/179610
The changes add a Checkbox at the Bibles settings tab to show or hide the verse numbers. Therefor a new element "Display verse numbers" in the settings is implemented. On default, this element is set to True.
If the value is set to False, the values "Show new chapters" and "Display Style" are not relevant and the input fields at the Bibles settings tab will be greyed out.
--
https://code.launchpad.net/~oliwee/openlp/HideBibleVerses/+merge/179610
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2013-04-18 17:45:14 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2013-08-11 21:15:27 +0000
@@ -48,6 +48,7 @@
u'bibles/verse layout style': LayoutStyle.VersePerSlide,
u'bibles/book name language': LanguageSelection.Bible,
u'bibles/display brackets': DisplayStyle.NoBrackets,
+ u'bibles/display verse': True,
u'bibles/display new chapter': False,
u'bibles/second bibles': True,
u'bibles/advanced bible': u'',
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2013-03-25 07:27:54 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2013-08-11 21:15:27 +0000
@@ -58,6 +58,9 @@
self.verse_display_group_box.setObjectName(u'verse_display_group_box')
self.verse_display_layout = QtGui.QFormLayout(self.verse_display_group_box)
self.verse_display_layout.setObjectName(u'verse_display_layout')
+ self.display_verse_check_box = QtGui.QCheckBox(self.verse_display_group_box)
+ self.display_verse_check_box.setObjectName(u'verse_display_check_box')
+ self.verse_display_layout.addRow(self.display_verse_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')
self.verse_display_layout.addRow(self.new_chapters_check_box)
@@ -134,6 +137,7 @@
self.left_layout.addStretch()
self.right_layout.addStretch()
# Signals and slots
+ self.display_verse_check_box.stateChanged.connect(self.on_display_verse_check_box_changed)
self.new_chapters_check_box.stateChanged.connect(self.on_new_chapters_check_box_changed)
self.display_style_combo_box.activated.connect(self.on_display_style_combo_box_changed)
self.bible_theme_combo_box.activated.connect(self.on_bible_theme_combo_box_changed)
@@ -156,6 +160,7 @@
def retranslateUi(self):
self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
+ self.display_verse_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Display 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)
@@ -208,6 +213,14 @@
def on_language_selection_combo_box_changed(self):
self.language_selection = self.language_selection_combo_box.currentIndex()
+ def on_display_verse_check_box_changed(self, check_state):
+ self.display_verse = False
+ # We have a set value convert to True/False.
+ if check_state == QtCore.Qt.Checked:
+ self.display_verse = True
+
+ self.check_display_verse()
+
def on_new_chapters_check_box_changed(self, check_state):
self.show_new_chapters = False
# We have a set value convert to True/False.
@@ -299,11 +312,14 @@
def load(self):
settings = Settings()
settings.beginGroup(self.settings_section)
+ self.display_verse = settings.value(u'display verse')
self.show_new_chapters = settings.value(u'display new chapter')
self.display_style = settings.value(u'display brackets')
self.layout_style = settings.value(u'verse layout style')
self.bible_theme = settings.value(u'bible theme')
self.second_bibles = settings.value(u'second bibles')
+ self.display_verse_check_box.setChecked(self.display_verse)
+ self.check_display_verse()
self.new_chapters_check_box.setChecked(self.show_new_chapters)
self.display_style_combo_box.setCurrentIndex(self.display_style)
self.layout_style_combo_box.setCurrentIndex(self.layout_style)
@@ -351,6 +367,7 @@
def save(self):
settings = Settings()
settings.beginGroup(self.settings_section)
+ settings.setValue(u'display verse', self.display_verse)
settings.setValue(u'display new chapter', self.show_new_chapters)
settings.setValue(u'display brackets', self.display_style)
settings.setValue(u'verse layout style', self.layout_style)
@@ -405,3 +422,12 @@
color.setAlpha(128)
palette.setColor(QtGui.QPalette.Active, QtGui.QPalette.Text, color)
return palette
+
+ def check_display_verse(self):
+ """
+ Enables / Disables verse settings dependent on display_verse
+ """
+ self.new_chapters_check_box.setEnabled(self.display_verse)
+ self.display_style_label.setEnabled(self.display_verse)
+ self.display_style_combo_box.setEnabled(self.display_verse)
+
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2013-04-20 20:34:46 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2013-08-11 21:15:27 +0000
@@ -943,17 +943,20 @@
The verse number (int).
"""
verse_separator = get_reference_separator(u'sep_v_display')
- 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
- if self.settings.display_style == DisplayStyle.Curly:
- return u'{su}{%s}{/su}' % verse_text
- if self.settings.display_style == DisplayStyle.Square:
- return u'{su}[%s]{/su}' % verse_text
- return u'{su}%s{/su}' % verse_text
+
+ if self.settings.display_verse:
+ 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''
def search(self, string, showError):
"""
Follow ups
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Tim Bentley, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Phill, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Jonathan Corwin, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Tim Bentley, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Oliver Wieland, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Tim Bentley, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Oliver Wieland, 2013-08-15
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Raoul Snyman, 2013-08-14
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Oliver Wieland, 2013-08-12
-
Re: [Merge] lp:~oliwee/openlp/HideBibleVerses into lp:openlp
From: Phill, 2013-08-12