Fix bug for song CCLI setting

Fix bug for dual bible tab which was a general settings bug.

bzr-revno: 1013
Fixes: https://launchpad.net/bugs/629848, https://launchpad.net/bugs/622894
This commit is contained in:
Tim Bentley 2010-09-05 07:05:00 +01:00
commit 2617e8d67b
5 changed files with 13 additions and 13 deletions

View File

@ -476,7 +476,6 @@ class GeneralTab(SettingsTab):
# Order is important so be careful if you change
if self.overrideChanged or postUpdate:
Receiver.send_message(u'config_screen_changed')
Receiver.send_message(u'config_updated')
self.overrideChanged = False
def onOverrideCheckBoxToggled(self, checked):

View File

@ -30,6 +30,7 @@ import logging
from PyQt4 import QtGui
from openlp.core.lib import Receiver
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
from settingsdialog import Ui_SettingsDialog
@ -87,6 +88,8 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
"""
for tabIndex in range(0, self.settingsTabWidget.count()):
self.settingsTabWidget.widget(tabIndex).save()
# Must go after all settings are save
Receiver.send_message(u'config_updated')
return QtGui.QDialog.accept(self)
def postSetUp(self):

View File

@ -196,10 +196,10 @@ class BiblesTab(SettingsTab):
self.show_new_chapters = True
def onBibleDualCheckBox(self, check_state):
self.duel_bibles = False
self.dual_bibles = False
# we have a set value convert to True/False
if check_state == QtCore.Qt.Checked:
self.duel_bibles = True
self.dual_bibles = True
def load(self):
settings = QtCore.QSettings()
@ -212,12 +212,12 @@ class BiblesTab(SettingsTab):
u'verse layout style', QtCore.QVariant(0)).toInt()[0]
self.bible_theme = unicode(
settings.value(u'bible theme', QtCore.QVariant(u'')).toString())
self.duel_bibles = settings.value(
self.dual_bibles = settings.value(
u'dual bibles', QtCore.QVariant(True)).toBool()
self.NewChaptersCheckBox.setChecked(self.show_new_chapters)
self.DisplayStyleComboBox.setCurrentIndex(self.display_style)
self.LayoutStyleComboBox.setCurrentIndex(self.layout_style)
self.BibleDualCheckBox.setChecked(self.duel_bibles)
self.BibleDualCheckBox.setChecked(self.dual_bibles)
settings.endGroup()
def save(self):
@ -229,7 +229,7 @@ class BiblesTab(SettingsTab):
QtCore.QVariant(self.display_style))
settings.setValue(u'verse layout style',
QtCore.QVariant(self.layout_style))
settings.setValue(u'dual bibles', QtCore.QVariant(self.duel_bibles))
settings.setValue(u'dual bibles', QtCore.QVariant(self.dual_bibles))
settings.setValue(u'bible theme', QtCore.QVariant(self.bible_theme))
settings.endGroup()

View File

@ -275,8 +275,9 @@ class BibleMediaItem(MediaManagerItem):
self.SearchProgress.setObjectName(u'SearchProgress')
def configUpdated(self):
log.debug(u'configUpdated')
if QtCore.QSettings().value(self.settingsSection + u'/dual bibles',
QtCore.QVariant(False)).toBool():
QtCore.QVariant(True)).toBool():
self.AdvancedSecondBibleLabel.setVisible(True)
self.AdvancedSecondBibleComboBox.setVisible(True)
self.QuickSecondVersionLabel.setVisible(True)

View File

@ -359,16 +359,13 @@ class SongMediaItem(MediaManagerItem):
author_list = author_list + u', '
author_list = author_list + unicode(author.display_name)
author_audit.append(unicode(author.display_name))
if song.ccli_number is None or len(song.ccli_number) == 0:
ccli = QtCore.QSettings().value(u'general/ccli number',
QtCore.QVariant(u'')).toString()
else:
ccli = unicode(song.ccli_number)
raw_footer.append(song.title)
raw_footer.append(author_list)
raw_footer.append(song.copyright )
raw_footer.append(unicode(
translate('SongsPlugin.MediaItem', 'CCLI Licence: ') + ccli))
translate('SongsPlugin.MediaItem', 'CCLI Licence: ') +
QtCore.QSettings().value(u'general/ccli number',
QtCore.QVariant(u'')).toString()))
service_item.raw_footer = raw_footer
service_item.audit = [
song.title, author_audit, song.copyright, unicode(song.ccli_number)