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
object for accessing settings stored in that Ini file.
"""
# TODO change
__filePath = u''
__filePath__ = u''
@staticmethod
def setFilename(iniFile):
@ -102,12 +101,12 @@ class Settings(QtCore.QSettings):
Does not affect existing Settings objects.
"""
Settings.__filePath = iniFile
Settings.__filePath__ = iniFile
def __init__(self, *args):
if not args and Settings.__filePath and (Settings.defaultFormat() ==
Settings.IniFormat):
QtCore.QSettings.__init__(self, Settings.__filePath,
if not args and Settings.__filePath__ and \
Settings.defaultFormat() == Settings.IniFormat:
QtCore.QSettings.__init__(self, Settings.__filePath__,
Settings.IniFormat)
else:
QtCore.QSettings.__init__(self, *args)
@ -130,7 +129,7 @@ class Settings(QtCore.QSettings):
extended if a certain type is missing!
"""
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.
if setting is None:
return []

View File

@ -699,7 +699,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.liveController.screenSizeChanged()
log.info(u'Load data from Settings')
if Settings().value(u'advanced/save current plugin', False):
# TODO: QtCore.QVariant()).toInt()[0]
savedPlugin = Settings().value(u'advanced/current media plugin', -1)
if savedPlugin != -1:
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
"""
#TODO check
print type(lines)
self.mainLineCountLabel.setText(translate('OpenLP.ThemeForm',
'(approximately %d lines per slide)') % int(lines))
@ -233,7 +231,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
background_image = BackgroundType.to_string(BackgroundType.Image)
if self.page(self.currentId()) == self.backgroundPage and \
self.theme.background_type == background_image and \
self.imageFileEdit.text().isEmpty():
not self.imageFileEdit.text():
QtGui.QMessageBox.critical(self,
translate('OpenLP.ThemeWizard', 'Background Image Empty'),
translate('OpenLP.ThemeWizard', 'You have not selected a '

View File

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