From 624216a1b86b7fb5864d738805f79c344c9c1a58 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 3 Dec 2011 09:05:01 +0000 Subject: [PATCH 01/69] add field and usage --- openlp/core/lib/db.py | 4 ++++ openlp/plugins/songs/lib/db.py | 3 ++- openlp/plugins/songs/lib/mediaitem.py | 9 ++++++++- openlp/plugins/songs/lib/upgrade.py | 13 ++++++++++++- openlp/plugins/songs/lib/xml.py | 4 ++-- openlp/plugins/songs/songsplugin.py | 3 +++ 6 files changed, 31 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index cafc867b3..8c39750b5 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -361,6 +361,10 @@ class Manager(object): ``object_class`` The type of object to delete + + ``filter_clause`` + The filter governing selection of objects to return. Defaults to + None. """ try: query = self.session.query(object_class) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index 37ee42451..22f04ec08 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -199,7 +199,8 @@ def init_schema(url): Column(u'search_lyrics', types.UnicodeText, nullable=False), Column(u'create_date', types.DateTime(), default=func.now()), Column(u'last_modified', types.DateTime(), default=func.now(), - onupdate=func.now()) + onupdate=func.now()), + Column(u'temporary', types.Unicode(1), default=u'N') ) # Definition of the "topics" table diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index dad95c61b..0af1a56a7 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -270,6 +270,9 @@ class SongMediaItem(MediaManagerItem): searchresults.sort( cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in searchresults: + # Do not display temporary songs + if song.temporary == u'Y': + break author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) song_detail = u'%s (%s)' % (song_title, u', '.join(author_list)) @@ -286,6 +289,9 @@ class SongMediaItem(MediaManagerItem): self.listView.clear() for author in searchresults: for song in author.songs: + # Do not display temporary songs + if song.temporary == u'Y': + break song_detail = u'%s (%s)' % (author.display_name, song.title) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) @@ -561,7 +567,8 @@ class SongMediaItem(MediaManagerItem): self.onSearchTextButtonClick() else: # Make sure we temporary import formatting tags. - self.openLyrics.xml_to_song(item.xml_version, True) + song = self.openLyrics.xml_to_song(item.xml_version, True) + #editId = song.id # Update service with correct song id. if editId: Receiver.send_message(u'service_item_update', diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index 7752c7e33..6d56467e8 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -34,7 +34,9 @@ from sqlalchemy.sql.expression import func from migrate import changeset from migrate.changeset.constraint import ForeignKeyConstraint -__version__ = 2 +from openlp.plugins.songs.lib.db import Song + +__version__ = 3 def upgrade_setup(metadata): """ @@ -86,4 +88,13 @@ def upgrade_2(session, metadata, tables): .create(table=tables[u'songs']) Column(u'last_modified', types.DateTime(), default=func.now())\ .create(table=tables[u'songs']) + +def upgrade_3(session, metadata, tables): + """ + Version 3 upgrade. + + This upgrade adds a temporary song flag to the songs table + """ + Column(u'temporary', types.Unicode(1), default=u'N')\ + .create(table=tables[u'songs']) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index aaf82b395..ee4ed74bd 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -372,13 +372,13 @@ class OpenLyrics(object): # Formatting tags are new in OpenLyrics 0.8 if float(song_xml.get(u'version')) > 0.7: self._process_formatting_tags(song_xml, parse_and_not_save) - if parse_and_not_save: - return song = Song() # Values will be set when cleaning the song. song.search_lyrics = u'' song.verse_order = u'' song.search_title = u'' + if parse_and_not_save: + song.temporary = u'Y' self._process_copyright(properties, song) self._process_cclinumber(properties, song) self._process_titles(properties, song) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 54b1d3f1f..57ddb4bae 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -261,6 +261,9 @@ class SongsPlugin(Plugin): Time to tidy up on exit """ log.info(u'Songs Finalising') + # Remove temporary songs + self.manager.delete_all_objects(Song, Song.temporary == u'Y') + # Clean up files and connections self.manager.finalise() self.songImportItem.setVisible(False) self.songExportItem.setVisible(False) From 8c4397d380356e88d253913e914900b8d1ab004f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 3 Dec 2011 17:01:57 +0000 Subject: [PATCH 02/69] Head --- openlp/core/lib/db.py | 6 ++++-- openlp/plugins/songs/lib/mediaitem.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 8c39750b5..9a328c552 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -201,7 +201,9 @@ class Manager(object): settings.endGroup() if upgrade_mod: db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod) + print db_ver, up_ver, db_ver > up_ver if db_ver > up_ver: + print "hello" critical_error_message_box( translate('OpenLP.Manager', 'Database Error'), unicode(translate('OpenLP.Manager', 'The database being ' @@ -361,10 +363,10 @@ class Manager(object): ``object_class`` The type of object to delete - + ``filter_clause`` The filter governing selection of objects to return. Defaults to - None. + None. """ try: query = self.session.query(object_class) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0af1a56a7..6ded39f83 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -272,7 +272,7 @@ class SongMediaItem(MediaManagerItem): for song in searchresults: # Do not display temporary songs if song.temporary == u'Y': - break + continue author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) song_detail = u'%s (%s)' % (song_title, u', '.join(author_list)) @@ -291,7 +291,7 @@ class SongMediaItem(MediaManagerItem): for song in author.songs: # Do not display temporary songs if song.temporary == u'Y': - break + continue song_detail = u'%s (%s)' % (author.display_name, song.title) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) @@ -568,7 +568,7 @@ class SongMediaItem(MediaManagerItem): else: # Make sure we temporary import formatting tags. song = self.openLyrics.xml_to_song(item.xml_version, True) - #editId = song.id + editId = song.id # Update service with correct song id. if editId: Receiver.send_message(u'service_item_update', From 6698ce578d0f7dde066aaec8c7a36d1393418ca8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 3 Dec 2011 19:08:02 +0000 Subject: [PATCH 03/69] Change Data type --- openlp/core/lib/db.py | 1 - openlp/plugins/songs/lib/db.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- openlp/plugins/songs/lib/upgrade.py | 4 ++-- openlp/plugins/songs/lib/xml.py | 2 +- openlp/plugins/songs/songsplugin.py | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index c23cb065e..4a9cb0968 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -202,7 +202,6 @@ class Manager(object): settings.endGroup() if upgrade_mod: db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod) - print db_ver, up_ver, db_ver > up_ver if db_ver > up_ver: print "hello" critical_error_message_box( diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index 22f04ec08..ce228e5f8 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -200,7 +200,7 @@ def init_schema(url): Column(u'create_date', types.DateTime(), default=func.now()), Column(u'last_modified', types.DateTime(), default=func.now(), onupdate=func.now()), - Column(u'temporary', types.Unicode(1), default=u'N') + Column(u'temporary', types.Boolean(), default=False) ) # Definition of the "topics" table diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6ded39f83..c73966dd2 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -271,7 +271,7 @@ class SongMediaItem(MediaManagerItem): cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in searchresults: # Do not display temporary songs - if song.temporary == u'Y': + if song.temporary: continue author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) @@ -290,7 +290,7 @@ class SongMediaItem(MediaManagerItem): for author in searchresults: for song in author.songs: # Do not display temporary songs - if song.temporary == u'Y': + if song.temporary: continue song_detail = u'%s (%s)' % (author.display_name, song.title) song_name = QtGui.QListWidgetItem(song_detail) diff --git a/openlp/plugins/songs/lib/upgrade.py b/openlp/plugins/songs/lib/upgrade.py index 819a13d2d..25f90e860 100644 --- a/openlp/plugins/songs/lib/upgrade.py +++ b/openlp/plugins/songs/lib/upgrade.py @@ -87,13 +87,13 @@ def upgrade_2(session, metadata, tables): .create(table=tables[u'songs']) Column(u'last_modified', types.DateTime(), default=func.now())\ .create(table=tables[u'songs']) - + def upgrade_3(session, metadata, tables): """ Version 3 upgrade. This upgrade adds a temporary song flag to the songs table """ - Column(u'temporary', types.Unicode(1), default=u'N')\ + Column(u'temporary', types.Boolean(), default=False)\ .create(table=tables[u'songs']) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index ee4ed74bd..99427d979 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -378,7 +378,7 @@ class OpenLyrics(object): song.verse_order = u'' song.search_title = u'' if parse_and_not_save: - song.temporary = u'Y' + song.temporary = True self._process_copyright(properties, song) self._process_cclinumber(properties, song) self._process_titles(properties, song) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 19f688186..39e1360fa 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -265,7 +265,7 @@ class SongsPlugin(Plugin): """ log.info(u'Songs Finalising') # Remove temporary songs - self.manager.delete_all_objects(Song, Song.temporary == u'Y') + self.manager.delete_all_objects(Song, Song.temporary == True) # Clean up files and connections self.manager.finalise() self.songImportItem.setVisible(False) From 456d7ec68ea2d05ac4445908727e29b9c0d87d11 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 4 Dec 2011 07:27:49 +0000 Subject: [PATCH 04/69] remove print --- openlp/core/lib/db.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 4a9cb0968..160a404a5 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -203,7 +203,6 @@ class Manager(object): if upgrade_mod: db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod) if db_ver > up_ver: - print "hello" critical_error_message_box( translate('OpenLP.Manager', 'Database Error'), unicode(translate('OpenLP.Manager', 'The database being ' From c825df38fad9bd0a745c09f3f1d9dc5a9bb38a9a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 4 Dec 2011 15:26:27 +0200 Subject: [PATCH 05/69] Hopefully the final piece of the fix. --- openlp/plugins/songs/lib/olpimport.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index d7a735033..598815c8f 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -145,6 +145,7 @@ class OpenLPSongImport(SongImport): else: song_props['media_files'] = relation(OldMediaFile, backref='songs', + foreign_keys=[source_media_files_table.c.song_id], primaryjoin=source_songs_table.c.id == \ source_media_files_table.c.song_id) try: From 5804dade748154574e775035ca6a5483983f84e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 4 Dec 2011 14:42:39 +0000 Subject: [PATCH 06/69] Reduce recent file list duplication (Bug #892668) --- openlp/core/ui/mainwindow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9d546629b..b0640513a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1312,7 +1312,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): settings.value(u'preview splitter geometry').toByteArray()) self.controlSplitter.restoreState( settings.value(u'mainwindow splitter geometry').toByteArray()) - settings.endGroup() def saveSettings(self): @@ -1388,6 +1387,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): maxRecentFiles = QtCore.QSettings().value(u'advanced/max recent files', QtCore.QVariant(20)).toInt()[0] if filename: + # Add some cleanup to reduce duplication in the recent file list + filename = os.path.abspath(filename) + # abspath() only capitalises the drive letter if it wasn't provided + # in the given filename which then causes duplication. + if filename[1:3] == ':\\': + filename = filename[0].upper() + filename[1:] position = self.recentFiles.indexOf(filename) if position != -1: self.recentFiles.removeAt(position) From f751ae092a566cd783466c334c4fd8bb68eaa406 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 4 Dec 2011 16:19:45 +0000 Subject: [PATCH 07/69] fix exit code --- openlp/plugins/songs/songsplugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 39e1360fa..4f0e9d77a 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -265,7 +265,9 @@ class SongsPlugin(Plugin): """ log.info(u'Songs Finalising') # Remove temporary songs - self.manager.delete_all_objects(Song, Song.temporary == True) + songs = self.manager.get_all_objects(Song, Song.temporary == True) + for song in songs: + self.manager.delete_object(Song, song.id) # Clean up files and connections self.manager.finalise() self.songImportItem.setVisible(False) From 17bca693c6b3f3af40937ec526aaa4872c0f0da6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 4 Dec 2011 16:36:18 +0000 Subject: [PATCH 08/69] Block song exports --- openlp/core/lib/db.py | 5 ++++- openlp/plugins/songs/forms/songexportform.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 160a404a5..b6f12d180 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -358,7 +358,10 @@ class Manager(object): def delete_all_objects(self, object_class, filter_clause=None): """ - Delete all object records + Delete all object records. + This method should only be used for simple tables and not ones with + relationships. The relationships are not deleted from the database and + this will lead to database corruptions. ``object_class`` The type of object to delete diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 22020a401..20a52c82d 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -252,6 +252,9 @@ class SongExportForm(OpenLPWizard): songs = self.plugin.manager.get_all_objects(Song) songs.sort(cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in songs: + # No need to export temporary songs. + if song.temporary: + continue authors = u', '.join([author.display_name for author in song.authors]) title = u'%s (%s)' % (unicode(song.title), authors) From 06570a9941f89279f9252516cccccdd11d545814 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 4 Dec 2011 22:50:13 +0200 Subject: [PATCH 09/69] Fixed a minor bug where if you imported 2 OpenLP 2.0 databases in the same OpenLP session whose schemas were different, you'd get an error. --- openlp/plugins/songs/lib/olpimport.py | 74 +++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index 598815c8f..7187950b7 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -30,7 +30,7 @@ song databases into the current installation database. """ import logging -from sqlalchemy import create_engine, MetaData +from sqlalchemy import create_engine, MetaData, Table from sqlalchemy.orm import class_mapper, mapper, relation, scoped_session, \ sessionmaker from sqlalchemy.orm.exc import UnmappedClassError @@ -44,41 +44,6 @@ from songimport import SongImport log = logging.getLogger(__name__) -class OldAuthor(BaseModel): - """ - Author model - """ - pass - - -class OldBook(BaseModel): - """ - Book model - """ - pass - - -class OldMediaFile(BaseModel): - """ - MediaFile model - """ - pass - - -class OldSong(BaseModel): - """ - Song model - """ - pass - - -class OldTopic(BaseModel): - """ - Topic model - """ - pass - - class OpenLPSongImport(SongImport): """ The :class:`OpenLPSongImport` class provides OpenLP with the ability to @@ -101,6 +66,41 @@ class OpenLPSongImport(SongImport): """ Run the import for an OpenLP version 2 song database. """ + class OldAuthor(BaseModel): + """ + Author model + """ + pass + + + class OldBook(BaseModel): + """ + Book model + """ + pass + + + class OldMediaFile(BaseModel): + """ + MediaFile model + """ + pass + + + class OldSong(BaseModel): + """ + Song model + """ + pass + + + class OldTopic(BaseModel): + """ + Topic model + """ + pass + + if not self.importSource.endswith(u'.sqlite'): self.logError(self.importSource, translate('SongsPlugin.OpenLPSongImport', @@ -138,7 +138,7 @@ class OpenLPSongImport(SongImport): secondary=source_songs_topics_table) } if has_media_files: - if source_media_files_songs_table is not None: + if isinstance(source_media_files_songs_table, Table): song_props['media_files'] = relation(OldMediaFile, backref='songs', secondary=source_media_files_songs_table) From a54e7ff709c6863a3de684760ee267510f114e98 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 4 Dec 2011 20:57:58 +0000 Subject: [PATCH 10/69] Fix non-ascii service filename loading --- openlp/core/ui/mainwindow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index b0640513a..663f6c75a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -720,7 +720,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): args = [] for a in self.arguments: args.extend([a]) - self.serviceManagerContents.loadFile(unicode(args[0])) + self.serviceManagerContents.loadFile(unicode(args[0], + sys.getfilesystemencoding())) elif QtCore.QSettings().value( self.generalSettingsSection + u'/auto open', QtCore.QVariant(False)).toBool(): From d05c6b8d70e0c2c7851a4200a45769d682c9385f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 5 Dec 2011 19:47:50 +0000 Subject: [PATCH 11/69] Fix up song import code --- openlp/plugins/songs/lib/mediaitem.py | 7 +++++-- openlp/plugins/songs/lib/xml.py | 13 ++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index c73966dd2..c5b59b0fe 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -558,16 +558,19 @@ class SongMediaItem(MediaManagerItem): # If there's any backing tracks, copy them over. if len(item.background_audio) > 0: self._updateBackgroundAudio(song, item) - if add_song and self.addSongFromService: + if add_song: song = self.openLyrics.xml_to_song(item.xml_version) # If there's any backing tracks, copy them over. if len(item.background_audio) > 0: self._updateBackgroundAudio(song, item) editId = song.id self.onSearchTextButtonClick() - else: + elif not self.addSongFromService: # Make sure we temporary import formatting tags. song = self.openLyrics.xml_to_song(item.xml_version, True) + # If there's any backing tracks, copy them over. + if len(item.background_audio) > 0: + self._updateBackgroundAudio(song, item) editId = song.id # Update service with correct song id. if editId: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 99427d979..b16db7e94 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -346,7 +346,7 @@ class OpenLyrics(object): lines_element.set(u'break', u'optional') return self._extract_xml(song_xml) - def xml_to_song(self, xml, parse_and_not_save=False): + def xml_to_song(self, xml, parse_and_temporary_save=False): """ Create and save a song from OpenLyrics format xml to the database. Since we also export XML from external sources (e. g. OpenLyrics import), we @@ -355,9 +355,9 @@ class OpenLyrics(object): ``xml`` The XML to parse (unicode). - ``parse_and_not_save`` - Switch to skip processing the whole song and to prevent storing the - songs to the database. Defaults to ``False``. + ``parse_and_temporary_save`` + Switch to skip processing the whole song and storing the songs in + the database with a temporary flag. Defaults to ``False``. """ # No xml get out of here. if not xml: @@ -371,14 +371,13 @@ class OpenLyrics(object): return None # Formatting tags are new in OpenLyrics 0.8 if float(song_xml.get(u'version')) > 0.7: - self._process_formatting_tags(song_xml, parse_and_not_save) + self._process_formatting_tags(song_xml, parse_and_temporary_save) song = Song() # Values will be set when cleaning the song. song.search_lyrics = u'' song.verse_order = u'' song.search_title = u'' - if parse_and_not_save: - song.temporary = True + song.temporary = parse_and_temporary_save self._process_copyright(properties, song) self._process_cclinumber(properties, song) self._process_titles(properties, song) From 04d7669948400497e3b5e067893affaa63c14586 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 5 Dec 2011 21:40:56 +0000 Subject: [PATCH 12/69] Fix non-ascii file check on Macs --- openlp/core/ui/mainwindow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 663f6c75a..0974f53fb 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -720,8 +720,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): args = [] for a in self.arguments: args.extend([a]) - self.serviceManagerContents.loadFile(unicode(args[0], - sys.getfilesystemencoding())) + filename = args[0] + if not isinstance(filename, unicode): + filename = unicode(filename, sys.getfilesystemencoding()) + self.serviceManagerContents.loadFile(filename) elif QtCore.QSettings().value( self.generalSettingsSection + u'/auto open', QtCore.QVariant(False)).toBool(): From 36e729303c925705f942d10431f5dc262c2b203f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 6 Dec 2011 20:25:12 +0100 Subject: [PATCH 13/69] reverted changes --- openlp/core/utils/actions.py | 59 +++--------------------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 525a18f37..86ee69a48 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -188,7 +188,6 @@ class ActionList(object): actions or categories. """ instance = None - shortcut_map = {} def __init__(self): self.categories = CategoryList() @@ -227,41 +226,17 @@ class ActionList(object): self.categories[category].actions.append(action) else: self.categories[category].actions.add(action, weight) + if category is None: + # Stop here, as this action is not configurable. + return # Load the shortcut from the config. settings = QtCore.QSettings() settings.beginGroup(u'shortcuts') shortcuts = settings.value(action.objectName(), QtCore.QVariant(action.shortcuts())).toStringList() - settings.endGroup() - if not shortcuts: - action.setShortcuts([]) - return - shortcuts = map(unicode, shortcuts) - # Check the alternate shortcut first, to avoid problems when the - # alternate shortcut becomes the primary shortcut after removing the - # (initial) primary shortcut due to confllicts. - if len(shortcuts) == 2: - existing_actions = ActionList.shortcut_map.get(shortcuts[1], []) - # Check for conflicts with other actions considering the shortcut - # context. - if self._shortcut_available(existing_actions, action): - actions = ActionList.shortcut_map.get(shortcuts[1], []) - actions.append(action) - ActionList.shortcut_map[shortcuts[1]] = actions - else: - shortcuts.remove(shortcuts[1]) - # Check the primary shortcut. - existing_actions = ActionList.shortcut_map.get(shortcuts[0], []) - # Check for conflicts with other actions considering the shortcut - # context. - if self._shortcut_available(existing_actions, action): - actions = ActionList.shortcut_map.get(shortcuts[0], []) - actions.append(action) - ActionList.shortcut_map[shortcuts[0]] = actions - else: - shortcuts.remove(shortcuts[0]) action.setShortcuts( [QtGui.QKeySequence(shortcut) for shortcut in shortcuts]) + settings.endGroup() def remove_action(self, action, category=None): """ @@ -269,7 +244,7 @@ class ActionList(object): automatically removed. ``action`` - The ``QAction`` object to be removed. + The QAction object to be removed. ``category`` The name (unicode string) of the category, which contains the @@ -304,30 +279,6 @@ class ActionList(object): return self.categories.add(name, weight) - def _shortcut_available(self, existing_actions, action): - """ - Checks if the given ``action`` may use its assigned shortcut(s) or not. - Returns ``True`` or ``False. - - ``existing_actions`` - A list of actions which already use a particular shortcut. - - ``action`` - The action which wants to use a particular shortcut. - """ - for existing_action in existing_actions: - if action is existing_action: - continue - if existing_action.parent() is action.parent(): - return False - if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, - QtCore.Qt.ApplicationShortcut]: - return False - if action.shortcutContext() in [QtCore.Qt.WindowShortcut, - QtCore.Qt.ApplicationShortcut]: - return False - return True - class CategoryOrder(object): """ From 38a2a3dee229310aaa42f10dbc1ba94b9ea4342e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 6 Dec 2011 20:30:39 +0100 Subject: [PATCH 14/69] fixed bug 768495 --- openlp/core/utils/actions.py | 59 +++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 86ee69a48..525a18f37 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -188,6 +188,7 @@ class ActionList(object): actions or categories. """ instance = None + shortcut_map = {} def __init__(self): self.categories = CategoryList() @@ -226,17 +227,41 @@ class ActionList(object): self.categories[category].actions.append(action) else: self.categories[category].actions.add(action, weight) - if category is None: - # Stop here, as this action is not configurable. - return # Load the shortcut from the config. settings = QtCore.QSettings() settings.beginGroup(u'shortcuts') shortcuts = settings.value(action.objectName(), QtCore.QVariant(action.shortcuts())).toStringList() + settings.endGroup() + if not shortcuts: + action.setShortcuts([]) + return + shortcuts = map(unicode, shortcuts) + # Check the alternate shortcut first, to avoid problems when the + # alternate shortcut becomes the primary shortcut after removing the + # (initial) primary shortcut due to confllicts. + if len(shortcuts) == 2: + existing_actions = ActionList.shortcut_map.get(shortcuts[1], []) + # Check for conflicts with other actions considering the shortcut + # context. + if self._shortcut_available(existing_actions, action): + actions = ActionList.shortcut_map.get(shortcuts[1], []) + actions.append(action) + ActionList.shortcut_map[shortcuts[1]] = actions + else: + shortcuts.remove(shortcuts[1]) + # Check the primary shortcut. + existing_actions = ActionList.shortcut_map.get(shortcuts[0], []) + # Check for conflicts with other actions considering the shortcut + # context. + if self._shortcut_available(existing_actions, action): + actions = ActionList.shortcut_map.get(shortcuts[0], []) + actions.append(action) + ActionList.shortcut_map[shortcuts[0]] = actions + else: + shortcuts.remove(shortcuts[0]) action.setShortcuts( [QtGui.QKeySequence(shortcut) for shortcut in shortcuts]) - settings.endGroup() def remove_action(self, action, category=None): """ @@ -244,7 +269,7 @@ class ActionList(object): automatically removed. ``action`` - The QAction object to be removed. + The ``QAction`` object to be removed. ``category`` The name (unicode string) of the category, which contains the @@ -279,6 +304,30 @@ class ActionList(object): return self.categories.add(name, weight) + def _shortcut_available(self, existing_actions, action): + """ + Checks if the given ``action`` may use its assigned shortcut(s) or not. + Returns ``True`` or ``False. + + ``existing_actions`` + A list of actions which already use a particular shortcut. + + ``action`` + The action which wants to use a particular shortcut. + """ + for existing_action in existing_actions: + if action is existing_action: + continue + if existing_action.parent() is action.parent(): + return False + if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, + QtCore.Qt.ApplicationShortcut]: + return False + if action.shortcutContext() in [QtCore.Qt.WindowShortcut, + QtCore.Qt.ApplicationShortcut]: + return False + return True + class CategoryOrder(object): """ From 1830cfbe9e1192bac2925bc7544807f85323a9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 6 Dec 2011 23:25:04 +0200 Subject: [PATCH 15/69] Ensure that action category names are unicode, to prevent warnings on comparison. --- openlp/core/utils/actions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 86ee69a48..26a0c48e8 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -149,6 +149,8 @@ class CategoryList(object): return self.__next__() def has_key(self, key): + if key != None and not isinstance(key, unicode): + key = unicode(key) for category in self.categories: if category.name == key: return True @@ -164,6 +166,8 @@ class CategoryList(object): self.add(name, weight) def add(self, name, weight=0, actions=None): + if name != None and not isinstance(name, unicode): + name = unicode(name) category = ActionCategory(name, weight) if actions: for action in actions: @@ -270,6 +274,8 @@ class ActionList(object): ``weight`` The category's weight (int). """ + if name != None and not isinstance(name, unicode): + name = unicode(name) if name in self.categories: # Only change the weight and resort the categories again. for category in self.categories: From b5dfba86fb42e7a4d56c98cba8e111ff0206fd61 Mon Sep 17 00:00:00 2001 From: rimach Date: Tue, 6 Dec 2011 22:42:34 +0100 Subject: [PATCH 16/69] bugfixing --- openlp/core/ui/media/mediacontroller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index c4e3e7fa9..b58afeb1e 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -311,8 +311,13 @@ class MediaController(object): isValid = self.check_file_type(controller, display) display.override[u'theme'] = u'' display.override[u'video'] = True - controller.media_info.start_time = display.serviceItem.start_time - controller.media_info.end_time = display.serviceItem.end_time + if controller.media_info.is_background: + # ignore start/end time + controller.media_info.start_time = 0 + controller.media_info.end_time = 0 + else: + controller.media_info.start_time = display.serviceItem.start_time + controller.media_info.end_time = display.serviceItem.end_time elif controller.previewDisplay: display = controller.previewDisplay isValid = self.check_file_type(controller, display) From ef3e3252e77e3e329d89bdac90b8ae88e428982f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 7 Dec 2011 00:37:56 +0200 Subject: [PATCH 17/69] Comparison to None is discouraged --- openlp/core/utils/actions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 26a0c48e8..37c2676ac 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -149,7 +149,7 @@ class CategoryList(object): return self.__next__() def has_key(self, key): - if key != None and not isinstance(key, unicode): + if key and not isinstance(key, unicode): key = unicode(key) for category in self.categories: if category.name == key: @@ -166,7 +166,7 @@ class CategoryList(object): self.add(name, weight) def add(self, name, weight=0, actions=None): - if name != None and not isinstance(name, unicode): + if name and not isinstance(name, unicode): name = unicode(name) category = ActionCategory(name, weight) if actions: @@ -274,7 +274,7 @@ class ActionList(object): ``weight`` The category's weight (int). """ - if name != None and not isinstance(name, unicode): + if name and not isinstance(name, unicode): name = unicode(name) if name in self.categories: # Only change the weight and resort the categories again. From 12547fad2a597a20df1a2fb97d84d0a587ce239e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 7 Dec 2011 21:25:12 +0100 Subject: [PATCH 18/69] doc clean up, removed method with a one liner, fixed media item recreation bug --- openlp/core/lib/plugin.py | 21 ++++++------- openlp/core/lib/pluginmanager.py | 30 ++++--------------- openlp/core/ui/mainwindow.py | 2 +- openlp/plugins/media/mediaplugin.py | 2 +- .../presentations/presentationplugin.py | 4 +-- openlp/plugins/songs/forms/editsongform.py | 2 +- 6 files changed, 22 insertions(+), 39 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 76e54ef8d..92ac0be64 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -91,8 +91,9 @@ class Plugin(QtCore.QObject): ``checkPreConditions()`` Provides the Plugin with a handle to check if it can be loaded. - ``getMediaManagerItem()`` - Returns an instance of MediaManagerItem to be used in the Media Manager. + ``createMediaManagerItem()`` + Creates a new instance of MediaManagerItem to be used in the Media + Manager. ``addImportMenuItem(import_menu)`` Add an item to the Import menu. @@ -100,8 +101,8 @@ class Plugin(QtCore.QObject): ``addExportMenuItem(export_menu)`` Add an item to the Export menu. - ``getSettingsTab()`` - Returns an instance of SettingsTabItem to be used in the Settings + ``createSettingsTab()`` + Creates a new instance of SettingsTabItem to be used in the Settings dialog. ``addToMenu(menubar)`` @@ -178,7 +179,7 @@ class Plugin(QtCore.QObject): Provides the Plugin with a handle to check if it can be loaded. Failing Preconditions does not stop a settings Tab being created - Returns True or False. + Returns ``True`` or ``False``. """ return True @@ -210,10 +211,10 @@ class Plugin(QtCore.QObject): """ return self.status == PluginStatus.Active - def getMediaManagerItem(self): + def createMediaManagerItem(self): """ Construct a MediaManagerItem object with all the buttons and things - you need, and return it for integration into openlp.org. + you need, and return it for integration into OpenLP. """ if self.media_item_class: return self.media_item_class(self.mediadock.media_dock, self, @@ -247,10 +248,10 @@ class Plugin(QtCore.QObject): """ pass - def getSettingsTab(self, parent): + def createSettingsTab(self, parent): """ - Create a tab for the settings window to display the configurable - options for this plugin to the user. + Create a tab for the settings window to display the configurable options + for this plugin to the user. """ if self.settings_tab_class: return self.settings_tab_class(parent, self.name, diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index db5d9b60e..e29176386 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -113,7 +113,7 @@ class PluginManager(object): plugin_objects.append(plugin) except TypeError: log.exception(u'Failed to load plugin %s', unicode(p)) - plugins_list = sorted(plugin_objects, self.order_by_weight) + plugins_list = sorted(plugin_objects, key=lambda plugin: plugin.weight) for plugin in plugins_list: if plugin.checkPreConditions(): log.debug(u'Plugin %s active', unicode(plugin.name)) @@ -122,29 +122,13 @@ class PluginManager(object): plugin.status = PluginStatus.Disabled self.plugins.append(plugin) - def order_by_weight(self, x, y): + def hook_media_manager(self): """ - Sort two plugins and order them by their weight. - - ``x`` - The first plugin. - - ``y`` - The second plugin. - """ - return cmp(x.weight, y.weight) - - def hook_media_manager(self, mediadock): - """ - Loop through all the plugins. If a plugin has a valid media manager - item, add it to the media manager. - - ``mediatoolbox`` - The Media Manager itself. + Create the plugins' media manager items. """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.mediaItem = plugin.getMediaManagerItem() + plugin.mediaItem = plugin.createMediaManagerItem() def hook_settings_tabs(self, settings_form=None): """ @@ -152,14 +136,12 @@ class PluginManager(object): item, add it to the settings tab. Tabs are set for all plugins not just Active ones - ``settingsform`` + ``settings_form`` Defaults to *None*. The settings form to add tabs to. """ for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: - plugin.settings_tab = plugin.getSettingsTab(settings_form) - else: - plugin.settings_tab = None + plugin.settings_tab = plugin.createSettingsTab(settings_form) settings_form.plugins = self.plugins def hook_import_menu(self, import_menu): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9d546629b..be04455f6 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -655,7 +655,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginManager.hook_settings_tabs(self.settingsForm) # Find and insert media manager items log.info(u'hook media') - self.pluginManager.hook_media_manager(self.mediaDockManager) + self.pluginManager.hook_media_manager() # Call the hook method to pull in import menus. log.info(u'hook menus') self.pluginManager.hook_import_menu(self.fileImportMenu) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 97f749689..41965d612 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -52,7 +52,7 @@ class MediaPlugin(Plugin): for ext in self.video_extensions_list: self.serviceManager.supportedSuffixes(ext[2:]) - def getSettingsTab(self, parent): + def createSettingsTab(self, parent): """ Create the settings Tab """ diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 643ad14ad..7baf659e0 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -57,7 +57,7 @@ class PresentationPlugin(Plugin): self.icon_path = u':/plugins/plugin_presentations.png' self.icon = build_icon(self.icon_path) - def getSettingsTab(self, parent): + def createSettingsTab(self, parent): """ Create the settings Tab """ @@ -94,7 +94,7 @@ class PresentationPlugin(Plugin): controller.kill() Plugin.finalise(self) - def getMediaManagerItem(self): + def createMediaManagerItem(self): """ Create the Media Manager List """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index c1566a639..776c3c88b 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -181,7 +181,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): plugin.status == PluginStatus.Active: self.audioAddFromMediaButton.setVisible(True) self.mediaForm.populateFiles( - plugin.getMediaManagerItem().getList(MediaType.Audio)) + plugin.mediaItem.getList(MediaType.Audio)) break def newSong(self): From 32f2dcac59f67adba301a4e018023b14f9ed01b9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 7 Dec 2011 21:28:26 +0100 Subject: [PATCH 19/69] reverted change --- openlp/core/utils/actions.py | 59 +++--------------------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 525a18f37..86ee69a48 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -188,7 +188,6 @@ class ActionList(object): actions or categories. """ instance = None - shortcut_map = {} def __init__(self): self.categories = CategoryList() @@ -227,41 +226,17 @@ class ActionList(object): self.categories[category].actions.append(action) else: self.categories[category].actions.add(action, weight) + if category is None: + # Stop here, as this action is not configurable. + return # Load the shortcut from the config. settings = QtCore.QSettings() settings.beginGroup(u'shortcuts') shortcuts = settings.value(action.objectName(), QtCore.QVariant(action.shortcuts())).toStringList() - settings.endGroup() - if not shortcuts: - action.setShortcuts([]) - return - shortcuts = map(unicode, shortcuts) - # Check the alternate shortcut first, to avoid problems when the - # alternate shortcut becomes the primary shortcut after removing the - # (initial) primary shortcut due to confllicts. - if len(shortcuts) == 2: - existing_actions = ActionList.shortcut_map.get(shortcuts[1], []) - # Check for conflicts with other actions considering the shortcut - # context. - if self._shortcut_available(existing_actions, action): - actions = ActionList.shortcut_map.get(shortcuts[1], []) - actions.append(action) - ActionList.shortcut_map[shortcuts[1]] = actions - else: - shortcuts.remove(shortcuts[1]) - # Check the primary shortcut. - existing_actions = ActionList.shortcut_map.get(shortcuts[0], []) - # Check for conflicts with other actions considering the shortcut - # context. - if self._shortcut_available(existing_actions, action): - actions = ActionList.shortcut_map.get(shortcuts[0], []) - actions.append(action) - ActionList.shortcut_map[shortcuts[0]] = actions - else: - shortcuts.remove(shortcuts[0]) action.setShortcuts( [QtGui.QKeySequence(shortcut) for shortcut in shortcuts]) + settings.endGroup() def remove_action(self, action, category=None): """ @@ -269,7 +244,7 @@ class ActionList(object): automatically removed. ``action`` - The ``QAction`` object to be removed. + The QAction object to be removed. ``category`` The name (unicode string) of the category, which contains the @@ -304,30 +279,6 @@ class ActionList(object): return self.categories.add(name, weight) - def _shortcut_available(self, existing_actions, action): - """ - Checks if the given ``action`` may use its assigned shortcut(s) or not. - Returns ``True`` or ``False. - - ``existing_actions`` - A list of actions which already use a particular shortcut. - - ``action`` - The action which wants to use a particular shortcut. - """ - for existing_action in existing_actions: - if action is existing_action: - continue - if existing_action.parent() is action.parent(): - return False - if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, - QtCore.Qt.ApplicationShortcut]: - return False - if action.shortcutContext() in [QtCore.Qt.WindowShortcut, - QtCore.Qt.ApplicationShortcut]: - return False - return True - class CategoryOrder(object): """ From 66c183a6b8ee84f63de92a83680887a85cb4e699 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 7 Dec 2011 21:41:19 +0100 Subject: [PATCH 20/69] break instead of continue --- openlp/core/lib/pluginmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index e29176386..b124dce9e 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -90,7 +90,7 @@ class PluginManager(object): thisdepth = len(path.split(os.sep)) if thisdepth - startdepth > 2: # skip anything lower down - continue + break modulename = os.path.splitext(path)[0] prefix = os.path.commonprefix([self.basepath, path]) # hack off the plugin base path From 1c79b2846123ab47b8c19429d433f749a78ecd5f Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 7 Dec 2011 21:56:06 +0000 Subject: [PATCH 21/69] Workaround justify and outline alignment problems --- openlp/core/lib/htmlbuilder.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 9bce2bcac..a9ef1a38b 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -85,6 +85,7 @@ sup { From ecba19f124933f175198b97942ef6bb238da6e72 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 8 Dec 2011 19:42:31 +0000 Subject: [PATCH 28/69] Fixes --- openlp/plugins/songs/lib/mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index c5b59b0fe..be6dfa6be 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -558,7 +558,7 @@ class SongMediaItem(MediaManagerItem): # If there's any backing tracks, copy them over. if len(item.background_audio) > 0: self._updateBackgroundAudio(song, item) - if add_song: + if add_song and self.addSongFromService: song = self.openLyrics.xml_to_song(item.xml_version) # If there's any backing tracks, copy them over. if len(item.background_audio) > 0: From c36a13d0a8e85b3c6a17b7f285c0ee503d597923 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 8 Dec 2011 19:49:43 +0000 Subject: [PATCH 29/69] Remove webkit version in js --- openlp/core/lib/htmlbuilder.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index fba1a25fa..29b8c3335 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -85,7 +85,6 @@ sup {