wow_import implemented in to import wizard

bug fix in wizzard, so that it starts from the first page if used previously
bux fix in importer, so that it resets the defualts after commiting a song to the db
This commit is contained in:
Philip Ridout 2010-08-27 20:53:22 +01:00
parent 3645c9400e
commit 6b6da86c54
3 changed files with 14 additions and 8 deletions

View File

@ -160,7 +160,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
self.openSongAddButton.setFocus()
return False
elif source_format == SongFormat.WordsOfWorship:
if self.wordsOfWorshipListWidget.count() == 0:
if self.wordsOfWorshipFileListWidget.count() == 0:
QtGui.QMessageBox.critical(self,
translate('SongsPlugin.ImportWizardForm',
'No Words of Worship Files Selected'),
@ -315,6 +315,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
pass
def setDefaults(self):
self.restart()
self.formatComboBox.setCurrentIndex(0)
self.openLP2FilenameEdit.setText(u'')
self.openLP1FilenameEdit.setText(u'')

View File

@ -29,6 +29,7 @@ from olpimport import OpenLPSongImport
try:
from sofimport import SofImport
from oooimport import OooImport
from wowimport import WowImport
except ImportError:
pass
@ -63,6 +64,8 @@ class SongFormat(object):
return OpenSongImport
elif format == SongFormat.SongsOfFellowship:
return SofImport
elif format == SongFormat.WordsOfWorship:
return WowImport
elif format == SongFormat.Generic:
return OooImport
# else:

View File

@ -52,6 +52,13 @@ class SongImport(QtCore.QObject):
"""
self.manager = manager
self.stop_import_flag = False
self.copyright_string = unicode(translate(
'SongsPlugin.SongImport', 'copyright'))
self.copyright_symbol = unicode(translate(
'SongsPlugin.SongImport', '\xa9'))
self.setDefaults()
def setDefaults(self):
self.title = u''
self.song_number = u''
self.alternate_title = u''
@ -67,12 +74,6 @@ class SongImport(QtCore.QObject):
self.verses = []
self.versecount = 0
self.choruscount = 0
self.copyright_string = unicode(translate(
'SongsPlugin.SongImport', 'copyright'))
self.copyright_symbol = unicode(translate(
'SongsPlugin.SongImport', '\xa9'))
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'songs_stop_import'), self.stop_import)
def stop_import(self):
"""
@ -298,6 +299,7 @@ class SongImport(QtCore.QObject):
topic = Topic.populate(name=topictext)
song.topics.append(topic)
self.manager.save_object(song)
self.setDefaults()
def print_song(self):
"""