forked from openlp/openlp
Wizard works, though not functional.
This commit is contained in:
parent
031ef1530d
commit
20636bf655
@ -32,8 +32,8 @@ class Ui_BibleImportWizard(object):
|
||||
BibleImportWizard.setModal(True)
|
||||
BibleImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
||||
BibleImportWizard.setOptions(
|
||||
QtGui.QWizard.IndependentPages | \
|
||||
QtGui.QWizard.NoBackButtonOnStartPage | \
|
||||
QtGui.QWizard.IndependentPages |
|
||||
QtGui.QWizard.NoBackButtonOnStartPage |
|
||||
QtGui.QWizard.NoBackButtonOnLastPage)
|
||||
self.WelcomePage = QtGui.QWizardPage()
|
||||
self.WelcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap,
|
||||
@ -309,8 +309,8 @@ class Ui_BibleImportWizard(object):
|
||||
def retranslateUi(self, BibleImportWizard):
|
||||
BibleImportWizard.setWindowTitle(self.trUtf8('Bible Import Wizard'))
|
||||
self.TitleLabel.setText(
|
||||
u'<span style=\" font-size:14pt; font-weight:600;\">' + \
|
||||
self.trUtf8('Welcome to the Bible Import Wizard') + u'</span>')
|
||||
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
||||
self.trUtf8('Welcome to the Bible Import Wizard'))
|
||||
self.InformationLabel.setText(
|
||||
self.trUtf8('This wizard will help you to import Bibles from a '
|
||||
'variety of formats. Click the next button below to start the '
|
||||
|
@ -193,39 +193,41 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
# self.preImport()
|
||||
# self.performImport()
|
||||
# self.postImport()
|
||||
#
|
||||
# def registerFields(self):
|
||||
# self.SelectPage.registerField(
|
||||
|
||||
def registerFields(self):
|
||||
pass
|
||||
# self.SourcePage.registerField(
|
||||
# u'source_format', self.FormatComboBox)
|
||||
# self.SelectPage.registerField(
|
||||
# u'osis_location', self.OSISLocationEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# u'csv_booksfile', self.BooksLocationEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'openlyrics_filename', self.OpenLyricsFilenameEdit)
|
||||
# self.SourcePage.registerField(
|
||||
# u'openlyrics_directory', self.OpenLyricsDirectoryEdit)
|
||||
# self.SourcePage.registerField(
|
||||
# u'opensong_filename', self.OpenSongFilenameEdit)
|
||||
# self.SourcePage.registerField(
|
||||
# u'opensong_directory', self.OpenSongDirectoryEdit)
|
||||
# self.SourcePage.registerField(
|
||||
# u'csv_versefile', self.CsvVerseLocationEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'opensong_file', self.OpenSongFileEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'web_location', self.LocationComboBox)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'web_biblename', self.BibleComboBox)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'proxy_server', self.AddressEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'proxy_username', self.UsernameEdit)
|
||||
# self.SelectPage.registerField(
|
||||
# self.SourcePage.registerField(
|
||||
# u'proxy_password', self.PasswordEdit)
|
||||
# self.LicenseDetailsPage.registerField(
|
||||
# u'license_version', self.VersionNameEdit)
|
||||
# self.LicenseDetailsPage.registerField(
|
||||
# u'license_copyright', self.CopyrightEdit)
|
||||
# self.LicenseDetailsPage.registerField(
|
||||
# u'license_permission', self.PermissionEdit)
|
||||
#
|
||||
# def setDefaults(self):
|
||||
|
||||
def setDefaults(self):
|
||||
pass
|
||||
# self.setField(u'source_format', QtCore.QVariant(0))
|
||||
# self.setField(u'osis_location', QtCore.QVariant(''))
|
||||
# self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
||||
# self.setField(u'openlyrics_filename', QtCore.QVariant(''))
|
||||
# self.setField(u'openlyrics_directory', QtCore.QVariant(''))
|
||||
# self.setField(u'opensong_filename', QtCore.QVariant(''))
|
||||
# self.setField(u'opensong_directory', QtCore.QVariant(''))
|
||||
# self.setField(u'csv_versefile', QtCore.QVariant(''))
|
||||
# self.setField(u'opensong_file', QtCore.QVariant(''))
|
||||
# self.setField(u'web_location', QtCore.QVariant(WebDownload.Crosswalk))
|
||||
@ -241,7 +243,6 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
# self.setField(u'license_permission', QtCore.QVariant(self.PermissionEdit))
|
||||
# self.onLocationComboBoxChanged(WebDownload.Crosswalk)
|
||||
|
||||
|
||||
def getFileName(self, title, editbox):
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
||||
self.config.get_last_dir(1))
|
||||
|
@ -29,24 +29,20 @@ class Ui_SongImportWizard(object):
|
||||
def setupUi(self, SongImportWizard):
|
||||
SongImportWizard.setObjectName(u'SongImportWizard')
|
||||
SongImportWizard.resize(550, 386)
|
||||
SongImportWizard.setMinimumSize(QtCore.QSize(166, 386))
|
||||
SongImportWizard.setModal(True)
|
||||
SongImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
||||
SongImportWizard.setOptions(QtGui.QWizard.NoBackButtonOnLastPage |
|
||||
QtGui.QWizard.NoBackButtonOnStartPage)
|
||||
SongImportWizard.setOptions(
|
||||
QtGui.QWizard.IndependentPages |
|
||||
QtGui.QWizard.NoBackButtonOnStartPage |
|
||||
QtGui.QWizard.NoBackButtonOnLastPage)
|
||||
self.WelcomePage = QtGui.QWizardPage()
|
||||
self.WelcomePage.setObjectName(u'WelcomePage')
|
||||
self.WelcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap,
|
||||
QtGui.QPixmap(u':/wizards/wizard_importsong.bmp'))
|
||||
self.WelcomeLayout = QtGui.QHBoxLayout(self.WelcomePage)
|
||||
self.WelcomeLayout.setSpacing(8)
|
||||
self.WelcomeLayout.setMargin(0)
|
||||
self.WelcomeLayout.setObjectName(u'WelcomeLayout')
|
||||
self.ImportSongImage = QtGui.QLabel(self.WelcomePage)
|
||||
self.ImportSongImage.setMinimumSize(QtCore.QSize(163, 0))
|
||||
self.ImportSongImage.setMaximumSize(QtCore.QSize(163, 16777215))
|
||||
self.ImportSongImage.setPixmap(
|
||||
QtGui.QPixmap(u':/wizards/wizard_importsong.bmp'))
|
||||
self.ImportSongImage.setObjectName(u'ImportSongImage')
|
||||
self.WelcomeLayout.addWidget(self.ImportSongImage)
|
||||
self.WelcomeTextLayout = QtGui.QVBoxLayout()
|
||||
self.WelcomeTextLayout.setSpacing(8)
|
||||
self.WelcomeTextLayout.setObjectName(u'WelcomeTextLayout')
|
||||
@ -79,15 +75,18 @@ class Ui_SongImportWizard(object):
|
||||
self.FormatLabel.setObjectName(u'FormatLabel')
|
||||
self.FormatLayout.addWidget(self.FormatLabel)
|
||||
self.FormatComboBox = QtGui.QComboBox(self.SourcePage)
|
||||
sizePolicy = QtGui.QSizePolicy(
|
||||
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.FormatComboBox.sizePolicy().hasHeightForWidth())
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.FormatComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.FormatComboBox.setSizePolicy(sizePolicy)
|
||||
self.FormatComboBox.setObjectName(u'FormatComboBox')
|
||||
self.FormatComboBox.addItem(u'')
|
||||
self.FormatComboBox.addItem(u'')
|
||||
self.FormatComboBox.addItem(u'')
|
||||
self.FormatComboBox.addItem(u'')
|
||||
self.FormatLayout.addWidget(self.FormatComboBox)
|
||||
self.FormatSpacer = QtGui.QSpacerItem(40, 20,
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
@ -95,58 +94,108 @@ class Ui_SongImportWizard(object):
|
||||
self.SourceLayout.addLayout(self.FormatLayout)
|
||||
self.FormatStackedWidget = QtGui.QStackedWidget(self.SourcePage)
|
||||
self.FormatStackedWidget.setObjectName(u'FormatStackedWidget')
|
||||
self.OpenSongFilePage = QtGui.QWidget()
|
||||
self.OpenSongFilePage.setObjectName(u'OpenSongFilePage')
|
||||
self.OpenSongFileLayout = QtGui.QFormLayout(self.OpenSongFilePage)
|
||||
self.OpenSongFileLayout.setMargin(0)
|
||||
self.OpenSongFileLayout.setSpacing(8)
|
||||
self.OpenSongFileLayout.setObjectName(u'OpenSongFileLayout')
|
||||
self.OpenSongFileLabel = QtGui.QLabel(self.OpenSongFilePage)
|
||||
self.OpenSongFileLabel.setObjectName(u'OpenSongFileLabel')
|
||||
self.OpenSongFileLayout.setWidget(0,
|
||||
QtGui.QFormLayout.LabelRole, self.OpenSongFileLabel)
|
||||
self.OpenSongFilenameLayout = QtGui.QHBoxLayout()
|
||||
self.OpenSongFilenameLayout.setSpacing(8)
|
||||
self.OpenSongFilenameLayout.setObjectName(u'OpenSongFilenameLayout')
|
||||
self.OpenSongFilenameLineEdit = QtGui.QLineEdit(self.OpenSongFilePage)
|
||||
self.OpenSongFilenameLineEdit.setObjectName(u'OpenSongFilenameLineEdit')
|
||||
self.OpenSongFilenameLayout.addWidget(self.OpenSongFilenameLineEdit)
|
||||
self.OpenSongFilenameButton = QtGui.QToolButton(self.OpenSongFilePage)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(u':/imports/import_load.png'),
|
||||
self.OpenLyricsPage = QtGui.QWidget()
|
||||
self.OpenLyricsPage.setObjectName(u'OpenLyricsPage')
|
||||
self.OpenLyricsLayout = QtGui.QVBoxLayout(self.OpenLyricsPage)
|
||||
self.OpenLyricsLayout.setSpacing(8)
|
||||
self.OpenLyricsLayout.setMargin(0)
|
||||
self.OpenLyricsLayout.setObjectName(u'OpenLyricsLayout')
|
||||
self.OpenLyricsFileListWidget = QtGui.QListWidget(self.OpenLyricsPage)
|
||||
self.OpenLyricsFileListWidget.setObjectName(u'OpenLyricsFileListWidget')
|
||||
self.OpenLyricsLayout.addWidget(self.OpenLyricsFileListWidget)
|
||||
self.OpenLyricsButtonLayout = QtGui.QHBoxLayout()
|
||||
self.OpenLyricsButtonLayout.setSpacing(8)
|
||||
self.OpenLyricsButtonLayout.setObjectName(u'OpenLyricsButtonLayout')
|
||||
self.OpenLyricsAddButton = QtGui.QPushButton(self.OpenLyricsPage)
|
||||
self.OpenIcon = QtGui.QIcon()
|
||||
self.OpenIcon.addPixmap(QtGui.QPixmap(u':/general/general_open.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.OpenSongFilenameButton.setIcon(icon)
|
||||
self.OpenSongFilenameButton.setObjectName(u'OpenSongFilenameButton')
|
||||
self.OpenSongFilenameLayout.addWidget(self.OpenSongFilenameButton)
|
||||
self.OpenSongFileLayout.setLayout(0,
|
||||
QtGui.QFormLayout.FieldRole, self.OpenSongFilenameLayout)
|
||||
self.FormatStackedWidget.addWidget(self.OpenSongFilePage)
|
||||
self.OpenSongDirectoryPage = QtGui.QWidget()
|
||||
self.OpenSongDirectoryPage.setObjectName(u'OpenSongDirectoryPage')
|
||||
self.OpenSongDirectoryLayout = QtGui.QFormLayout(self.OpenSongDirectoryPage)
|
||||
self.OpenSongDirectoryLayout.setMargin(0)
|
||||
self.OpenSongDirectoryLayout.setSpacing(8)
|
||||
self.OpenSongDirectoryLayout.setObjectName(u'OpenSongDirectoryLayout')
|
||||
self.OpenSongDirectoryLabel = QtGui.QLabel(self.OpenSongDirectoryPage)
|
||||
self.OpenSongDirectoryLabel.setObjectName(u'OpenSongDirectoryLabel')
|
||||
self.OpenSongDirectoryLayout.setWidget(0,
|
||||
QtGui.QFormLayout.LabelRole, self.OpenSongDirectoryLabel)
|
||||
self.OpenSongDirLayout = QtGui.QHBoxLayout()
|
||||
self.OpenSongDirLayout.setSpacing(8)
|
||||
self.OpenSongDirLayout.setObjectName(u'OpenSongDirLayout')
|
||||
self.OpenSongDirectoryLineEdit = QtGui.QLineEdit(self.OpenSongDirectoryPage)
|
||||
self.OpenSongDirectoryLineEdit.setObjectName(u'OpenSongDirectoryLineEdit')
|
||||
self.OpenSongDirLayout.addWidget(self.OpenSongDirectoryLineEdit)
|
||||
self.OpenSongDirectoryButton = QtGui.QToolButton(self.OpenSongDirectoryPage)
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'),
|
||||
self.DeleteIcon = QtGui.QIcon()
|
||||
self.DeleteIcon.addPixmap(QtGui.QPixmap(u':/general/general_delete.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.OpenSongDirectoryButton.setIcon(icon1)
|
||||
self.OpenSongDirectoryButton.setObjectName(u'OpenSongDirectoryButton')
|
||||
self.OpenSongDirLayout.addWidget(self.OpenSongDirectoryButton)
|
||||
self.OpenSongDirectoryLayout.setLayout(0,
|
||||
QtGui.QFormLayout.FieldRole, self.OpenSongDirLayout)
|
||||
self.FormatStackedWidget.addWidget(self.OpenSongDirectoryPage)
|
||||
self.OpenLyricsAddButton.setIcon(self.OpenIcon)
|
||||
self.OpenLyricsAddButton.setObjectName(u'OpenLyricsAddButton')
|
||||
self.OpenLyricsButtonLayout.addWidget(self.OpenLyricsAddButton)
|
||||
self.OpenLyricsButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.OpenLyricsButtonLayout.addItem(self.OpenLyricsButtonSpacer)
|
||||
self.OpenLyricsRemoveButton = QtGui.QPushButton(self.OpenLyricsPage)
|
||||
self.OpenLyricsRemoveButton.setIcon(self.DeleteIcon)
|
||||
self.OpenLyricsRemoveButton.setObjectName(u'OpenLyricsRemoveButton')
|
||||
self.OpenLyricsButtonLayout.addWidget(self.OpenLyricsRemoveButton)
|
||||
self.OpenLyricsLayout.addLayout(self.OpenLyricsButtonLayout)
|
||||
self.FormatStackedWidget.addWidget(self.OpenLyricsPage)
|
||||
self.OpenSongPage = QtGui.QWidget()
|
||||
self.OpenSongPage.setObjectName(u'OpenSongPage')
|
||||
self.OpenSongLayout = QtGui.QVBoxLayout(self.OpenSongPage)
|
||||
self.OpenSongLayout.setSpacing(8)
|
||||
self.OpenSongLayout.setMargin(0)
|
||||
self.OpenSongLayout.setObjectName(u'OpenSongLayout')
|
||||
self.OpenSongFileListWidget = QtGui.QListWidget(self.OpenSongPage)
|
||||
self.OpenSongFileListWidget.setObjectName(u'OpenSongFileListWidget')
|
||||
self.OpenSongLayout.addWidget(self.OpenSongFileListWidget)
|
||||
self.OpenSongButtonLayout = QtGui.QHBoxLayout()
|
||||
self.OpenSongButtonLayout.setSpacing(8)
|
||||
self.OpenSongButtonLayout.setObjectName(u'OpenSongButtonLayout')
|
||||
self.OpenSongAddButton = QtGui.QPushButton(self.OpenSongPage)
|
||||
self.OpenSongAddButton.setIcon(self.OpenIcon)
|
||||
self.OpenSongAddButton.setObjectName(u'OpenSongAddButton')
|
||||
self.OpenSongButtonLayout.addWidget(self.OpenSongAddButton)
|
||||
self.OpenSongButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.OpenSongButtonLayout.addItem(self.OpenSongButtonSpacer)
|
||||
self.OpenSongRemoveButton = QtGui.QPushButton(self.OpenSongPage)
|
||||
self.OpenSongRemoveButton.setIcon(self.DeleteIcon)
|
||||
self.OpenSongRemoveButton.setObjectName(u'OpenSongRemoveButton')
|
||||
self.OpenSongButtonLayout.addWidget(self.OpenSongRemoveButton)
|
||||
self.OpenSongLayout.addLayout(self.OpenSongButtonLayout)
|
||||
self.FormatStackedWidget.addWidget(self.OpenSongPage)
|
||||
self.CCLIPage = QtGui.QWidget()
|
||||
self.CCLIPage.setObjectName(u'CCLIPage')
|
||||
self.CCLILayout = QtGui.QVBoxLayout(self.CCLIPage)
|
||||
self.CCLILayout.setSpacing(8)
|
||||
self.CCLILayout.setMargin(0)
|
||||
self.CCLILayout.setObjectName(u'CCLILayout')
|
||||
self.CCLIFileListWidget = QtGui.QListWidget(self.CCLIPage)
|
||||
self.CCLIFileListWidget.setObjectName(u'CCLIFileListWidget')
|
||||
self.CCLILayout.addWidget(self.CCLIFileListWidget)
|
||||
self.CCLIButtonLayout = QtGui.QHBoxLayout()
|
||||
self.CCLIButtonLayout.setSpacing(8)
|
||||
self.CCLIButtonLayout.setObjectName(u'CCLIButtonLayout')
|
||||
self.CCLIAddButton = QtGui.QPushButton(self.CCLIPage)
|
||||
self.CCLIAddButton.setIcon(self.OpenIcon)
|
||||
self.CCLIAddButton.setObjectName(u'CCLIAddButton')
|
||||
self.CCLIButtonLayout.addWidget(self.CCLIAddButton)
|
||||
self.CCLIButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.CCLIButtonLayout.addItem(self.CCLIButtonSpacer)
|
||||
self.CCLIRemoveButton = QtGui.QPushButton(self.CCLIPage)
|
||||
self.CCLIRemoveButton.setIcon(self.DeleteIcon)
|
||||
self.CCLIRemoveButton.setObjectName(u'CCLIRemoveButton')
|
||||
self.CCLIButtonLayout.addWidget(self.CCLIRemoveButton)
|
||||
self.CCLILayout.addLayout(self.CCLIButtonLayout)
|
||||
self.FormatStackedWidget.addWidget(self.CCLIPage)
|
||||
self.CSVPage = QtGui.QWidget()
|
||||
self.CSVPage.setObjectName(u'CSVPage')
|
||||
self.CSVLayout = QtGui.QFormLayout(self.CSVPage)
|
||||
self.CSVLayout.setMargin(0)
|
||||
self.CSVLayout.setSpacing(8)
|
||||
self.CSVLayout.setObjectName(u'CSVLayout')
|
||||
self.CSVFilenameLabel = QtGui.QLabel(self.CSVPage)
|
||||
self.CSVFilenameLabel.setObjectName(u'CSVFilenameLabel')
|
||||
self.CSVLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.CSVFilenameLabel)
|
||||
self.CSVFileLayout = QtGui.QHBoxLayout()
|
||||
self.CSVFileLayout.setSpacing(8)
|
||||
self.CSVFileLayout.setObjectName(u'CSVFileLayout')
|
||||
self.CSVFilenameEdit = QtGui.QLineEdit(self.CSVPage)
|
||||
self.CSVFilenameEdit.setObjectName(u'CSVFilenameEdit')
|
||||
self.CSVFileLayout.addWidget(self.CSVFilenameEdit)
|
||||
self.CSVBrowseButton = QtGui.QToolButton(self.CSVPage)
|
||||
self.CSVBrowseButton.setIcon(self.OpenIcon)
|
||||
self.CSVBrowseButton.setObjectName(u'CSVBrowseButton')
|
||||
self.CSVFileLayout.addWidget(self.CSVBrowseButton)
|
||||
self.CSVLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.CSVFileLayout)
|
||||
self.FormatStackedWidget.addWidget(self.CSVPage)
|
||||
self.SourceLayout.addWidget(self.FormatStackedWidget)
|
||||
SongImportWizard.addPage(self.SourcePage)
|
||||
self.ImportPage = QtGui.QWizardPage()
|
||||
@ -164,7 +213,6 @@ class Ui_SongImportWizard(object):
|
||||
self.ImportProgressBar.setObjectName(u'ImportProgressBar')
|
||||
self.ImportLayout.addWidget(self.ImportProgressBar)
|
||||
SongImportWizard.addPage(self.ImportPage)
|
||||
self.OpenSongFileLabel.setBuddy(self.OpenSongFilenameLineEdit)
|
||||
|
||||
self.retranslateUi(SongImportWizard)
|
||||
self.FormatStackedWidget.setCurrentIndex(0)
|
||||
@ -177,23 +225,9 @@ class Ui_SongImportWizard(object):
|
||||
|
||||
def retranslateUi(self, SongImportWizard):
|
||||
SongImportWizard.setWindowTitle(self.trUtf8('Song Import Wizard'))
|
||||
self.TitleLabel.setText(self.trUtf8(
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \n'
|
||||
' "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
|
||||
'<html>\n'
|
||||
' <head>\n'
|
||||
' <meta name="qrichtext" content="1" />\n'
|
||||
' <style type="text/css">p, li { white-space: pre-wrap; }</style>\n'
|
||||
' </head>\n'
|
||||
' <body style="font-family: Lucida Grande; font-size:10pt; font-weight:400; font-style:normal;">\n'
|
||||
' <p style="margin: 0; -qt-block-indent:0; text-indent:0px;">\n'
|
||||
' <span style="font-size:14pt; font-weight:600;">\n'
|
||||
' Welcome to the Song Import Wizard\n'
|
||||
' </span>\n'
|
||||
' </p>\n'
|
||||
' </body>\n'
|
||||
'</html>'
|
||||
))
|
||||
self.TitleLabel.setText(
|
||||
'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
||||
self.trUtf8('Welcome to the Song Import Wizard'))
|
||||
self.InformationLabel.setText(self.trUtf8('This wizard will help you '
|
||||
'to import songs from a variety of formats. Click the next button '
|
||||
'below to start the process by selecting a format to import from.'))
|
||||
@ -201,10 +235,18 @@ class Ui_SongImportWizard(object):
|
||||
self.SourcePage.setSubTitle(self.trUtf8('Select the import format, '
|
||||
'and where to import from.'))
|
||||
self.FormatLabel.setText(self.trUtf8('Format:'))
|
||||
self.FormatComboBox.setItemText(0, self.trUtf8('OpenSong (Single File)'))
|
||||
self.FormatComboBox.setItemText(1, self.trUtf8('OpenSong (Directory of Files)'))
|
||||
self.OpenSongFileLabel.setText(self.trUtf8('Filename:'))
|
||||
self.OpenSongDirectoryLabel.setText(self.trUtf8('Directory:'))
|
||||
self.FormatComboBox.setItemText(0, self.trUtf8('OpenLyrics'))
|
||||
self.FormatComboBox.setItemText(1, self.trUtf8('OpenSong'))
|
||||
self.FormatComboBox.setItemText(2, self.trUtf8('CCLI'))
|
||||
self.FormatComboBox.setItemText(3, self.trUtf8('CSV'))
|
||||
self.OpenLyricsAddButton.setText(self.trUtf8('Add Files...'))
|
||||
self.OpenLyricsRemoveButton.setText(self.trUtf8('Remove File(s)'))
|
||||
self.OpenSongAddButton.setText(self.trUtf8('Add Files...'))
|
||||
self.OpenSongRemoveButton.setText(self.trUtf8('Remove File(s)'))
|
||||
self.CCLIAddButton.setText(self.trUtf8('Add Files...'))
|
||||
self.CCLIRemoveButton.setText(self.trUtf8('Remove File(s)'))
|
||||
self.CSVFilenameLabel.setText(self.trUtf8('Filename:'))
|
||||
self.CSVBrowseButton.setText(self.trUtf8('Browse...'))
|
||||
self.ImportPage.setTitle(self.trUtf8('Importing'))
|
||||
self.ImportPage.setSubTitle(self.trUtf8('Please wait while your songs '
|
||||
'are imported.'))
|
||||
|
@ -30,7 +30,51 @@ from openlp.plugins.songs.lib.models import init_models, metadata, Song, \
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class SongManager():
|
||||
class SongFormat(object):
|
||||
"""
|
||||
This is a special enumeration class that holds the various types of songs,
|
||||
plus a few helper functions to facilitate generic handling of song types
|
||||
for importing.
|
||||
"""
|
||||
Unknown = -1
|
||||
OpenLyrics = 0
|
||||
OpenSongFile = 1
|
||||
OpenSongDirectory = 2
|
||||
CSV = 3
|
||||
|
||||
@staticmethod
|
||||
def get_class(id):
|
||||
"""
|
||||
Return the appropriate imeplementation class.
|
||||
|
||||
``id``
|
||||
The Bible format.
|
||||
"""
|
||||
if id == BibleFormat.OSIS:
|
||||
return OSISBible
|
||||
elif id == BibleFormat.CSV:
|
||||
return CSVBible
|
||||
elif id == BibleFormat.OpenSong:
|
||||
return OpenSongBible
|
||||
elif id == BibleFormat.WebDownload:
|
||||
return HTTPBible
|
||||
else:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def list():
|
||||
"""
|
||||
Return a list of the supported Bible formats.
|
||||
"""
|
||||
return [
|
||||
BibleFormat.OSIS,
|
||||
BibleFormat.CSV,
|
||||
BibleFormat.OpenSong,
|
||||
BibleFormat.WebDownload
|
||||
]
|
||||
|
||||
|
||||
class SongManager(object):
|
||||
"""
|
||||
The Song Manager provides a central location for all database code. This
|
||||
class takes care of connecting to the database and running all the queries.
|
||||
|
@ -156,12 +156,22 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OpenSong (Single File)</string>
|
||||
<string>OpenLyrics</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>OpenSong (Directory of Files)</string>
|
||||
<string>OpenSong</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>CCLI</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>CSV</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
@ -184,45 +194,56 @@ p, li { white-space: pre-wrap; }
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="FormatStackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="OpenSongFilePage">
|
||||
<layout class="QFormLayout" name="OpenSongFileLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<widget class="QWidget" name="OpenLyricsPage">
|
||||
<layout class="QVBoxLayout" name="OpenLyricsLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="OpenSongFileLabel">
|
||||
<property name="text">
|
||||
<string>Filename:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>OpenSongFilenameLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QListWidget" name="OpenLyricsFileListWidget"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="OpenSongFilenameLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="OpenLyricsButtonLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="OpenSongFilenameLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="OpenSongFilenameButton">
|
||||
<widget class="QPushButton" name="OpenLyricsAddButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Add Files...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/imports/import_load.png</normaloff>:/imports/import_load.png</iconset>
|
||||
<normaloff>:/general/general_open.png</normaloff>:/general/general_open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="OpenLyricsButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="OpenLyricsRemoveButton">
|
||||
<property name="text">
|
||||
<string>Remove File(s)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/general/general_delete.png</normaloff>:/general/general_delete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -230,8 +251,118 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="OpenSongDirectoryPage">
|
||||
<layout class="QFormLayout" name="OpenSongDirectoryLayout">
|
||||
<widget class="QWidget" name="OpenSongPage">
|
||||
<layout class="QVBoxLayout" name="OpenSongLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListWidget" name="OpenSongFileListWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="OpenSongButtonLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="OpenSongAddButton">
|
||||
<property name="text">
|
||||
<string>Add Files...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/general/general_open.png</normaloff>:/general/general_open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="OpenSongButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="OpenSongRemoveButton">
|
||||
<property name="text">
|
||||
<string>Remove File(s)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/general/general_delete.png</normaloff>:/general/general_delete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="CCLIPage">
|
||||
<layout class="QVBoxLayout" name="CCLILayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListWidget" name="CCLIFileListWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="CCLIButtonLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="CCLIAddButton">
|
||||
<property name="text">
|
||||
<string>Add Files...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/general/general_open.png</normaloff>:/general/general_open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="CCLIButtonSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="CCLIRemoveButton">
|
||||
<property name="text">
|
||||
<string>Remove File(s)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/general/general_delete.png</normaloff>:/general/general_delete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="CSVPage">
|
||||
<layout class="QFormLayout" name="CSVLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
@ -242,28 +373,28 @@ p, li { white-space: pre-wrap; }
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="OpenSongDirectoryLabel">
|
||||
<widget class="QLabel" name="CSVFilenameLabel">
|
||||
<property name="text">
|
||||
<string>Directory:</string>
|
||||
<string>Filename:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="OpenSongDirLayout">
|
||||
<layout class="QHBoxLayout" name="CSVFileLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="OpenSongDirectoryLineEdit"/>
|
||||
<widget class="QLineEdit" name="CSVFilenameEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="OpenSongDirectoryButton">
|
||||
<widget class="QToolButton" name="CSVBrowseButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images/openlp-2.qrc">
|
||||
<normaloff>:/exports/export_load.png</normaloff>:/exports/export_load.png</iconset>
|
||||
<normaloff>:/general/general_open.png</normaloff>:/general/general_open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user