From 628d7dfefa7ac9091b338a34d61c751a0cb0faa8 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 22 Aug 2010 23:24:59 +0200 Subject: [PATCH 1/2] Resized SVG document to the same dimensions as the image it contains. --- resources/images/openlp-logo.svg | 50 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/resources/images/openlp-logo.svg b/resources/images/openlp-logo.svg index 81c1c3f8a..c5e7985e1 100644 --- a/resources/images/openlp-logo.svg +++ b/resources/images/openlp-logo.svg @@ -10,8 +10,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1052.3622" - height="744.09448" + width="467.39178" + height="467.39178" id="svg5740" sodipodi:version="0.32" inkscape:version="0.47 r22583" @@ -66,7 +66,8 @@ id="perspective5748" /> + id="filter6926" + color-interpolation-filters="sRGB"> - - - + style="display:inline" + transform="translate(-11.872025,-13.171852)" /> + style="display:inline" + transform="translate(-11.872025,-13.171852)" /> + style="display:inline" + transform="translate(-11.872025,-13.171852)" /> + style="display:inline" + transform="translate(-11.872025,-13.171852)" /> + style="display:inline" + transform="translate(-11.872025,-13.171852)"> @@ -322,14 +320,14 @@ sodipodi:cy="395.26932" sodipodi:cx="475.31134" id="path6903" - style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5.00028753;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline;filter:url(#filter6926)" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline;filter:url(#filter6926)" sodipodi:type="arc" /> + d="m 235.67972,13.233984 c -35.92776,0 -69.88078,8.488655 -99.97572,23.558433 L 296.72396,165.96674 452.81639,291.19091 c 4.32451,-17.35817 6.61754,-35.51197 6.61754,-54.20272 0,-123.50655 -100.24766,-223.754205 -223.75421,-223.754206 z M 79.118968,77.210299 C 71.146114,85.023824 63.764822,93.431949 57.026574,102.35694 L 274.63156,209.66285 434.20584,288.36064 275.3035,193.86221 79.118968,77.210299 z M 24.488653,162.95322 c -3.62786,10.33827 -6.504275,21.02069 -8.592618,31.98816 L 260.17479,255.29332 422.98657,295.52794 260.21551,241.36595 24.488653,162.95322 z M 13.513722,263.49906 c 1.305042,11.03747 3.397359,21.8274 6.251027,32.31395 l 228.539191,6.51573 173.46093,4.96824 L 253.55725,289.23619 13.513722,263.49906 z M 428.50457,317.76287 249.79034,336.84174 47.782384,358.40473 c 5.959201,9.19899 12.564704,17.94104 19.771165,26.14436 L 244.45559,351.80755 428.50457,317.76287 z m 13.78484,5.21258 -188.36565,62.18449 -133.00232,43.89972 c 33.5632,20.10936 72.81152,31.66237 114.75828,31.66238 93.04288,0 172.8858,-56.87905 206.60969,-137.74659 z" + style="fill:url(#linearGradient4055);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline" /> + d="m 235.67972,13.233984 c -35.92776,0 -69.88078,8.488655 -99.97572,23.558433 l 161.01996,129.174323 52.55342,42.16899 c 39.1477,-4.87501 74.57645,-12.22557 104.45528,-21.44082 C 430.89209,87.375898 341.89666,13.233985 235.67972,13.233984 z M 79.118968,77.210299 c -7.972854,7.813525 -15.354146,16.22165 -22.092394,25.146641 l 217.604986,107.30591 8.32792,4.11306 c 7.91353,-0.38016 15.72478,-0.85776 23.43626,-1.42532 L 275.3035,193.86221 79.118968,77.210299 z M 24.488653,162.95322 c -2.661786,7.58527 -4.921793,15.36128 -6.760069,23.29373 42.624133,13.3171 96.712956,22.78306 156.947626,26.67377 L 24.488653,162.95322 z" + style="fill:url(#linearGradient4057);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline" /> From ef44dc72c68fcd12244dc336bd33d53ef41098ca Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Mon, 23 Aug 2010 21:29:39 +0200 Subject: [PATCH 2/2] Changed the Generic importer to multifile as well. --- openlp/plugins/songs/forms/songimportform.py | 41 +++++++---- .../plugins/songs/forms/songimportwizard.py | 72 ++++++++----------- openlp/plugins/songs/lib/olpimport.py | 1 + 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index a4f1aedc0..e310a2509 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -97,9 +97,12 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): QtCore.QObject.connect(self.songsOfFellowshipRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongsOfFellowshipRemoveButtonClicked) - QtCore.QObject.connect(self.genericBrowseButton, + QtCore.QObject.connect(self.genericAddButton, QtCore.SIGNAL(u'clicked()'), - self.onGenericBrowseButtonClicked) + self.onGenericAddButtonClicked) + QtCore.QObject.connect(self.genericRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onGenericRemoveButtonClicked) QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL(u'clicked(bool)'), self.onCancelButtonClicked) @@ -185,24 +188,24 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): self.ccliAddButton.setFocus() return False elif source_format == SongFormat.SongsOfFellowship: - if self.songsOfFellowshipFilenameEdit.text().isEmpty(): + if self.songsOfFellowshipFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, translate('SongsPlugin.ImportWizardForm', 'No Songs of Fellowship File Selected'), translate('SongsPlugin.ImportWizardForm', - 'You need to select a Songs of Fellowship file to ' - 'import from.')) - self.songsOfFellowshipBrowseButton.setFocus() + 'You need to add at least one Songs of Fellowship ' + 'file to import from.')) + self.songsOfFellowshipAddButton.setFocus() return False elif source_format == SongFormat.Generic: - if self.genericFilenameEdit.text().isEmpty(): + if self.genericFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, translate('SongsPlugin.ImportWizardForm', 'No Document/Presentation Selected'), translate('SongsPlugin.ImportWizardForm', - 'You need to select a document/presentation file ' - 'to import from.')) - self.genericBrowseButton.setFocus() + 'You need to add at least one document or ' + 'presentation file to import from.')) + self.genericAddButton.setFocus() return False return True elif self.currentId() == 2: @@ -292,13 +295,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): def onSongsOfFellowshipRemoveButtonClicked(self): self.removeSelectedItems(self.songsOfFellowshipFileListWidget) - def onGenericBrowseButtonClicked(self): - self.getFileName( + def onGenericAddButtonClicked(self): + self.getFiles( translate('SongsPlugin.ImportWizardForm', - 'Select Document/Presentation File'), - self.genericFilenameEdit + 'Select Document/Presentation Files'), + self.genericFileListWidget ) + def onGenericRemoveButtonClicked(self): + self.removeSelectedItems(self.genericFileListWidget) + def onCancelButtonClicked(self, checked): """ Stop the import on pressing the cancel button. @@ -325,7 +331,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): self.wordsOfWorshipFileListWidget.clear() self.ccliFileListWidget.clear() self.songsOfFellowshipFileListWidget.clear() - self.genericFilenameEdit.setText(u'') + self.genericFileListWidget.clear() #self.csvFilenameEdit.setText(u'') def incrementProgressBar(self, status_text): @@ -386,6 +392,11 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): importer = self.plugin.importSongs(SongFormat.SongsOfFellowship, filenames=self.getListOfFiles(self.songsOfFellowshipFileListWidget) ) + elif source_format == SongFormat.Generic: + # Import a generic document or presentatoin + importer = self.plugin.importSongs(SongFormat.Generic, + filenames=self.getListOfFiles(self.genericFileListWidget) + ) success = importer.do_import() if success: # reload songs diff --git a/openlp/plugins/songs/forms/songimportwizard.py b/openlp/plugins/songs/forms/songimportwizard.py index 20de94721..f1898d107 100644 --- a/openlp/plugins/songs/forms/songimportwizard.py +++ b/openlp/plugins/songs/forms/songimportwizard.py @@ -291,46 +291,34 @@ class Ui_SongImportWizard(object): self.songsOfFellowshipRemoveButton.setObjectName(u'songsOfFellowshipRemoveButton') self.songsOfFellowshipButtonLayout.addWidget(self.songsOfFellowshipRemoveButton) self.songsOfFellowshipLayout.addLayout(self.songsOfFellowshipButtonLayout) -# self.songsOfFellowshipFilenameLabel = QtGui.QLabel(self.songsOfFellowshipPage) -# self.songsOfFellowshipFilenameLabel.setObjectName(u'songsOfFellowshipFilenameLabel') -# self.songsOfFellowshipLayout.setWidget(0, QtGui.QFormLayout.LabelRole, -# self.songsOfFellowshipFilenameLabel) -# self.songsOfFellowshipFileLayout = QtGui.QHBoxLayout() -# self.songsOfFellowshipFileLayout.setSpacing(8) -# self.songsOfFellowshipFileLayout.setObjectName(u'songsOfFellowshipFileLayout') -# self.songsOfFellowshipFilenameEdit = QtGui.QLineEdit(self.songsOfFellowshipPage) -# self.songsOfFellowshipFilenameEdit.setObjectName(u'songsOfFellowshipFilenameEdit') -# self.songsOfFellowshipFileLayout.addWidget(self.songsOfFellowshipFilenameEdit) -# self.songsOfFellowshipBrowseButton = QtGui.QToolButton(self.songsOfFellowshipPage) -# self.songsOfFellowshipBrowseButton.setIcon(openIcon) -# self.songsOfFellowshipBrowseButton.setObjectName(u'songsOfFellowshipBrowseButton') -# self.songsOfFellowshipFileLayout.addWidget(self.songsOfFellowshipBrowseButton) -# self.songsOfFellowshipLayout.setLayout(0, QtGui.QFormLayout.FieldRole, -# self.songsOfFellowshipFileLayout) self.formatStackedWidget.addWidget(self.songsOfFellowshipPage) # Generic Document/Presentation import self.genericPage = QtGui.QWidget() self.genericPage.setObjectName(u'genericPage') - self.genericLayout = QtGui.QFormLayout(self.genericPage) + self.genericLayout = QtGui.QVBoxLayout(self.genericPage) self.genericLayout.setMargin(0) self.genericLayout.setSpacing(8) self.genericLayout.setObjectName(u'genericLayout') - self.genericFilenameLabel = QtGui.QLabel(self.genericPage) - self.genericFilenameLabel.setObjectName(u'genericFilenameLabel') - self.genericLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.genericFilenameLabel) - self.genericFileLayout = QtGui.QHBoxLayout() - self.genericFileLayout.setSpacing(8) - self.genericFileLayout.setObjectName(u'genericFileLayout') - self.genericFilenameEdit = QtGui.QLineEdit(self.genericPage) - self.genericFilenameEdit.setObjectName(u'genericFilenameEdit') - self.genericFileLayout.addWidget(self.genericFilenameEdit) - self.genericBrowseButton = QtGui.QToolButton(self.genericPage) - self.genericBrowseButton.setIcon(openIcon) - self.genericBrowseButton.setObjectName(u'genericBrowseButton') - self.genericFileLayout.addWidget(self.genericBrowseButton) - self.genericLayout.setLayout(0, QtGui.QFormLayout.FieldRole, - self.genericFileLayout) + self.genericFileListWidget = QtGui.QListWidget(self.genericPage) + self.genericFileListWidget.setSelectionMode( + QtGui.QAbstractItemView.ExtendedSelection) + self.genericFileListWidget.setObjectName(u'genericFileListWidget') + self.genericLayout.addWidget(self.genericFileListWidget) + self.genericButtonLayout = QtGui.QHBoxLayout() + self.genericButtonLayout.setSpacing(8) + self.genericButtonLayout.setObjectName(u'genericButtonLayout') + self.genericAddButton = QtGui.QPushButton(self.genericPage) + self.genericAddButton.setIcon(openIcon) + self.genericAddButton.setObjectName(u'genericAddButton') + self.genericButtonLayout.addWidget(self.genericAddButton) + self.genericButtonSpacer = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.genericButtonLayout.addItem(self.genericButtonSpacer) + self.genericRemoveButton = QtGui.QPushButton(self.genericPage) + self.genericRemoveButton.setIcon(deleteIcon) + self.genericRemoveButton.setObjectName(u'genericRemoveButton') + self.genericButtonLayout.addWidget(self.genericRemoveButton) + self.genericLayout.addLayout(self.genericButtonLayout) self.formatStackedWidget.addWidget(self.genericPage) # Commented out for future use. # self.csvPage = QtGui.QWidget() @@ -382,18 +370,18 @@ class Ui_SongImportWizard(object): def retranslateUi(self, songImportWizard): songImportWizard.setWindowTitle( - translate('SongsPlugin.ImportWizardForm', 'Song import Wizard')) + translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) self.titleLabel.setText( u'%s' % \ translate('SongsPlugin.ImportWizardForm', - 'Welcome to the Song import Wizard')) + 'Welcome to the Song Import Wizard')) self.informationLabel.setText( translate('SongsPlugin.ImportWizardForm', '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.')) self.sourcePage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'Select import Source')) + translate('SongsPlugin.ImportWizardForm', 'Select Import Source')) self.sourcePage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Select the import format, and where to import from.')) @@ -410,7 +398,7 @@ class Ui_SongImportWizard(object): self.formatComboBox.setItemText(4, translate('SongsPlugin.ImportWizardForm', 'Words of Worship')) self.formatComboBox.setItemText(5, - translate('SongsPlugin.ImportWizardForm', 'CCLI')) + translate('SongsPlugin.ImportWizardForm', 'CCLI/SongSelect')) self.formatComboBox.setItemText(6, translate('SongsPlugin.ImportWizardForm', 'Songs of Fellowship')) self.formatComboBox.setItemText(7, @@ -446,16 +434,16 @@ class Ui_SongImportWizard(object): translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songsOfFellowshipRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) - self.genericFilenameLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.genericBrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.genericAddButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Add Files...')) + self.genericRemoveButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText( # translate('SongsPlugin.ImportWizardForm', 'Browse...')) self.importPage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'importing')) + translate('SongsPlugin.ImportWizardForm', 'Importing')) self.importPage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index 39dd01916..a4c15718e 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -85,6 +85,7 @@ class OpenLPSongImport(SongImport): ``source_db`` The database providing the data to import. """ + SongImport.__init__(self, master_manager) self.master_manager = master_manager self.import_source = u'sqlite:///%s' % kwargs[u'filename'] log.debug(self.import_source)