From 0412fca642a0cdc890d4b4f80acb7b9ad8e935d1 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 11 Sep 2010 13:42:50 +0100 Subject: [PATCH 1/5] Remove execuitable flag --- openlp/plugins/remotes/html/jquery.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 openlp/plugins/remotes/html/jquery.js diff --git a/openlp/plugins/remotes/html/jquery.js b/openlp/plugins/remotes/html/jquery.js old mode 100755 new mode 100644 From 8d51128e0cc8358779cee5a41637abaf5b775493 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 11 Sep 2010 15:03:10 +0100 Subject: [PATCH 2/5] Fix translation code to find qm files --- openlp/core/utils/languagemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 275d6985b..1aacbfa5d 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -66,7 +66,7 @@ class LanguageManager(object): Find all available language files in this OpenLP install """ trans_dir = AppLocation.get_directory(AppLocation.AppDir) - trans_dir = QtCore.QDir(os.path.join(trans_dir, u'resources', u'i18n')) + trans_dir = QtCore.QDir(os.path.join(trans_dir,u'openlp', u'i18n')) file_names = trans_dir.entryList(QtCore.QStringList("*.qm"), QtCore.QDir.Files, QtCore.QDir.Name) for name in file_names: From 7b46f33cdea1004f0476dd9b1e8a30f3dae5b183 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 11 Sep 2010 16:58:03 +0100 Subject: [PATCH 3/5] Space --- openlp/core/utils/languagemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 1aacbfa5d..bcb16e7cc 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -66,7 +66,7 @@ class LanguageManager(object): Find all available language files in this OpenLP install """ trans_dir = AppLocation.get_directory(AppLocation.AppDir) - trans_dir = QtCore.QDir(os.path.join(trans_dir,u'openlp', u'i18n')) + trans_dir = QtCore.QDir(os.path.join(trans_dir, u'openlp', u'i18n')) file_names = trans_dir.entryList(QtCore.QStringList("*.qm"), QtCore.QDir.Files, QtCore.QDir.Name) for name in file_names: From c1ed2a76e2c0c2f5ee434d54742ec959bce461c7 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 11 Sep 2010 20:51:27 +0200 Subject: [PATCH 4/5] Detect v1.0 database at the beginning of the import, not half way through. Do some detection of the encoding. --- openlp/plugins/songs/lib/olp1import.py | 49 +++++++++++++++++++------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index 51e3e1fbf..0fc03a01d 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -28,6 +28,7 @@ The :mod:`olp1import` module provides the functionality for importing openlp.org 1.x song databases into the current installation database. """ import logging +import chardet try: import sqlite except: @@ -63,6 +64,11 @@ class OpenLP1SongImport(SongImport): # Connect to the database connection = sqlite.connect(self.import_source) cursor = connection.cursor() + # Determine if we're using a new or an old DB + cursor.execute(u'SELECT name FROM sqlite_master ' + u'WHERE type = \'table\' AND name = \'tracks\'') + table_list = cursor.fetchall() + new_db = len(table_list) > 0 # Count the number of records we need to import, for the progress bar cursor.execute(u'SELECT COUNT(songid) FROM songs') count = int(cursor.fetchone()[0]) @@ -71,9 +77,10 @@ class OpenLP1SongImport(SongImport): # "cache" our list of authors cursor.execute(u'SELECT authorid, authorname FROM authors') authors = cursor.fetchall() - # "cache" our list of tracks - cursor.execute(u'SELECT trackid, fulltrackname FROM tracks') - tracks = cursor.fetchall() + if new_db: + # "cache" our list of tracks + cursor.execute(u'SELECT trackid, fulltrackname FROM tracks') + tracks = cursor.fetchall() # Import the songs cursor.execute(u'SELECT songid, songtitle, lyrics || \'\' AS lyrics, ' u'copyrightinfo FROM songs') @@ -84,9 +91,22 @@ class OpenLP1SongImport(SongImport): success = False break song_id = song[0] - title = unicode(song[1], u'cp1252') - lyrics = unicode(song[2], u'cp1252').replace(u'\r', u'') - copyright = unicode(song[3], u'cp1252') + encoding = chardet.detect(song[1]) + if encoding[u'confidence'] < 0.9: + title = unicode(song[1], u'windows-1251') + else: + title = unicode(song[1], encoding[u'encoding']) + encoding = chardet.detect(song[2]) + if encoding[u'confidence'] < 0.9: + lyrics = unicode(song[2], u'windows-1251') + else: + lyrics = unicode(song[2], encoding[u'encoding']) + lyrics = lyrics.replace(u'\r', u'') + encoding = chardet.detect(song[3]) + if encoding[u'confidence'] < 0.9: + copyright = unicode(song[3], u'windows-1251') + else: + copyright = unicode(song[3], encoding[u'encoding']) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing "%s"...')) % title) @@ -102,15 +122,16 @@ class OpenLP1SongImport(SongImport): break for author in authors: if author[0] == author_id[0]: - self.parse_author(unicode(author[1], u'cp1252')) + encoding = chardet.detect(author[1]) + if encoding[u'confidence'] < 0.9: + self.parse_author(unicode(author[1], u'windows-1251')) + else: + self.parse_author(unicode(author[1], encoding[u'encoding'])) break if self.stop_import_flag: success = False break - cursor.execute(u'SELECT name FROM sqlite_master ' - u'WHERE type = \'table\' AND name = \'tracks\'') - table_list = cursor.fetchall() - if len(table_list) > 0: + if new_db: cursor.execute(u'SELECT trackid FROM songtracks ' u'WHERE songid = %s ORDER BY listindex' % song_id) track_ids = cursor.fetchall() @@ -120,7 +141,11 @@ class OpenLP1SongImport(SongImport): break for track in tracks: if track[0] == track_id[0]: - self.add_media_file(unicode(track[1], u'cp1252')) + encoding = chardet.detect(author[1]) + if encoding[u'confidence'] < 0.9: + self.add_media_file(unicode(track[1], u'windows-1251')) + else: + self.add_media_file(unicode(track[1], encoding[u'encoding'])) break if self.stop_import_flag: success = False From 0d36cba0bb5ccd021d9a4f4ccefb8e7fefa2c0e7 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Sat, 11 Sep 2010 22:40:14 +0100 Subject: [PATCH 5/5] Video background loop/change --- openlp/core/lib/htmlbuilder.py | 43 ++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 7f4fc5082..906ebb987 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -81,17 +81,14 @@ body {