SongBeamer fixes

Correct Song Tab error

bzr-revno: 1169
This commit is contained in:
rimach 2010-12-27 08:28:33 +00:00 committed by Tim Bentley
commit ec062c2640
2 changed files with 6 additions and 2 deletions

View File

@ -90,6 +90,7 @@ class SongBeamerImport(SongImport):
len(self.import_source)) len(self.import_source))
for file in self.import_source: for file in self.import_source:
# TODO: check that it is a valid SongBeamer file # TODO: check that it is a valid SongBeamer file
self.set_defaults()
self.current_verse = u'' self.current_verse = u''
self.current_verse_type = u'V' self.current_verse_type = u'V'
read_verses = False read_verses = False
@ -105,6 +106,8 @@ class SongBeamerImport(SongImport):
infile.close() infile.close()
else: else:
return False return False
self.title = self.file_name.split('.sng')[0]
read_verses = False
for line in self.songData: for line in self.songData:
# Just make sure that the line is of the type 'Unicode'. # Just make sure that the line is of the type 'Unicode'.
line = unicode(line).strip() line = unicode(line).strip()
@ -129,6 +132,7 @@ class SongBeamerImport(SongImport):
if self.current_verse: if self.current_verse:
self.replace_html_tags() self.replace_html_tags()
self.add_verse(self.current_verse, self.current_verse_type) self.add_verse(self.current_verse, self.current_verse_type)
if self.check_complete():
self.finish() self.finish()
self.import_wizard.incrementProgressBar(u'%s %s...' % self.import_wizard.incrementProgressBar(u'%s %s...' %
(translate('SongsPlugin.SongBeamerImport', 'Importing'), (translate('SongsPlugin.SongBeamerImport', 'Importing'),

View File

@ -72,7 +72,7 @@ class SongsTab(SettingsTab):
QtCore.QObject.connect(self.SongUpdateOnEditCheckBox, QtCore.QObject.connect(self.SongUpdateOnEditCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onSongUpdateOnEditCheckBoxChanged) self.onSongUpdateOnEditCheckBoxChanged)
QtCore.QObject.connect(self.SongBarActiveCheckBox, QtCore.QObject.connect(self.SongAddFromServiceCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onSongAddFromServiceCheckBoxChanged) self.onSongAddFromServiceCheckBoxChanged)