From 364de1af86d950f2a35ef17653d7d987d4b0f926 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 1 Jun 2011 23:47:42 +0100 Subject: [PATCH 01/20] aphrostrophe fix for song searching --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/plugins/songs/lib/__init__.py | 22 +++++++++++++++++----- openlp/plugins/songs/lib/mediaitem.py | 20 +++++++++++--------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 602b3c55b..d74ea04b0 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -91,7 +91,7 @@ class MediaManagerItem(QtGui.QWidget): Constructor to create the media manager item. """ QtGui.QWidget.__init__(self, parent) - self.whitespace = re.compile(r'\W+', re.UNICODE) + self.whitespace = re.compile(r'[\W_]+', re.UNICODE) self.plugin = plugin visible_title = self.plugin.getString(StringContent.VisibleName) self.title = unicode(visible_title[u'title']) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 53b3d7cb1..323db9fe4 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -32,6 +32,8 @@ from openlp.core.lib import translate from db import Author from ui import SongStrings +WHITESPACE = re.compile(r'[\W_]+', re.UNICODE) + class VerseType(object): """ VerseType provides an enumeration for the tags that may be associated @@ -246,6 +248,12 @@ def retrieve_windows_encoding(recommendation=None): return None return filter(lambda item: item[1] == choice[0], encodings)[0][0] +def clean_string(string): + """ + Strips punctuation from the passed string to assist searching + """ + return WHITESPACE.sub(u' ', string.replace(u'\'', u'')).lower() + def clean_song(manager, song): """ Cleans the search title, rebuilds the search lyrics, adds a default author @@ -262,9 +270,8 @@ def clean_song(manager, song): if song.alternate_title is None: song.alternate_title = u'' song.alternate_title = song.alternate_title.strip() - whitespace = re.compile(r'\W+', re.UNICODE) - song.search_title = (whitespace.sub(u' ', song.title).strip() + u'@' + - whitespace.sub(u' ', song.alternate_title).strip()).strip().lower() + song.search_title = clean_string(song.title) + u'@' + \ + clean_string(song.alternate_title) # Only do this, if we the song is a 1.9.4 song (or older). if song.lyrics.find(u'') != -1: # Remove the old "language" attribute from lyrics tag (prior to 1.9.5). @@ -273,8 +280,8 @@ def clean_song(manager, song): song.lyrics = song.lyrics.replace( u'', u'') verses = SongXML().get_verses(song.lyrics) - lyrics = u' '.join([whitespace.sub(u' ', verse[1]) for verse in verses]) - song.search_lyrics = lyrics.lower() + song.search_lyrics = u' '.join([clean_string(verse[1]) + for verse in verses]) # We need a new and clean SongXML instance. sxml = SongXML() # Rebuild the song's verses, to remove any wrong verse names (for @@ -316,6 +323,11 @@ def clean_song(manager, song): if order not in compare_order: song.verse_order = u'' break + else: + verses = SongXML().get_verses(song.lyrics) + song.search_lyrics = u' '.join([clean_string(verse[1]) + for verse in verses]) + # The song does not have any author, add one. if not song.authors: name = SongStrings.AuthorUnknown diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b24fbf64a..df9b6a41f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -38,7 +38,8 @@ from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm -from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType +from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType, \ + clean_string from openlp.plugins.songs.lib.db import Author, Song from openlp.plugins.songs.lib.ui import SongStrings @@ -181,13 +182,14 @@ class SongMediaItem(MediaManagerItem): elif search_type == SongSearch.Titles: log.debug(u'Titles Search') search_results = self.plugin.manager.get_all_objects(Song, - Song.search_title.like(u'%' + self.whitespace.sub(u' ', - search_keywords.lower()) + u'%')) + Song.search_title.like(u'%' + clean_string(search_keywords) + + u'%')) self.displayResultsSong(search_results) elif search_type == SongSearch.Lyrics: log.debug(u'Lyrics Search') search_results = self.plugin.manager.get_all_objects(Song, - Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%')) + Song.search_lyrics.like(u'%' + clean_string(search_keywords) + + u'%')) self.displayResultsSong(search_results) elif search_type == SongSearch.Authors: log.debug(u'Authors Search') @@ -198,16 +200,16 @@ class SongMediaItem(MediaManagerItem): elif search_type == SongSearch.Themes: log.debug(u'Theme Search') search_results = self.plugin.manager.get_all_objects(Song, - Song.theme_name.like(u'%' + self.whitespace.sub(u' ', - search_keywords) + u'%')) + Song.theme_name.like(u'%' + search_keywords + u'%')) self.displayResultsSong(search_results) self.check_search_result() def searchEntire(self, search_keywords): return self.plugin.manager.get_all_objects(Song, - or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ', - search_keywords.lower()) + u'%'), - Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'), + or_(Song.search_title.like(u'%' + clean_string(search_keywords) + + u'%'), + Song.search_lyrics.like(u'%' + clean_string(search_keywords) + + u'%'), Song.comments.like(u'%' + search_keywords.lower() + u'%'))) def onSongListLoad(self): From 877ea4e13d7d840fd5de5a58b05587a5a4de770a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Thu, 2 Jun 2011 12:42:42 +0200 Subject: [PATCH 02/20] Change upgrade of bibles: bibleupgradeform now trys to upgrade existing verses from webbibles. --- .../plugins/bibles/forms/bibleupgradeform.py | 21 ++++++++++++++++-- openlp/plugins/bibles/lib/db.py | 22 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index 0fdcdfd11..3d25d6092 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -671,8 +671,25 @@ class BibleUpgradeForm(OpenLPWizard): bible_failed = True break book_details = BiblesResourcesDB.get_book_by_id(book_ref_id) - self.newbibles[number].create_book(book, book_ref_id, - book_details[u'testament_id']) + db_book = self.newbibles[number].create_book(book, + book_ref_id, book_details[u'testament_id']) + # Try to import still downloaded verses + oldbook = oldbible.get_book(book) + if oldbook: + verses = oldbible.get_verses(oldbook[u'id']) + if not verses: + log.exception(u'No verses found to import for book ' + u'"%s"', book) + continue + for verse in verses: + if self.stop_import_flag: + bible_failed = True + break + self.newbibles[number].create_verse(db_book.id, + int(verse[u'chapter']), + int(verse[u'verse']), unicode(verse[u'text'])) + Receiver.send_message(u'openlp_process_events') + self.newbibles[number].session.commit() else: language_id = self.newbibles[number].get_object(BibleMeta, u'language_id') diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 776521aa6..975b4093d 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -1043,6 +1043,28 @@ class OldBibleDB(QtCore.QObject, Manager): else: return None + def get_book(self, name): + """ + Return a book by name or abbreviation. + + ``name`` + The name or abbreviation of the book. + """ + if not isinstance(name, unicode): + name = unicode(name) + books = self.run_sql(u'SELECT id, testament_id, name, ' + u'abbreviation FROM book WHERE LOWER(name) = ? OR ' + u'LOWER(abbreviation) = ?', (name.lower(), name.lower())) + if books: + return { + u'id': books[0][0], + u'testament_id': books[0][1], + u'name': unicode(books[0][2]), + u'abbreviation': unicode(books[0][3]) + } + else: + return None + def get_books(self): """ Returns the books of the Bible. From eda3e9ebe00d3aec754d719734e0f6f40d31bace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Thu, 2 Jun 2011 13:52:06 +0200 Subject: [PATCH 03/20] change log usage --- openlp/plugins/bibles/forms/bibleupgradeform.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index 3d25d6092..ecfb676f6 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -606,7 +606,7 @@ class BibleUpgradeForm(OpenLPWizard): handler = BSExtract(proxy_server) books = handler.get_books_from_http(meta_data[u'download name']) if not books: - log.exception(u'Upgrading books from %s - download '\ + log.error(u'Upgrading books from %s - download '\ u'name: "%s" failed' % ( meta_data[u'download source'], meta_data[u'download name'])) @@ -637,7 +637,7 @@ class BibleUpgradeForm(OpenLPWizard): else: language_id = self.newbibles[number].get_language(name) if not language_id: - log.exception(u'Upgrading from "%s" failed' % filename[0]) + log.error(u'Upgrading from "%s" failed' % filename[0]) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) del self.newbibles[number] @@ -661,7 +661,7 @@ class BibleUpgradeForm(OpenLPWizard): book_ref_id = self.newbibles[number].\ get_book_ref_id_by_name(book, len(books), language_id) if not book_ref_id: - log.exception(u'Upgrading books from %s - download '\ + log.error(u'Upgrading books from %s - download '\ u'name: "%s" aborted by user' % ( meta_data[u'download source'], meta_data[u'download name'])) @@ -678,7 +678,7 @@ class BibleUpgradeForm(OpenLPWizard): if oldbook: verses = oldbible.get_verses(oldbook[u'id']) if not verses: - log.exception(u'No verses found to import for book ' + log.warn(u'No verses found to import for book ' u'"%s"', book) continue for verse in verses: @@ -696,7 +696,7 @@ class BibleUpgradeForm(OpenLPWizard): if not language_id: language_id = self.newbibles[number].get_language(name) if not language_id: - log.exception(u'Upgrading books from "%s" failed' % name) + log.error(u'Upgrading books from "%s" failed' % name) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) del self.newbibles[number] @@ -722,7 +722,7 @@ class BibleUpgradeForm(OpenLPWizard): get_book_ref_id_by_name(book[u'name'], len(books), language_id) if not book_ref_id: - log.exception(u'Upgrading books from %s " '\ + log.error(u'Upgrading books from %s " '\ 'failed - aborted by user' % name) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) @@ -734,7 +734,7 @@ class BibleUpgradeForm(OpenLPWizard): book_ref_id, book_details[u'testament_id']) verses = oldbible.get_verses(book[u'id']) if not verses: - log.exception(u'No verses found to import for book ' + log.error(u'No verses found to import for book ' u'"%s"', book[u'name']) self.newbibles[number].delete_book(db_book) continue From d4031a62d367c18e2d176d3464585ebb7f66c049 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 2 Jun 2011 22:13:32 +0100 Subject: [PATCH 04/20] More apostrophes --- openlp/plugins/songs/lib/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 323db9fe4..05e402776 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -33,6 +33,7 @@ from db import Author from ui import SongStrings WHITESPACE = re.compile(r'[\W_]+', re.UNICODE) +APOSTROPHE = re.compile(u'[\'`’ʻ′]', re.UNICODE) class VerseType(object): """ @@ -252,7 +253,7 @@ def clean_string(string): """ Strips punctuation from the passed string to assist searching """ - return WHITESPACE.sub(u' ', string.replace(u'\'', u'')).lower() + return WHITESPACE.sub(u' ', APOSTROPHE.sub(u'', string)).lower() def clean_song(manager, song): """ From 9aed776186dd4fa024895db3416b83f6019cd5df Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 3 Jun 2011 07:52:16 +0100 Subject: [PATCH 05/20] Change presentation log.exceptions to log.warn's --- .../presentations/lib/impresscontroller.py | 18 +++++++++--------- .../presentations/presentationplugin.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 0d0cc43a3..ee49948ac 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -125,7 +125,7 @@ class ImpressController(PresentationController): try: uno_instance = get_uno_instance(resolver) except: - log.exception(u'Unable to find running instance ') + log.warn(u'Unable to find running instance ') self.start_process() loop += 1 try: @@ -136,7 +136,7 @@ class ImpressController(PresentationController): "com.sun.star.frame.Desktop", uno_instance) return desktop except: - log.exception(u'Failed to get UNO desktop') + log.warn(u'Failed to get UNO desktop') return None def get_com_desktop(self): @@ -151,7 +151,7 @@ class ImpressController(PresentationController): try: desktop = self.manager.createInstance(u'com.sun.star.frame.Desktop') except AttributeError: - log.exception(u'Failure to find desktop - Impress may have closed') + log.warn(u'Failure to find desktop - Impress may have closed') return desktop if desktop else None def get_com_servicemanager(self): @@ -162,7 +162,7 @@ class ImpressController(PresentationController): try: return Dispatch(u'com.sun.star.ServiceManager') except pywintypes.com_error: - log.exception(u'Failed to get COM service manager. ' + log.warn(u'Failed to get COM service manager. ' u'Impress Controller has been disabled') return None @@ -180,7 +180,7 @@ class ImpressController(PresentationController): else: desktop = self.get_com_desktop() except: - log.exception(u'Failed to find an OpenOffice desktop to terminate') + log.warn(u'Failed to find an OpenOffice desktop to terminate') if not desktop: return docs = desktop.getComponents() @@ -191,7 +191,7 @@ class ImpressController(PresentationController): desktop.terminate() log.debug(u'OpenOffice killed') except: - log.exception(u'Failed to terminate OpenOffice') + log.warn(u'Failed to terminate OpenOffice') class ImpressDocument(PresentationDocument): @@ -244,7 +244,7 @@ class ImpressDocument(PresentationDocument): self.document = desktop.loadComponentFromURL(url, u'_blank', 0, properties) except: - log.exception(u'Failed to load presentation %s' % url) + log.warn(u'Failed to load presentation %s' % url) return False if os.name == u'nt': # As we can't start minimized the Impress window gets in the way. @@ -323,7 +323,7 @@ class ImpressDocument(PresentationDocument): self.presentation = None self.document.dispose() except: - log.exception("Closing presentation failed") + log.warn("Closing presentation failed") self.document = None self.controller.remove_doc(self) @@ -341,7 +341,7 @@ class ImpressDocument(PresentationDocument): log.debug("getPresentation failed to find a presentation") return False except: - log.exception("getPresentation failed to find a presentation") + log.warn("getPresentation failed to find a presentation") return False return True diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 29acb73f4..aa9e5ba24 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -77,7 +77,7 @@ class PresentationPlugin(Plugin): try: self.controllers[controller].start_process() except: - log.exception(u'Failed to start controller process') + log.warn(u'Failed to start controller process') self.controllers[controller].available = False self.mediaItem.buildFileMaskString() @@ -128,7 +128,7 @@ class PresentationPlugin(Plugin): try: __import__(modulename, globals(), locals(), []) except ImportError: - log.exception(u'Failed to import %s on path %s', + log.warn(u'Failed to import %s on path %s', modulename, path) controller_classes = PresentationController.__subclasses__() for controller_class in controller_classes: From c4e6e91c81f10b510173d5ae051b22814057be7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Fri, 3 Jun 2011 14:43:54 +0200 Subject: [PATCH 06/20] change log usage --- openlp/plugins/bibles/forms/bibleupgradeform.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index ecfb676f6..0b1556f07 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -637,7 +637,7 @@ class BibleUpgradeForm(OpenLPWizard): else: language_id = self.newbibles[number].get_language(name) if not language_id: - log.error(u'Upgrading from "%s" failed' % filename[0]) + log.warn(u'Upgrading from "%s" failed' % filename[0]) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) del self.newbibles[number] @@ -661,7 +661,7 @@ class BibleUpgradeForm(OpenLPWizard): book_ref_id = self.newbibles[number].\ get_book_ref_id_by_name(book, len(books), language_id) if not book_ref_id: - log.error(u'Upgrading books from %s - download '\ + log.warn(u'Upgrading books from %s - download '\ u'name: "%s" aborted by user' % ( meta_data[u'download source'], meta_data[u'download name'])) @@ -696,7 +696,7 @@ class BibleUpgradeForm(OpenLPWizard): if not language_id: language_id = self.newbibles[number].get_language(name) if not language_id: - log.error(u'Upgrading books from "%s" failed' % name) + log.warn(u'Upgrading books from "%s" failed' % name) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) del self.newbibles[number] @@ -722,7 +722,7 @@ class BibleUpgradeForm(OpenLPWizard): get_book_ref_id_by_name(book[u'name'], len(books), language_id) if not book_ref_id: - log.error(u'Upgrading books from %s " '\ + log.warn(u'Upgrading books from %s " '\ 'failed - aborted by user' % name) delete_database(self.path, clean_filename(self.newbibles[number].get_name())) @@ -734,7 +734,7 @@ class BibleUpgradeForm(OpenLPWizard): book_ref_id, book_details[u'testament_id']) verses = oldbible.get_verses(book[u'id']) if not verses: - log.error(u'No verses found to import for book ' + log.warn(u'No verses found to import for book ' u'"%s"', book[u'name']) self.newbibles[number].delete_book(db_book) continue From 860b64f28e46535490adb445a1c576dc912c4e8b Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Fri, 3 Jun 2011 11:44:40 -0400 Subject: [PATCH 07/20] Fix traceback in windows-builder.py if bzr version string contains non-ascii chars --- scripts/windows-builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index e99de670b..be9f7d6aa 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -194,7 +194,8 @@ def write_version_file(): code = bzr.wait() if code != 0: raise Exception(u'Error running bzr log') - latest = output.split(u':')[0] + outputAscii = unicode(output, errors='ignore') + latest = outputAscii.split(u':')[0] versionstring = latest == revision and tag or u'%s-bzr%s' % (tag, latest) f = open(os.path.join(dist_path, u'.version'), u'w') f.write(versionstring) From 7c4474810fd5ff73dc03feb5482ffbeadd3cd830 Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Fri, 3 Jun 2011 12:40:17 -0400 Subject: [PATCH 08/20] Added Mako requirement documentation --- scripts/windows-builder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index be9f7d6aa..854c927c9 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -102,6 +102,13 @@ psvince.dll the install will fail. The dll can be obtained from here: http://www.vincenzo.net/isxkb/index.php?title=PSVince) +Mako + Mako Templates for Python. This package is required for building the + remote plugin. It can be installed by going to your + python_directory\scripts\.. and running "easy_install Mako". If you do not + have easy_install, the Mako package can be obtained here: + http://www.makotemplates.org/download.html + """ import os From 0841802ddc7180734c73fafb6a1710b3369e2ac6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 4 Jun 2011 19:08:48 +0100 Subject: [PATCH 09/20] Fix state for service items --- openlp/core/ui/servicemanager.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 349b0a4a3..cc5ecdbaa 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -652,7 +652,7 @@ class ServiceManager(QtGui.QWidget): self.loadFile(fileName) def contextMenu(self, point): - item = self.serviceManagerList.itemAt(point) + item = self.serviceManagerList.currentItem() if item is None: return if item.parent() is None: @@ -959,6 +959,7 @@ class ServiceManager(QtGui.QWidget): treewidgetitem.setToolTip(0, serviceitem.notes) treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) + treewidgetitem.setSelected(item[u'selected']) # Add the children to their parent treewidgetitem. for count, frame in enumerate(serviceitem.get_frames()): child = QtGui.QTreeWidgetItem(treewidgetitem) @@ -1030,16 +1031,34 @@ class ServiceManager(QtGui.QWidget): # force reset of renderer as theme data has changed self.mainwindow.renderer.themedata = None if self.serviceItems: + for item in self.serviceItems: + item[u'selected'] = False + serviceIterator = QtGui.QTreeWidgetItemIterator( + self.serviceManagerList) + while serviceIterator.value(): + if serviceIterator.value().isSelected(): + selectedItem = serviceIterator.value() + serviceIterator += 1 + if selectedItem is not None: + if selectedItem.parent() is None: + pos = selectedItem.data(0, QtCore.Qt.UserRole).toInt()[0] + else: + pos = selectedItem.parent().data(0, QtCore.Qt.UserRole). \ + toInt()[0] + self.serviceItems[pos - 1][u'selected'] = True tempServiceItems = self.serviceItems self.serviceManagerList.clear() self.serviceItems = [] self.isNew = True for item in tempServiceItems: self.addServiceItem( - item[u'service_item'], False, expand=item[u'expanded']) + item[u'service_item'], False, expand=item[u'expanded'], + repaint=False, selected=item[u'selected']) # Set to False as items may have changed rendering # does not impact the saved song so True may also be valid self.setModified() + # Repaint it once only at the end + self.repaintServiceList(-1, -1) Receiver.send_message(u'cursor_normal') def serviceItemUpdate(self, message): @@ -1069,7 +1088,7 @@ class ServiceManager(QtGui.QWidget): self.setModified() def addServiceItem(self, item, rebuild=False, expand=None, replace=False, - repaint=True): + repaint=True, selected=False): """ Add a Service item to the list @@ -1097,17 +1116,17 @@ class ServiceManager(QtGui.QWidget): for inditem in item: self.serviceItems.append({u'service_item': inditem, u'order': len(self.serviceItems) + 1, - u'expanded': expand}) + u'expanded': expand, u'selected': selected}) else: self.serviceItems.append({u'service_item': item, u'order': len(self.serviceItems) + 1, - u'expanded': expand}) + u'expanded': expand, u'selected': selected}) if repaint: self.repaintServiceList(len(self.serviceItems) - 1, -1) else: self.serviceItems.insert(self.dropPosition, {u'service_item': item, u'order': self.dropPosition, - u'expanded': expand}) + u'expanded': expand, u'selected': selected}) self.repaintServiceList(self.dropPosition, -1) # if rebuilding list make sure live is fixed. if rebuild: From b6d0f2243da07a757aada5f536e0b87a76506bf2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 4 Jun 2011 19:14:32 +0100 Subject: [PATCH 10/20] Fix error if cnp --- openlp/core/ui/servicemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index cc5ecdbaa..8ecd89bc7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -652,7 +652,7 @@ class ServiceManager(QtGui.QWidget): self.loadFile(fileName) def contextMenu(self, point): - item = self.serviceManagerList.currentItem() + item = self.serviceManagerList.itemAt(point) if item is None: return if item.parent() is None: From 937cfd22607bda61a4c1bdb56004c21b96c8b972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sat, 4 Jun 2011 20:43:59 +0200 Subject: [PATCH 11/20] Fix Bug #792811 - Traceback UnicodeEncodeError while importing a webbible If upgrade fails new bible databases now should be deleted always --- .../plugins/bibles/forms/bibleupgradeform.py | 5 ++--- openlp/plugins/bibles/lib/http.py | 8 +++++--- .../bibles/resources/bibles_resources.sqlite | Bin 104448 -> 104448 bytes 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index 524ad4435..fc5ea1e54 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -586,8 +586,6 @@ class BibleUpgradeForm(OpenLPWizard): if not meta[u'key'] == u'Version': self.newbibles[number].create_meta(meta[u'key'], meta[u'value']) - else: - self.newbibles[number].create_meta(meta[u'key'], name) if meta[u'key'] == u'download source': webbible = True include_webbible = True @@ -626,7 +624,7 @@ class BibleUpgradeForm(OpenLPWizard): bible = BiblesResourcesDB.get_webbible( meta_data[u'download name'], meta_data[u'download source'].lower()) - if bible[u'language_id']: + if bible and bible[u'language_id']: language_id = bible[u'language_id'] self.newbibles[number].create_meta(u'language_id', language_id) @@ -744,6 +742,7 @@ class BibleUpgradeForm(OpenLPWizard): Receiver.send_message(u'openlp_process_events') self.newbibles[number].session.commit() if not bible_failed: + self.newbibles[number].create_meta(u'Version', name) self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', 'Upgrading Bible %s of %s: "%s"\n' diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index edb111d93..fdf8c2def 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -199,9 +199,10 @@ class BSExtract(object): """ log.debug(u'BSExtract.get_bible_chapter("%s", "%s", "%s")', version, bookname, chapter) + urlversion = urllib.quote(version.encode("utf-8")) urlbookname = urllib.quote(bookname.encode("utf-8")) - chapter_url = u'http://m.bibleserver.com/text/%s/%s%s' % \ - (version, urlbookname, chapter) + chapter_url = u'http://m.bibleserver.com/text/%s/%s%d' % \ + (urlversion, urlbookname, chapter) header = (u'Accept-Language', u'en') soup = get_soup_for_bible_ref(chapter_url, header) if not soup: @@ -230,8 +231,9 @@ class BSExtract(object): The version of the Bible like NIV for New International Version """ log.debug(u'BSExtract.get_books_from_http("%s")', version) + urlversion = urllib.quote(version.encode("utf-8")) chapter_url = u'http://m.bibleserver.com/overlay/selectBook?'\ - 'translation=%s' % (version) + 'translation=%s' % (urlversion) soup = get_soup_for_bible_ref(chapter_url) if not soup: return None diff --git a/openlp/plugins/bibles/resources/bibles_resources.sqlite b/openlp/plugins/bibles/resources/bibles_resources.sqlite index 9336918f2d187da2a2e0a96819dfc2ceda31dabe..3235c95629f3d00cde01ef172cf7727e3edd4670 100644 GIT binary patch delta 82 zcmV-Y0ImOkum*sz29O&8;;|ft3kIJe0|Q9`lk0LGv&IWP;2aDAd=vw@1Cj%214sh; o0?PuL0$&0L0qOy}0erI|1Y7|FJb@pR)#*3{+yE#8v%Bp@s$c&b#sB~S delta 67 zcmV-J0KETzum*sz29O&8;jtWs3kIGd0|Q9`lk0LGv&IWP;2H}7yA%Vt1Cj%214sh; Z0?PuL0$&0L0qOy}vmpeX0kga9MXCd47f}EJ From 522e68c38cb2ada41cae934585a4c4cc0f649a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sat, 4 Jun 2011 21:34:36 +0200 Subject: [PATCH 12/20] Biblegateway.com has changed it's Bible-Book-List Layout. Addapt the regex for importing booklist of a bible from biblegateway changed log usage --- openlp/plugins/bibles/lib/http.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index fdf8c2def..76a99ea50 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -109,7 +109,7 @@ class BGExtract(object): try: clean_verse_num = int(str(raw_verse_num)) except ValueError: - log.exception(u'Illegal verse number in %s %s %s:%s', + log.warn(u'Illegal verse number in %s %s %s:%s', version, bookname, chapter, unicode(raw_verse_num)) if clean_verse_num: verse_text = raw_verse_num.next @@ -139,16 +139,17 @@ class BGExtract(object): """ log.debug(u'BGExtract.get_books_from_http("%s")', version) url_params = urllib.urlencode( - {u'search': 'Bible-List', u'version': u'%s' % version}) - reference_url = u'http://www.biblegateway.com/passage/?%s' % url_params + {u'action': 'getVersionInfo', u'vid': u'%s' % version}) + reference_url = u'http://www.biblegateway.com/versions/?%s#books' % \ + url_params page = get_web_page(reference_url) if not page: send_error_message(u'download') return None page_source = page.read() page_source = unicode(page_source, 'utf8') - page_source_temp = re.search(u'.*?
', \ - page_source, re.DOTALL) + page_source_temp = re.search(u'.*?'\ + u'
', page_source, re.DOTALL) if page_source_temp: soup = page_source_temp.group(0) else: @@ -156,15 +157,17 @@ class BGExtract(object): try: soup = BeautifulSoup(soup) except HTMLParseError: - log.exception(u'BeautifulSoup could not parse the Bible page.') + log.error(u'BeautifulSoup could not parse the Bible page.') + send_error_message(u'parse') + return None if not soup: send_error_message(u'parse') return None Receiver.send_message(u'openlp_process_events') - content = soup.find(u'table', {u'id': u'booklist'}) + content = soup.find(u'table', {u'class': u'infotable'}) content = content.findAll(u'tr') if not content: - log.exception(u'No books found in the Biblegateway response.') + log.error(u'No books found in the Biblegateway response.') send_error_message(u'parse') return None books = [] @@ -210,7 +213,7 @@ class BSExtract(object): Receiver.send_message(u'openlp_process_events') content = soup.find(u'div', u'content') if not content: - log.exception(u'No verses found in the Bibleserver response.') + log.error(u'No verses found in the Bibleserver response.') send_error_message(u'parse') return None content = content.find(u'div').findAll(u'div') @@ -239,7 +242,7 @@ class BSExtract(object): return None content = soup.find(u'ul') if not content: - log.exception(u'No books found in the Bibleserver response.') + log.error(u'No books found in the Bibleserver response.') send_error_message(u'parse') return None content = content.findAll(u'li') @@ -283,7 +286,7 @@ class CWExtract(object): Receiver.send_message(u'openlp_process_events') htmlverses = soup.findAll(u'span', u'versetext') if not htmlverses: - log.debug(u'No verses found in the CrossWalk response.') + log.error(u'No verses found in the CrossWalk response.') send_error_message(u'parse') return None verses = {} @@ -335,7 +338,7 @@ class CWExtract(object): content = soup.find(u'div', {u'class': u'Body'}) content = content.find(u'ul', {u'class': u'parent'}) if not content: - log.exception(u'No books found in the Crosswalk response.') + log.error(u'No books found in the Crosswalk response.') send_error_message(u'parse') return None content = content.findAll(u'li') From 52bab3e4155ba234a54221df5ba22d5f663c26f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sat, 4 Jun 2011 22:35:24 +0200 Subject: [PATCH 13/20] Fix right parent for all used dialogs small fixes --- .../plugins/bibles/forms/bibleupgradeform.py | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index fc5ea1e54..bbd6c1d20 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -68,6 +68,7 @@ class BibleUpgradeForm(OpenLPWizard): """ self.manager = manager self.mediaItem = bibleplugin.mediaItem + self.plugin = bibleplugin self.suffix = u'.sqlite' self.settingsSection = u'bibles' self.path = AppLocation.get_section_data_path( @@ -578,12 +579,14 @@ class BibleUpgradeForm(OpenLPWizard): name = unicode(self.versionNameEdit[biblenumber].text()) self.newbibles[number] = BibleDB(self.mediaItem, path=self.path, name=name) + self.newbibles[number].register(self.plugin.upgrade_wizard) metadata = oldbible.get_metadata() webbible = False meta_data = {} for meta in metadata: meta_data[meta[u'key']] = meta[u'value'] - if not meta[u'key'] == u'Version': + if not meta[u'key'] == u'Version' and not meta[u'key'] == \ + u'dbversion': self.newbibles[number].create_meta(meta[u'key'], meta[u'value']) if meta[u'key'] == u'download source': @@ -605,7 +608,7 @@ class BibleUpgradeForm(OpenLPWizard): meta_data[u'download source'], meta_data[u'download name'])) delete_database(self.path, - clean_filename(self.newbibles[number].get_name())) + clean_filename(name)) del self.newbibles[number] critical_error_message_box( translate('BiblesPlugin.UpgradeWizardForm', @@ -633,7 +636,7 @@ class BibleUpgradeForm(OpenLPWizard): if not language_id: log.warn(u'Upgrading from "%s" failed' % filename[0]) delete_database(self.path, - clean_filename(self.newbibles[number].get_name())) + clean_filename(name)) del self.newbibles[number] self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', @@ -659,8 +662,7 @@ class BibleUpgradeForm(OpenLPWizard): u'name: "%s" aborted by user' % ( meta_data[u'download source'], meta_data[u'download name'])) - delete_database(self.path, - clean_filename(self.newbibles[number].get_name())) + delete_database(self.path, clean_filename(name)) del self.newbibles[number] bible_failed = True break @@ -691,8 +693,7 @@ class BibleUpgradeForm(OpenLPWizard): language_id = self.newbibles[number].get_language(name) if not language_id: log.warn(u'Upgrading books from "%s" failed' % name) - delete_database(self.path, - clean_filename(self.newbibles[number].get_name())) + delete_database(self.path, clean_filename(name)) del self.newbibles[number] self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', @@ -718,8 +719,7 @@ class BibleUpgradeForm(OpenLPWizard): if not book_ref_id: log.warn(u'Upgrading books from %s " '\ 'failed - aborted by user' % name) - delete_database(self.path, - clean_filename(self.newbibles[number].get_name())) + delete_database(self.path, clean_filename(name)) del self.newbibles[number] bible_failed = True break @@ -755,8 +755,7 @@ class BibleUpgradeForm(OpenLPWizard): 'Upgrading Bible %s of %s: "%s"\nFailed')) % (number + 1, self.maxBibles, name), self.progressBar.maximum() - self.progressBar.value()) - delete_database(self.path, - clean_filename(name)) + delete_database(self.path, clean_filename(name)) number += 1 self.mediaItem.reloadBibles() successful_import = 0 From 346bf2426749360fcb831cf7da45cfdae67f4cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 5 Jun 2011 14:40:26 +0200 Subject: [PATCH 14/20] changed behaviour if the user cancel the import so that after a traceback it is possible to cancel the dialog --- .../plugins/bibles/forms/bibleupgradeform.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index bbd6c1d20..f776c3e5d 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -116,6 +116,8 @@ class BibleUpgradeForm(OpenLPWizard): self.stop_import_flag = True if not self.currentPage() == self.progressPage: self.done(QtGui.QDialog.Rejected) + else: + self.postWizard() def onCurrentIdChanged(self, pageId): """ @@ -132,9 +134,7 @@ class BibleUpgradeForm(OpenLPWizard): """ Some cleanup while finishing """ - for number, filename in enumerate(self.files): - if number in self.success and self.success[number] == True: - delete_file(os.path.join(self.path, filename[0])) + self.mediaItem.reloadBibles() def onBackupBrowseButtonClicked(self): """ @@ -537,7 +537,7 @@ class BibleUpgradeForm(OpenLPWizard): """ Perform the actual upgrade. """ - include_webbible = False + self.include_webbible = False proxy_server = None if self.maxBibles == 0: self.progressLabel.setText( @@ -591,7 +591,7 @@ class BibleUpgradeForm(OpenLPWizard): meta[u'value']) if meta[u'key'] == u'download source': webbible = True - include_webbible = True + self.include_webbible = True if meta.has_key(u'proxy server'): proxy_server = meta[u'proxy server'] if webbible: @@ -607,8 +607,7 @@ class BibleUpgradeForm(OpenLPWizard): u'name: "%s" failed' % ( meta_data[u'download source'], meta_data[u'download name'])) - delete_database(self.path, - clean_filename(name)) + delete_database(self.path, clean_filename(name)) del self.newbibles[number] critical_error_message_box( translate('BiblesPlugin.UpgradeWizardForm', @@ -635,8 +634,7 @@ class BibleUpgradeForm(OpenLPWizard): language_id = self.newbibles[number].get_language(name) if not language_id: log.warn(u'Upgrading from "%s" failed' % filename[0]) - delete_database(self.path, - clean_filename(name)) + delete_database(self.path, clean_filename(name)) del self.newbibles[number] self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', @@ -743,6 +741,7 @@ class BibleUpgradeForm(OpenLPWizard): self.newbibles[number].session.commit() if not bible_failed: self.newbibles[number].create_meta(u'Version', name) + delete_file(os.path.join(self.path, filename[0])) self.incrementProgressBar(unicode(translate( 'BiblesPlugin.UpgradeWizardForm', 'Upgrading Bible %s of %s: "%s"\n' @@ -757,7 +756,11 @@ class BibleUpgradeForm(OpenLPWizard): self.progressBar.maximum() - self.progressBar.value()) delete_database(self.path, clean_filename(name)) number += 1 - self.mediaItem.reloadBibles() + + def postWizard(self): + """ + Clean up the UI after the import has finished. + """ successful_import = 0 failed_import = 0 for number, filename in enumerate(self.files): @@ -772,7 +775,7 @@ class BibleUpgradeForm(OpenLPWizard): else: failed_import_text = u'' if successful_import > 0: - if include_webbible: + if self.include_webbible: self.progressLabel.setText(unicode( translate('BiblesPlugin.UpgradeWizardForm', 'Upgrading ' 'Bible(s): %s successful%s\nPlease note, that verses from ' @@ -788,3 +791,4 @@ class BibleUpgradeForm(OpenLPWizard): self.progressLabel.setText( translate('BiblesPlugin.UpgradeWizardForm', 'Upgrade ' 'failed.')) + OpenLPWizard.postWizard(self) From 1b2956a9e6ba629d3ac50e3f08af841dd44cd29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 5 Jun 2011 19:33:46 +0200 Subject: [PATCH 15/20] remove unnecessary code --- openlp/plugins/bibles/forms/bibleupgradeform.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index f776c3e5d..b7a4c3853 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -130,12 +130,6 @@ class BibleUpgradeForm(OpenLPWizard): elif self.page(pageId) == self.selectPage and self.maxBibles == 0: self.next() - def onFinishButton(self): - """ - Some cleanup while finishing - """ - self.mediaItem.reloadBibles() - def onBackupBrowseButtonClicked(self): """ Show the file open dialog for the OSIS file. @@ -181,8 +175,6 @@ class BibleUpgradeForm(OpenLPWizard): """ Set up the signals used in the bible importer. """ - QtCore.QObject.connect(self.finishButton, - QtCore.SIGNAL(u'clicked()'), self.onFinishButton) QtCore.QObject.connect(self.backupBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onBackupBrowseButtonClicked) QtCore.QObject.connect(self.noBackupCheckBox, From c85e953d4e774d6341fbff79d7e1305296b6bad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 5 Jun 2011 19:39:13 +0200 Subject: [PATCH 16/20] remove unnecessary code --- openlp/plugins/bibles/forms/bibleupgradeform.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index b7a4c3853..7913aac31 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -68,7 +68,6 @@ class BibleUpgradeForm(OpenLPWizard): """ self.manager = manager self.mediaItem = bibleplugin.mediaItem - self.plugin = bibleplugin self.suffix = u'.sqlite' self.settingsSection = u'bibles' self.path = AppLocation.get_section_data_path( From 5505644176fa66c35d81364710bdf50057a4c6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 5 Jun 2011 20:19:44 +0200 Subject: [PATCH 17/20] Fix Bug #793091 - if plugin changed status from inactive to active plugin.appStartup is called --- openlp/core/ui/pluginform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index c93b08ccb..37c6c8d63 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -132,6 +132,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): Receiver.send_message(u'cursor_busy') self.activePlugin.toggleStatus(PluginStatus.Active) Receiver.send_message(u'cursor_normal') + if hasattr(self.activePlugin, u'appStartup'): + Receiver.send_message(u'openlp_process_events') + self.activePlugin.appStartup() else: self.activePlugin.toggleStatus(PluginStatus.Inactive) status_text = unicode( From 17209fcc293dd99cce386241d6c9a87a2f43ae42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 5 Jun 2011 20:46:00 +0200 Subject: [PATCH 18/20] define appStartup() in plugin.py remove hassattr(plugin, appStartup) --- openlp/core/lib/plugin.py | 6 ++++++ openlp/core/ui/mainwindow.py | 2 +- openlp/core/ui/pluginform.py | 4 +--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 65ed76dfe..910c52d2c 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -300,6 +300,12 @@ class Plugin(QtCore.QObject): if self.mediaItem: self.mediadock.remove_dock(self.mediaItem) + def appStartup(self): + """ + Perform tasks on application starup + """ + pass + def usesTheme(self, theme): """ Called to find out if a plugin is currently using a theme. diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index bacbff073..b4a3b3640 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -655,7 +655,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # Give all the plugins a chance to perform some tasks at startup Receiver.send_message(u'openlp_process_events') for plugin in self.pluginManager.plugins: - if plugin.isActive() and hasattr(plugin, u'appStartup'): + if plugin.isActive(): Receiver.send_message(u'openlp_process_events') plugin.appStartup() Receiver.send_message(u'openlp_process_events') diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 37c6c8d63..b4c87488c 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -132,9 +132,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): Receiver.send_message(u'cursor_busy') self.activePlugin.toggleStatus(PluginStatus.Active) Receiver.send_message(u'cursor_normal') - if hasattr(self.activePlugin, u'appStartup'): - Receiver.send_message(u'openlp_process_events') - self.activePlugin.appStartup() + self.activePlugin.appStartup() else: self.activePlugin.toggleStatus(PluginStatus.Inactive) status_text = unicode( From b5810b271ef25f7459762d786ce86b00b8b3614c Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 6 Jun 2011 08:03:06 +0200 Subject: [PATCH 19/20] fixed bug #788770 --- openlp/plugins/bibles/lib/mediaitem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index bd84e2bb5..d94368f52 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -772,7 +772,7 @@ class BibleMediaItem(MediaManagerItem): log.exception(u'The second_search_results does not have as ' 'many verses as the search_results.') break - bible_text = u' %s %d%s%d (%s, %s)' % (verse.book.name, + bible_text = u'%s %d%s%d (%s, %s)' % (verse.book.name, verse.chapter, verse_separator, verse.verse, version, second_version) else: @@ -830,7 +830,7 @@ class BibleMediaItem(MediaManagerItem): bible_text = u'' # If we are 'Verse Per Line' then force a new line. elif self.settings.layout_style == LayoutStyle.VersePerLine: - bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) + bible_text = u'%s%s %s\n' % (bible_text, verse_text, text) # We have to be 'Continuous'. else: bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) From 6047dd9f5b75b98bb000c7125d95dd9a6acc63ab Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 6 Jun 2011 16:17:39 +0200 Subject: [PATCH 20/20] fixed bug 793537 Fixes: https://launchpad.net/bugs/793537 --- openlp/core/ui/screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 160080c5a..b970158b2 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -106,7 +106,7 @@ class ScreenList(object): """ # Do not log at start up. if changed_screen != -1: - log.info(u'screen_count_changed %d' % number) + log.info(u'screen_count_changed %d' % self.desktop.numScreens()) # Remove unplugged screens. for screen in copy.deepcopy(self.screen_list): if screen[u'number'] == self.desktop.numScreens():