This commit is contained in:
Andreas Preikschat 2012-10-03 19:55:39 +02:00
parent 4a7a7e9050
commit c4bdea7edd
4 changed files with 11 additions and 15 deletions

View File

@ -92,8 +92,7 @@ class Settings(QtCore.QSettings):
then the Settings constructor (without any arguments) will create a Settings then the Settings constructor (without any arguments) will create a Settings
object for accessing settings stored in that Ini file. object for accessing settings stored in that Ini file.
""" """
# TODO change __filePath__ = u''
__filePath = u''
@staticmethod @staticmethod
def setFilename(iniFile): def setFilename(iniFile):
@ -102,12 +101,12 @@ class Settings(QtCore.QSettings):
Does not affect existing Settings objects. Does not affect existing Settings objects.
""" """
Settings.__filePath = iniFile Settings.__filePath__ = iniFile
def __init__(self, *args): def __init__(self, *args):
if not args and Settings.__filePath and (Settings.defaultFormat() == if not args and Settings.__filePath__ and \
Settings.IniFormat): Settings.defaultFormat() == Settings.IniFormat:
QtCore.QSettings.__init__(self, Settings.__filePath, QtCore.QSettings.__init__(self, Settings.__filePath__,
Settings.IniFormat) Settings.IniFormat)
else: else:
QtCore.QSettings.__init__(self, *args) QtCore.QSettings.__init__(self, *args)
@ -130,7 +129,7 @@ class Settings(QtCore.QSettings):
extended if a certain type is missing! extended if a certain type is missing!
""" """
setting = super(Settings, self).value(key, defaultValue) setting = super(Settings, self).value(key, defaultValue)
# An empty list saved to the settings results ins a None type being # An empty list saved to the settings results in a None type being
# returned. # returned.
if setting is None: if setting is None:
return [] return []

View File

@ -699,7 +699,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.liveController.screenSizeChanged() self.liveController.screenSizeChanged()
log.info(u'Load data from Settings') log.info(u'Load data from Settings')
if Settings().value(u'advanced/save current plugin', False): if Settings().value(u'advanced/save current plugin', False):
# TODO: QtCore.QVariant()).toInt()[0]
savedPlugin = Settings().value(u'advanced/current media plugin', -1) savedPlugin = Settings().value(u'advanced/current media plugin', -1)
if savedPlugin != -1: if savedPlugin != -1:
self.mediaToolBox.setCurrentIndex(savedPlugin) self.mediaToolBox.setCurrentIndex(savedPlugin)

View File

@ -205,8 +205,6 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
""" """
Updates the lines on a page on the wizard Updates the lines on a page on the wizard
""" """
#TODO check
print type(lines)
self.mainLineCountLabel.setText(translate('OpenLP.ThemeForm', self.mainLineCountLabel.setText(translate('OpenLP.ThemeForm',
'(approximately %d lines per slide)') % int(lines)) '(approximately %d lines per slide)') % int(lines))
@ -233,7 +231,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
background_image = BackgroundType.to_string(BackgroundType.Image) background_image = BackgroundType.to_string(BackgroundType.Image)
if self.page(self.currentId()) == self.backgroundPage and \ if self.page(self.currentId()) == self.backgroundPage and \
self.theme.background_type == background_image and \ self.theme.background_type == background_image and \
self.imageFileEdit.text().isEmpty(): not self.imageFileEdit.text():
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('OpenLP.ThemeWizard', 'Background Image Empty'), translate('OpenLP.ThemeWizard', 'Background Image Empty'),
translate('OpenLP.ThemeWizard', 'You have not selected a ' translate('OpenLP.ThemeWizard', 'You have not selected a '

View File

@ -332,7 +332,7 @@ class BiblesTab(SettingsTab):
if self.verseSeparatorLineEdit.isModified(): if self.verseSeparatorLineEdit.isModified():
text = self.verseSeparatorLineEdit.text() text = self.verseSeparatorLineEdit.text()
if text == get_reference_separator(u'sep_v_default') or \ if text == get_reference_separator(u'sep_v_default') or \
text.remove(u'|').isEmpty(): not text.replace(u'|', u''):
self.verseSeparatorCheckBox.setChecked(False) self.verseSeparatorCheckBox.setChecked(False)
self.verseSeparatorLineEdit.setText( self.verseSeparatorLineEdit.setText(
get_reference_separator(u'sep_v_default')) get_reference_separator(u'sep_v_default'))
@ -357,7 +357,7 @@ class BiblesTab(SettingsTab):
if self.rangeSeparatorLineEdit.isModified(): if self.rangeSeparatorLineEdit.isModified():
text = self.rangeSeparatorLineEdit.text() text = self.rangeSeparatorLineEdit.text()
if text == get_reference_separator(u'sep_r_default') or \ if text == get_reference_separator(u'sep_r_default') or \
text.remove(u'|').isEmpty(): not text.replace(u'|', u''):
self.rangeSeparatorCheckBox.setChecked(False) self.rangeSeparatorCheckBox.setChecked(False)
self.rangeSeparatorLineEdit.setText( self.rangeSeparatorLineEdit.setText(
get_reference_separator(u'sep_r_default')) get_reference_separator(u'sep_r_default'))
@ -382,7 +382,7 @@ class BiblesTab(SettingsTab):
if self.listSeparatorLineEdit.isModified(): if self.listSeparatorLineEdit.isModified():
text = self.listSeparatorLineEdit.text() text = self.listSeparatorLineEdit.text()
if text == get_reference_separator(u'sep_l_default') or \ if text == get_reference_separator(u'sep_l_default') or \
text.remove(u'|').isEmpty(): not text.replace(u'|', u''):
self.listSeparatorCheckBox.setChecked(False) self.listSeparatorCheckBox.setChecked(False)
self.listSeparatorLineEdit.setText( self.listSeparatorLineEdit.setText(
get_reference_separator(u'sep_l_default')) get_reference_separator(u'sep_l_default'))
@ -407,7 +407,7 @@ class BiblesTab(SettingsTab):
if self.endSeparatorLineEdit.isModified(): if self.endSeparatorLineEdit.isModified():
text = self.endSeparatorLineEdit.text() text = self.endSeparatorLineEdit.text()
if text == get_reference_separator(u'sep_e_default') or \ if text == get_reference_separator(u'sep_e_default') or \
text.remove(u'|').isEmpty(): not text.replace(u'|', u''):
self.endSeparatorCheckBox.setChecked(False) self.endSeparatorCheckBox.setChecked(False)
self.endSeparatorLineEdit.setText( self.endSeparatorLineEdit.setText(
get_reference_separator(u'sep_e_default')) get_reference_separator(u'sep_e_default'))