From 47936e34a74c2afbc5311cb258c53bed40a2688f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 3 Jun 2011 17:57:56 +0200 Subject: [PATCH 01/13] improved thumbnail creation speed --- openlp/core/lib/mediamanageritem.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 31890a252..0f6c24829 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -391,21 +391,23 @@ class MediaManagerItem(QtGui.QWidget): self.iconFromFile(image, thumb) return True - def iconFromFile(self, image, thumb): + def iconFromFile(self, image_path, thumb_path): """ Create a thumbnail icon from a given image. - ``image`` + ``image_path`` The image file to create the icon from. - ``thumb`` - The filename to save the thumbnail to + ``thumb_path`` + The filename to save the thumbnail to. """ - icon = build_icon(unicode(image)) - pixmap = icon.pixmap(QtCore.QSize(88, 50)) - ext = os.path.splitext(thumb)[1].lower() - pixmap.save(thumb, ext[1:]) - return icon + ext = os.path.splitext(thumb_path)[1].lower() + reader = QtGui.QImageReader(image_path) + reader.setScaledSize(QtCore.QSize( + reader.size().width() / reader.size().height() * 88, 88)) + thumb = reader.read() + thumb.save(thumb_path, ext[1:]) + return build_icon(unicode(thumb_path)) def loadList(self, list): raise NotImplementedError(u'MediaManagerItem.loadList needs to be ' From e08c65aa45ee047074bae86726711017ed33ea8d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 5 Jun 2011 18:33:28 +0200 Subject: [PATCH 02/13] fixed ratio --- openlp/core/lib/mediamanageritem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 0f6c24829..954179288 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -403,8 +403,8 @@ class MediaManagerItem(QtGui.QWidget): """ ext = os.path.splitext(thumb_path)[1].lower() reader = QtGui.QImageReader(image_path) - reader.setScaledSize(QtCore.QSize( - reader.size().width() / reader.size().height() * 88, 88)) + ratio = float(reader.size().width()) / float(reader.size().height()) + reader.setScaledSize(QtCore.QSize(int(ratio * 88), 88)) thumb = reader.read() thumb.save(thumb_path, ext[1:]) return build_icon(unicode(thumb_path)) From 98e731ee9a340040ac6230779ce72d501a19ed34 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 6 Jun 2011 09:05:10 +0200 Subject: [PATCH 03/13] fallback if thumb was not created --- openlp/core/lib/mediamanageritem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 954179288..9aa159981 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -407,7 +407,11 @@ class MediaManagerItem(QtGui.QWidget): reader.setScaledSize(QtCore.QSize(int(ratio * 88), 88)) thumb = reader.read() thumb.save(thumb_path, ext[1:]) - return build_icon(unicode(thumb_path)) + if os.path.exists(thumb_path): + return build_icon(unicode(thumb_path)) + # When the thumbnail creation was not successful then create the icon + # from the original file. + return build_icon(unicode(image_path)) def loadList(self, list): raise NotImplementedError(u'MediaManagerItem.loadList needs to be ' From 5d9e6acfbf1aa916bfc9ea7e606d3e0ddd5fa03a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 6 Jun 2011 16:58:14 +0200 Subject: [PATCH 04/13] better comment --- openlp/core/lib/mediamanageritem.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 9aa159981..cfd4948cb 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -409,8 +409,7 @@ class MediaManagerItem(QtGui.QWidget): thumb.save(thumb_path, ext[1:]) if os.path.exists(thumb_path): return build_icon(unicode(thumb_path)) - # When the thumbnail creation was not successful then create the icon - # from the original file. + # Fallback for files with animation support. return build_icon(unicode(image_path)) def loadList(self, list): From f263dfa0c88d566606db227c70193d9787241836 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 7 Jun 2011 09:30:50 +0200 Subject: [PATCH 05/13] --- openlp/core/lib/__init__.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 2d3e55355..d335fc244 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -137,13 +137,12 @@ def image_to_byte(image): # convert to base64 encoding so does not get missed! return byte_array.toBase64() -def resize_image(image, width, height, background=QtCore.Qt.black): +def resize_image(image_path, width, height, background=QtCore.Qt.black): """ Resize an image to fit on the current screen. - ``image`` - The image to resize. It has to be either a ``QImage`` instance or the - path to the image. + ``image_path`` + The path to the image to resize. ``width`` The new image width. @@ -155,16 +154,27 @@ def resize_image(image, width, height, background=QtCore.Qt.black): The background colour defaults to black. """ log.debug(u'resize_image - start') - if isinstance(image, QtGui.QImage): - preview = image + if isinstance(image_path, QtGui.QImage): + print u'wrong instance!' else: - preview = QtGui.QImage(image) - if not preview.isNull(): - # Only resize if different size - if preview.width() == width and preview.height == height: - return preview - preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, - QtCore.Qt.SmoothTransformation) + reader = QtGui.QImageReader(image_path) + # The image's ratio. + image_ratio = float(reader.size().width()) / float(reader.size().height()) + resize_ratio = float(width) / float(height) + # Figure out the size we want to resize the image to (keep aspect ratio). + if image_ratio == resize_ratio: + size = QtCore.QSize(width, height) + elif image_ratio < resize_ratio: + # Use the image's height as reference for the new size. + size = QtCore.QSize(image_ratio * height, height) + else: + # Use the image's width as reference for the new size. + size = QtCore.QSize(width, 1 / (image_ratio / width)) + reader.setScaledSize(size) + preview = reader.read() + if image_ratio == resize_ratio: + # We neither need to centre the image nor add "bars" to the image. + return preview realw = preview.width() realh = preview.height() # and move it to the centre of the preview space From 56783d8a4126f1094effba061855c6bea8a2d692 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 8 Jun 2011 21:03:32 +0100 Subject: [PATCH 06/13] Fix Bible error message if search from remote --- openlp/plugins/bibles/lib/mediaitem.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index d94368f52..f2b9a57d3 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -683,17 +683,17 @@ class BibleMediaItem(MediaManagerItem): verse.book.book_reference_id) if not db_book: log.debug(u'Passage "%s %d:%d" not found in Second ' - u'Bible' % (verse.book.name, verse.chapter, + u'Bible' % (verse.book.name, verse.chapter, verse.verse)) passage_not_found = True count += 1 continue new_search_results.append(verse) - text.append((verse.book.book_reference_id, verse.chapter, + text.append((verse.book.book_reference_id, verse.chapter, verse.verse, verse.verse)) if passage_not_found: - QtGui.QMessageBox.information(self, - translate('BiblePlugin.MediaItem', 'Information'), + QtGui.QMessageBox.information(self, + translate('BiblePlugin.MediaItem', 'Information'), unicode(translate('BiblePlugin.MediaItem', 'The second Bibles does not contain all the verses ' 'that are in the main Bible. Only verses found in both ' @@ -983,7 +983,7 @@ class BibleMediaItem(MediaManagerItem): Search for some Bible verses (by reference). """ bible = unicode(self.quickVersionComboBox.currentText()) - search_results = self.plugin.manager.get_verses(bible, string, False) + search_results = self.plugin.manager.get_verses(bible, string, False, False) results = [] if search_results: versetext = u' '.join([verse.text for verse in search_results]) From 7cdd9b2fbc26b41af6d217dd8dc0d4d4e3e72d1e Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 8 Jun 2011 22:39:07 +0100 Subject: [PATCH 07/13] Close and delete old display window when creating a new one --- openlp/core/lib/renderer.py | 2 ++ openlp/core/ui/maindisplay.py | 1 + openlp/core/ui/servicemanager.py | 1 + openlp/core/ui/slidecontroller.py | 3 +++ 4 files changed, 7 insertions(+) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 250991d2a..f9af00f6e 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -86,6 +86,8 @@ class Renderer(object): """ log.debug(u'Update Display') self._calculate_default(self.screens.current[u'size']) + if self.display: + self.display.close() self.display = MainDisplay(None, self.image_manager, False) self.display.setup() self.bg_frame = None diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index e2117cc10..0db8bb26f 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -63,6 +63,7 @@ class MainDisplay(QtGui.QGraphicsView): self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;') self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint) + self.setAttribute(QtCore.Qt.WA_DeleteOnClose) if self.isLive: QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 8ecd89bc7..8a018d915 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1035,6 +1035,7 @@ class ServiceManager(QtGui.QWidget): item[u'selected'] = False serviceIterator = QtGui.QTreeWidgetItemIterator( self.serviceManagerList) + selectedItem = None while serviceIterator.value(): if serviceIterator.value().isSelected(): selectedItem = serviceIterator.value() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 5b6212cf8..d490f3bce 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -59,6 +59,7 @@ class SlideController(QtGui.QWidget): """ QtGui.QWidget.__init__(self, parent) self.isLive = isLive + self.display = None self.screens = ScreenList.get_instance() self.ratio = float(self.screens.current[u'size'].width()) / \ float(self.screens.current[u'size'].height()) @@ -422,6 +423,8 @@ class SlideController(QtGui.QWidget): screen previews. """ # rebuild display as screen size changed + if self.display: + self.display.close() self.display = MainDisplay(self, self.image_manager, self.isLive) self.display.alertTab = self.alertTab self.display.setup() From 8fc4305b43cb5822161bcbc616eb08b9468d801d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 9 Jun 2011 12:41:02 +0200 Subject: [PATCH 08/13] removed test lines --- openlp/core/lib/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index d335fc244..75bafc5e8 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -154,10 +154,7 @@ def resize_image(image_path, width, height, background=QtCore.Qt.black): The background colour defaults to black. """ log.debug(u'resize_image - start') - if isinstance(image_path, QtGui.QImage): - print u'wrong instance!' - else: - reader = QtGui.QImageReader(image_path) + reader = QtGui.QImageReader(image_path) # The image's ratio. image_ratio = float(reader.size().width()) / float(reader.size().height()) resize_ratio = float(width) / float(height) From c298146b1f8a51974ab7333b337487d2f9d83750 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 9 Jun 2011 17:14:41 +0200 Subject: [PATCH 09/13] give the title edit focus when creating a new customs --- openlp/plugins/custom/forms/editcustomform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 4a7585f11..32a2a3146 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -93,6 +93,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): self.titleEdit.setText(u'') self.creditEdit.setText(u'') self.themeComboBox.setCurrentIndex(0) + self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason) else: self.customSlide = self.manager.get_object(CustomSlide, id) self.titleEdit.setText(self.customSlide.title) From 1bdfd60d520a2926552adef36de37ce98c8173ab Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Thu, 9 Jun 2011 11:26:13 -0400 Subject: [PATCH 10/13] Skip old-database's during bible loading --- openlp/plugins/bibles/lib/manager.py | 55 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 2a3858afc..74e3cb11e 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -147,33 +147,34 @@ class BibleManager(object): self.db_cache = {} self.old_bible_databases = [] for filename in files: - bible = BibleDB(self.parent, path=self.path, file=filename) - name = bible.get_name() - # Remove corrupted files. - if name is None: - delete_file(os.path.join(self.path, filename)) - continue - # Find old database versions - if bible.is_old_database(): - self.old_bible_databases.append([filename, name]) - bible.session.close() - continue - log.debug(u'Bible Name: "%s"', name) - self.db_cache[name] = bible - # Look to see if lazy load bible exists and get create getter. - source = self.db_cache[name].get_object(BibleMeta, - u'download source') - if source: - download_name = self.db_cache[name].get_object(BibleMeta, - u'download name').value - meta_proxy = self.db_cache[name].get_object(BibleMeta, - u'proxy url') - web_bible = HTTPBible(self.parent, path=self.path, - file=filename, download_source=source.value, - download_name=download_name) - if meta_proxy: - web_bible.proxy_server = meta_proxy.value - self.db_cache[name] = web_bible + if not filename.startswith(u'old_database_'): + bible = BibleDB(self.parent, path=self.path, file=filename) + name = bible.get_name() + # Remove corrupted files. + if name is None: + delete_file(os.path.join(self.path, filename)) + continue + # Find old database versions + if bible.is_old_database(): + self.old_bible_databases.append([filename, name]) + bible.session.close() + continue + log.debug(u'Bible Name: "%s"', name) + self.db_cache[name] = bible + # Look to see if lazy load bible exists and get create getter. + source = self.db_cache[name].get_object(BibleMeta, + u'download source') + if source: + download_name = self.db_cache[name].get_object(BibleMeta, + u'download name').value + meta_proxy = self.db_cache[name].get_object(BibleMeta, + u'proxy url') + web_bible = HTTPBible(self.parent, path=self.path, + file=filename, download_source=source.value, + download_name=download_name) + if meta_proxy: + web_bible.proxy_server = meta_proxy.value + self.db_cache[name] = web_bible log.debug(u'Bibles reloaded') def set_process_dialog(self, wizard): From 729f38f1583c0ff2ba70099720d84894104afd93 Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Thu, 9 Jun 2011 17:17:04 -0400 Subject: [PATCH 11/13] Added code to close the oldBibleDB so it can be deleted after conversion --- openlp/plugins/bibles/forms/bibleupgradeform.py | 1 + openlp/plugins/bibles/lib/db.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index 7913aac31..6d86851a0 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -732,6 +732,7 @@ class BibleUpgradeForm(OpenLPWizard): self.newbibles[number].session.commit() if not bible_failed: self.newbibles[number].create_meta(u'Version', name) + oldbible.close_connection() delete_file(os.path.join(self.path, filename[0])) self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 41dc947f9..49488be0e 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -1101,3 +1101,7 @@ class OldBibleDB(QtCore.QObject, Manager): ] else: return None + + def close_connection(self): + self.cursor.close() + self.connection.close() From dfd2468c4c95f585636d9a8cbf5b03dbbea58f94 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 9 Jun 2011 23:03:30 +0100 Subject: [PATCH 12/13] String fixes --- openlp/core/lib/ui.py | 10 +++----- openlp/core/ui/firsttimeform.py | 38 ++++++++++++++++++++-------- openlp/core/ui/firsttimewizard.py | 4 --- openlp/core/ui/mainwindow.py | 4 +-- openlp/core/ui/printservicedialog.py | 4 +-- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 5055bb619..13c421708 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -85,7 +85,6 @@ class UiStrings(object): self.LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) self.Live = translate('OpenLP.Ui', 'Live') self.LiveBGError = translate('OpenLP.Ui', 'Live Background Error') - self.LivePanel = translate('OpenLP.Ui', 'Live Panel') self.LiveToolbar = translate('OpenLP.Ui', 'Live Toolbar') self.Load = translate('OpenLP.Ui', 'Load') self.Minutes = translate('OpenLP.Ui', 'm', @@ -102,14 +101,13 @@ class UiStrings(object): self.OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. ' 'Do you wish to continue?') - self.OpenService = translate('OpenLP.Ui', 'Open Service') + self.OpenService = translate('OpenLP.Ui', 'Open service.') self.Preview = translate('OpenLP.Ui', 'Preview') - self.PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') - self.PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order') + self.PrintService = translate('OpenLP.Ui', 'Print Service') self.ReplaceBG = translate('OpenLP.Ui', 'Replace Background') - self.ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') + self.ReplaceLiveBG = translate('OpenLP.Ui', 'Replace live background.') self.ResetBG = translate('OpenLP.Ui', 'Reset Background') - self.ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') + self.ResetLiveBG = translate('OpenLP.Ui', 'Reset live background.') self.Seconds = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') self.SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 3b006bf5e..c83a199b1 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -200,15 +200,14 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): """ Prepare the UI for the process. """ - # We start on 2 for plugins status setting plus a "finished" point. - max_progress = 2 + self.max_progress = 0 # Loop through the songs list and increase for each selected item for i in xrange(self.songsListWidget.count()): item = self.songsListWidget.item(i) if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() size = self._getFileSize(u'%s%s' % (self.web, filename)) - max_progress += size + self.max_progress += size # Loop through the Bibles list and increase for each selected item iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget) while iterator.value(): @@ -216,7 +215,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): if item.parent() and item.checkState(0) == QtCore.Qt.Checked: filename = item.data(0, QtCore.Qt.UserRole).toString() size = self._getFileSize(u'%s%s' % (self.web, filename)) - max_progress += size + self.max_progress += size iterator += 1 # Loop through the themes list and increase for each selected item for i in xrange(self.themesListWidget.count()): @@ -224,23 +223,40 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): if item.checkState() == QtCore.Qt.Checked: filename = item.data(QtCore.Qt.UserRole).toString() size = self._getFileSize(u'%s%s' % (self.web, filename)) - max_progress += size + self.max_progress += size self.finishButton.setVisible(False) - self.progressBar.setValue(0) - self.progressBar.setMinimum(0) - self.progressBar.setMaximum(max_progress) + if self.max_progress: + # Add on 2 for plugins status setting plus a "finished" point. + self.max_progress = self.max_progress + 2 + self.progressBar.setValue(0) + self.progressBar.setMinimum(0) + self.progressBar.setMaximum(self.max_progress) + self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', + 'Setting Up And Downloading')) + self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard', + 'Please wait while OpenLP is set up ' + 'and your data is downloaded.')) + else: + self.progressBar.setVisible(False) + self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', + 'Setting Up')) + self.progressPage.setSubTitle(u'Setup complete.') def _postWizard(self): """ Clean up the UI after the process has finished. """ - self.progressBar.setValue(self.progressBar.maximum()) + if self.max_progress: + self.progressBar.setValue(self.progressBar.maximum()) + self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', + 'Download complete. Click the finish button to start OpenLP.')) + else: + self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', + 'Click the finish button to start OpenLP.')) self.finishButton.setVisible(True) self.finishButton.setEnabled(True) self.cancelButton.setVisible(False) self.nextButton.setVisible(False) - self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', - 'Download complete. Click the finish button to start OpenLP.')) Receiver.send_message(u'openlp_process_events') def _performWizard(self): diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index 6852d533a..fa7d88ed6 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -254,10 +254,6 @@ class Ui_FirstTimeWizard(object): 'Default Settings')) self.defaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Set up default settings to be used by OpenLP.')) - self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', - 'Setting Up And Importing')) - self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard', - 'Please wait while OpenLP is set up and your data is imported.')) self.displayLabel.setText(translate('OpenLP.FirstTimeWizard', 'Default output display:')) self.themeLabel.setText(translate('OpenLP.FirstTimeWizard', diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index b4a3b3640..091703c13 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -356,9 +356,9 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', 'Save Service As')) self.fileSaveAsItem.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service under a new name.')) - self.printServiceOrderItem.setText(UiStrings().PrintServiceOrder) + self.printServiceOrderItem.setText(UiStrings().PrintService) self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', - 'Print the current Service Order.')) + 'Print the current service.')) self.fileExitItem.setText( translate('OpenLP.MainWindow', 'E&xit')) self.fileExitItem.setStatusTip( diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 4afd58b74..805b3a1b5 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -149,7 +149,7 @@ class Ui_PrintServiceDialog(object): QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) def retranslateUi(self, printServiceDialog): - printServiceDialog.setWindowTitle(UiStrings().PrintServiceOrder) + printServiceDialog.setWindowTitle(UiStrings().PrintService) self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', @@ -159,7 +159,7 @@ class Ui_PrintServiceDialog(object): self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', - 'Service Order Sheet')) + 'Service Sheet')) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred]) From f0dde7353095f3d37681e10f00029d3d2421a81d Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Thu, 9 Jun 2011 22:55:43 -0400 Subject: [PATCH 13/13] Remove previous change to skip old_database bibles --- openlp/plugins/bibles/lib/manager.py | 55 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 74e3cb11e..2a3858afc 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -147,34 +147,33 @@ class BibleManager(object): self.db_cache = {} self.old_bible_databases = [] for filename in files: - if not filename.startswith(u'old_database_'): - bible = BibleDB(self.parent, path=self.path, file=filename) - name = bible.get_name() - # Remove corrupted files. - if name is None: - delete_file(os.path.join(self.path, filename)) - continue - # Find old database versions - if bible.is_old_database(): - self.old_bible_databases.append([filename, name]) - bible.session.close() - continue - log.debug(u'Bible Name: "%s"', name) - self.db_cache[name] = bible - # Look to see if lazy load bible exists and get create getter. - source = self.db_cache[name].get_object(BibleMeta, - u'download source') - if source: - download_name = self.db_cache[name].get_object(BibleMeta, - u'download name').value - meta_proxy = self.db_cache[name].get_object(BibleMeta, - u'proxy url') - web_bible = HTTPBible(self.parent, path=self.path, - file=filename, download_source=source.value, - download_name=download_name) - if meta_proxy: - web_bible.proxy_server = meta_proxy.value - self.db_cache[name] = web_bible + bible = BibleDB(self.parent, path=self.path, file=filename) + name = bible.get_name() + # Remove corrupted files. + if name is None: + delete_file(os.path.join(self.path, filename)) + continue + # Find old database versions + if bible.is_old_database(): + self.old_bible_databases.append([filename, name]) + bible.session.close() + continue + log.debug(u'Bible Name: "%s"', name) + self.db_cache[name] = bible + # Look to see if lazy load bible exists and get create getter. + source = self.db_cache[name].get_object(BibleMeta, + u'download source') + if source: + download_name = self.db_cache[name].get_object(BibleMeta, + u'download name').value + meta_proxy = self.db_cache[name].get_object(BibleMeta, + u'proxy url') + web_bible = HTTPBible(self.parent, path=self.path, + file=filename, download_source=source.value, + download_name=download_name) + if meta_proxy: + web_bible.proxy_server = meta_proxy.value + self.db_cache[name] = web_bible log.debug(u'Bibles reloaded') def set_process_dialog(self, wizard):