From f7e8d1a861a157ff4784f38385baffa675f00617 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 4 Mar 2011 23:39:31 +0200 Subject: [PATCH 01/19] Updated translations. --- openlp/core/ui/displaytagdialog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 2b6441e16..6a1d8ca2c 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -143,11 +143,11 @@ class Ui_DisplayTagDialog(object): self.tagTableWidget.horizontalHeaderItem(0).setText( translate('OpenLP.DisplayTagDialog', 'Description')) self.tagTableWidget.horizontalHeaderItem(1).setText( - translate('OpenLP.DisplayTagDialog', 'Tag id')) + translate('OpenLP.DisplayTagDialog', 'Tag Id')) self.tagTableWidget.horizontalHeaderItem(2).setText( - translate('OpenLP.DisplayTagDialog', 'Start Html')) + translate('OpenLP.DisplayTagDialog', 'Start HTML')) self.tagTableWidget.horizontalHeaderItem(3).setText( - translate('OpenLP.DisplayTagDialog', 'End Html')) + translate('OpenLP.DisplayTagDialog', 'End HTML')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) From f0379925bc3a00f5f6df0abb0391667bcbcec0eb Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 11 Mar 2011 16:38:22 +0100 Subject: [PATCH 02/19] fixed bug #719102 Fixes: https://launchpad.net/bugs/719102 --- openlp/plugins/songs/lib/mediaitem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 46c027316..64802d05f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -274,6 +274,7 @@ class SongMediaItem(MediaManagerItem): def onNewClick(self): log.debug(u'onNewClick') + self.editItem = None self.edit_song_form.newSong() self.edit_song_form.exec_() From 7c7410a218e928d32f376398acd98dd5ff5b6376 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 11 Mar 2011 16:53:26 +0100 Subject: [PATCH 03/19] complete fixe --- 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 64802d05f..6efeee618 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -274,7 +274,6 @@ class SongMediaItem(MediaManagerItem): def onNewClick(self): log.debug(u'onNewClick') - self.editItem = None self.edit_song_form.newSong() self.edit_song_form.exec_() @@ -311,6 +310,7 @@ class SongMediaItem(MediaManagerItem): item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0] self.edit_song_form.loadSong(item_id, False) self.edit_song_form.exec_() + self.editItem = None def onDeleteClick(self): """ From 94d7f4e9326bbddc054a90a1b502e1ddffd7b396 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 11 Mar 2011 19:03:16 +0100 Subject: [PATCH 04/19] speed up application start/song search --- openlp/plugins/songs/lib/db.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index a6255476a..b72517f70 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -256,7 +256,7 @@ def init_schema(url): mapper(Song, songs_table, properties={ 'authors': relation(Author, backref='songs', - secondary=authors_songs_table), + secondary=authors_songs_table, lazy=False), 'book': relation(Book, backref='songs'), 'media_files': relation(MediaFile, backref='songs', secondary=media_files_songs_table), diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 46c027316..05f8b29bc 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -253,9 +253,9 @@ class SongMediaItem(MediaManagerItem): if self.searchAsYouType: search_length = 1 if self.searchTextEdit.currentSearchType() == SongSearch.Entire: - search_length = 7 + search_length = 4 elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics: - search_length = 6 + search_length = 3 if len(text) > search_length: self.onSearchTextButtonClick() elif len(text) == 0: From f1b8e53e30a255a6b09cd35228e8d1f5964c3bbc Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 11 Mar 2011 19:02:36 +0000 Subject: [PATCH 05/19] Fix missing path for song usage report generation Fixes: https://launchpad.net/bugs/733271 --- openlp/plugins/songusage/forms/songusagedetailform.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index ee37b2a9c..71cbcba96 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -88,6 +88,14 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): """ log.debug(u'accept') path = unicode(self.fileLineEdit.text()) + if path == u'': + Receiver.send_message(u'openlp_error_message', { + u'title': translate('SongUsagePlugin.SongUsageDetailForm', + 'Report Creation'), + u'message': unicode(translate( + 'SongUsagePlugin.SongUsageDetailForm', 'No output path has been' + ' selected for the report.'))}) + return check_directory_exists(path) filename = unicode(translate('SongUsagePlugin.SongUsageDetailForm', 'usage_detail_%s_%s.txt')) % ( From b3ca0ef69a3dd5db60f1d366c14dd4c69b208c84 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 11 Mar 2011 19:20:31 +0000 Subject: [PATCH 06/19] Fix text --- openlp/plugins/songusage/forms/songusagedetailform.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 71cbcba96..edfee3595 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -91,10 +91,11 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): if path == u'': Receiver.send_message(u'openlp_error_message', { u'title': translate('SongUsagePlugin.SongUsageDetailForm', - 'Report Creation'), + 'Output Path Not Selected'), u'message': unicode(translate( - 'SongUsagePlugin.SongUsageDetailForm', 'No output path has been' - ' selected for the report.'))}) + 'SongUsagePlugin.SongUsageDetailForm', 'You have not set a ' + 'valid output location for your song usage report. Please ' + 'select an existing path on your computer.'))}) return check_directory_exists(path) filename = unicode(translate('SongUsagePlugin.SongUsageDetailForm', From 18004c396820b574421906045141004074075a93 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 11 Mar 2011 22:51:29 +0200 Subject: [PATCH 07/19] Fixed some of the last bugs in the first time wizard. --- openlp.pyw | 2 +- openlp/core/ui/firsttimeform.py | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 3dee7452b..0c7893071 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -186,7 +186,7 @@ class OpenLP(QtGui.QApplication): # start the main app window self.appClipboard = self.clipboard() self.mainWindow = MainWindow(screens, app_version, self.appClipboard, - has_run_wizard) + not has_run_wizard) self.mainWindow.show() if show_splash: # now kill the splashscreen diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 9f211e49e..b049e2ea7 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -178,8 +178,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): """ Prepare the UI for the process. """ - # We start on 9 for the 9 plugins - max_progress = 9 + # We start on 2 for plugins status setting plus a "finished" point. + max_progress = 2 # Loop through the songs list and increase for each selected item for i in xrange(self.songsListWidget.count()): if self.songsListWidget.item(i).checkState() == QtCore.Qt.Checked: @@ -209,6 +209,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self.finishButton.setEnabled(True) self.cancelButton.setVisible(False) self.nextButton.setVisible(False) + self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', + 'Download complete. Click the finish button to start OpenLP.')) Receiver.send_message(u'openlp_process_events') def _performWizard(self): @@ -219,21 +221,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard): self._incrementProgressBar(translate('OpenLP.FirstTimeWizard', 'Enabling selected plugins...')) self._setPluginStatus(self.songsCheckBox, u'songs/status') - self._incrementProgressBar(None) self._setPluginStatus(self.bibleCheckBox, u'bibles/status') - self._incrementProgressBar(None) self._setPluginStatus(self.presentationCheckBox, u'presentations/status') - self._incrementProgressBar(None) self._setPluginStatus(self.imageCheckBox, u'images/status') - self._incrementProgressBar(None) self._setPluginStatus(self.mediaCheckBox, u'media/status') - self._incrementProgressBar(None) self._setPluginStatus(self.remoteCheckBox, u'remotes/status') - self._incrementProgressBar(None) self._setPluginStatus(self.customCheckBox, u'custom/status') - self._incrementProgressBar(None) self._setPluginStatus(self.songUsageCheckBox, u'songusage/status') - self._incrementProgressBar(None) self._setPluginStatus(self.alertCheckBox, u'alerts/status') # Build directories for downloads songs_destination = AppLocation.get_section_data_path(u'songs') From 0bf2962ff36863ff44851a015f8ea66133af5e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sat, 12 Mar 2011 00:04:26 +0200 Subject: [PATCH 08/19] Mediaplugin mimetypes extensions hacky fix. --- openlp/plugins/media/mediaplugin.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index b1c1a2f3e..53fc8d2cc 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,6 +45,18 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' + self.additional_extensions = { + u'audio/ac3': [u'.ac3'], + u'audio/flac': [u'.flac'], + u'audio/x-m4a': [u'.m4a'], + u'audio/x-mp3': [u'.mp3'], + u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'], + u'audio/qcelp': [u'.qcp'], + u'audio/x-wma': [u'.wma'], + u'audio/x-ms-wma': [u'.wma'], + u'video/x-matroska': [u'.mpv', u'.mkv'], + u'video/x-wmv': [u'.wmv'], + u'video/x-ms-wmv': [u'.wmv']} self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -65,6 +77,17 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) + # Add extensions for this mimetype from self.additional_extensions. + # This hack clears mimetypes' and operating system's shortcomings + # by providing possibly missing extensions. + if mimetype in self.additional_extensions.keys(): + for extension in self.additional_extensions[mimetype]: + ext = u'*%s' % extensions + if ext not in list: + list.append(ext) + self.serviceManager.supportedSuffixes(extension[1:]) + log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, + u' '.join(self.additional_extensions[mimetype]))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From 192a3de2ad61b565bc1076a5a733d30a42808f53 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 12 Mar 2011 01:41:44 +0200 Subject: [PATCH 09/19] Moved the translation files to their proper place on Linux/BSD/*nix. --- openlp/core/utils/__init__.py | 9 ++++++++- openlp/core/utils/languagemanager.py | 2 ++ resources/debian/Makefile | 10 +++++++--- resources/debian/debian/rules | 24 ++++++++++++------------ 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index f3dacee88..381712977 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -35,6 +35,7 @@ import urllib2 from datetime import datetime from PyQt4 import QtGui, QtCore + if sys.platform != u'win32' and sys.platform != u'darwin': try: from xdg import BaseDirectory @@ -134,7 +135,7 @@ class AppLocation(object): elif dir_type == AppLocation.LanguageDir: app_path = _get_frozen_path( os.path.abspath(os.path.split(sys.argv[0])[0]), - os.path.split(openlp.__file__)[0]) + _get_os_dir_path(dir_type)) return os.path.join(app_path, u'i18n') else: return _get_os_dir_path(dir_type) @@ -169,15 +170,21 @@ def _get_os_dir_path(dir_type): if dir_type == AppLocation.DataDir: return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp', u'data') + elif dir_type == AppLocation.LanguageDir: + return os.path.split(openlp.__file__)[0] return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp') elif sys.platform == u'darwin': if dir_type == AppLocation.DataDir: return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'Library', u'Application Support', u'openlp', u'Data') + elif dir_type == AppLocation.LanguageDir: + return os.path.split(openlp.__file__)[0] return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'Library', u'Application Support', u'openlp') else: + if dir_type == AppLocation.LanguageDir: + return os.path.join(u'/usr', u'share', u'openlp') if XDG_BASE_AVAILABLE: if dir_type == AppLocation.ConfigDir: return os.path.join(unicode(BaseDirectory.xdg_config_home, diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 28a8b06f8..8e5ab1f54 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -63,6 +63,8 @@ class LanguageManager(object): """ Find all available language files in this OpenLP install """ + log.debug(u'Translation files: %s', AppLocation.get_directory( + AppLocation.LanguageDir)) trans_dir = QtCore.QDir(AppLocation.get_directory( AppLocation.LanguageDir)) file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'), diff --git a/resources/debian/Makefile b/resources/debian/Makefile index fd19cffb7..94e6e2499 100644 --- a/resources/debian/Makefile +++ b/resources/debian/Makefile @@ -2,12 +2,16 @@ # -*- makefile -*- build: - mkdir -p openlp/i18n + mkdir -p resources/i18n/qm for TSFILE in resources/i18n/*.ts; do\ - lrelease-qt4 $$TSFILE -qm openlp/i18n/`basename $$TSFILE .ts`.qm;\ + lrelease-qt4 $$TSFILE -qm resources/i18n/qm/`basename $$TSFILE .ts`.qm;\ done install: + mkdir -p $(DESTDIR)/usr/share/openlp/i18n + cd resources/i18n/qm && for QMFILE in*.qm; do\ + mv $QMFILE $(DESTDIR)/usr/share/openlp/i18n;\ + done clean: - + rm -fR resources/i18n/qm diff --git a/resources/debian/debian/rules b/resources/debian/debian/rules index 18a593660..a9f7a5711 100755 --- a/resources/debian/debian/rules +++ b/resources/debian/debian/rules @@ -1,21 +1,21 @@ #!/usr/bin/make -f - + DEB_PYTHON_SYSTEM := pysupport DEB_MAKE_BUILD_TARGET := build -DEB_MAKE_INSTALL_TARGET := -DEB_MAKE_CLEAN_TARGET := +DEB_MAKE_INSTALL_TARGET := install +DEB_MAKE_CLEAN_TARGET := clean include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk include /usr/share/cdbs/1/class/makefile.mk binary-post-install/openlp:: - for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \ - mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \ - cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \ - done - - mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \ - cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg - - cd debian/openlp/usr/bin/ && mv openlp.pyw openlp + for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \ + mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \ + cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \ + done + + mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \ + cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg + + cd debian/openlp/usr/bin/ && mv openlp.pyw openlp From 21679d6a1ab570b86512028ddfb9a8e41affec2e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 12 Mar 2011 08:12:02 +0000 Subject: [PATCH 10/19] comment fixes --- openlp/core/lib/pluginmanager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index d2b05ab7c..dc1100e4a 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -73,7 +73,7 @@ class PluginManager(object): A list of helper objects to pass to the plugins. """ - self.plugin_helpers = plugin_helpers + #self.plugin_helpers = plugin_helpers startdepth = len(os.path.abspath(plugin_dir).split(os.sep)) log.debug(u'finding plugins in %s at depth %d', unicode(plugin_dir), startdepth) @@ -102,11 +102,11 @@ class PluginManager(object): plugin_objects = [] for p in plugin_classes: try: - plugin = p(self.plugin_helpers) - log.debug(u'Loaded plugin %s with helpers', unicode(p)) + plugin = p(plugin_helpers) + log.debug(u'Loaded plugin %s', unicode(p)) plugin_objects.append(plugin) except TypeError: - log.exception(u'loaded plugin %s has no helpers', unicode(p)) + log.exception(u'Failed to load plugin %s', unicode(p)) plugins_list = sorted(plugin_objects, self.order_by_weight) for plugin in plugins_list: if plugin.checkPreConditions(): From d65cab1d157ee919c6f49850e49baf0e9be4afc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sat, 12 Mar 2011 11:59:38 +0200 Subject: [PATCH 11/19] Sorry, guys. --- openlp/plugins/media/mediaplugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 53fc8d2cc..06936cd44 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -82,7 +82,7 @@ class MediaPlugin(Plugin): # by providing possibly missing extensions. if mimetype in self.additional_extensions.keys(): for extension in self.additional_extensions[mimetype]: - ext = u'*%s' % extensions + ext = u'*%s' % extension if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) From 0fe62c3591c1b7a8f0e23d1a1f7b362006b39401 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 12 Mar 2011 17:02:24 +0000 Subject: [PATCH 12/19] Memory improvements and additional logging --- openlp.pyw | 3 +-- openlp/core/lib/pluginmanager.py | 7 +++---- openlp/core/lib/toolbar.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 3dee7452b..0d3a21c7b 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -184,8 +184,7 @@ class OpenLP(QtGui.QApplication): # make sure Qt really display the splash screen self.processEvents() # start the main app window - self.appClipboard = self.clipboard() - self.mainWindow = MainWindow(screens, app_version, self.appClipboard, + self.mainWindow = MainWindow(screens, app_version, self.clipboard(), has_run_wizard) self.mainWindow.show() if show_splash: diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index dc1100e4a..f9009d7ac 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -55,10 +55,7 @@ class PluginManager(object): sys.path.insert(0, plugin_dir) self.basepath = os.path.abspath(plugin_dir) log.debug(u'Base path %s ', self.basepath) - self.plugin_helpers = [] self.plugins = [] - # this has to happen after the UI is sorted - # self.find_plugins(plugin_dir) log.info(u'Plugin manager Initialised') def find_plugins(self, plugin_dir, plugin_helpers): @@ -73,7 +70,7 @@ class PluginManager(object): A list of helper objects to pass to the plugins. """ - #self.plugin_helpers = plugin_helpers + log.info(u'Finding plugins') startdepth = len(os.path.abspath(plugin_dir).split(os.sep)) log.debug(u'finding plugins in %s at depth %d', unicode(plugin_dir), startdepth) @@ -203,6 +200,7 @@ class PluginManager(object): Loop through all the plugins and give them an opportunity to initialise themselves. """ + log.info(u'Initialise Plugings - Started') for plugin in self.plugins: log.info(u'initialising plugins %s in a %s state' % (plugin.name, plugin.isActive())) @@ -211,6 +209,7 @@ class PluginManager(object): log.info(u'Initialisation Complete for %s ' % plugin.name) if not plugin.isActive(): plugin.removeToolboxItem() + log.info(u'Initialise Plugings - Finished') def finalise_plugins(self): """ diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 37fb67d52..1da68d72d 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -48,7 +48,7 @@ class OpenLPToolbar(QtGui.QToolBar): self.icons = {} self.setIconSize(QtCore.QSize(20, 20)) self.actions = {} - log.debug(u'Init done') + log.debug(u'Init done for %s' % parent.__class__.__name__) def addToolbarButton(self, title, icon, tooltip=None, slot=None, checkable=False, shortcut=0, alternate=0, From 6cab8c1a9020b126a25194aafe971f4927a6e342 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 12 Mar 2011 17:35:27 +0000 Subject: [PATCH 13/19] comments corrected --- openlp/core/lib/pluginmanager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index f9009d7ac..6085b0da3 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -49,7 +49,7 @@ class PluginManager(object): ``plugin_dir`` The directory to search for plugins. """ - log.info(u'Plugin manager initing') + log.info(u'Plugin manager Initialising') if not plugin_dir in sys.path: log.debug(u'Inserting %s into sys.path', plugin_dir) sys.path.insert(0, plugin_dir) @@ -200,7 +200,7 @@ class PluginManager(object): Loop through all the plugins and give them an opportunity to initialise themselves. """ - log.info(u'Initialise Plugings - Started') + log.info(u'Initialise Plugins - Started') for plugin in self.plugins: log.info(u'initialising plugins %s in a %s state' % (plugin.name, plugin.isActive())) @@ -209,7 +209,7 @@ class PluginManager(object): log.info(u'Initialisation Complete for %s ' % plugin.name) if not plugin.isActive(): plugin.removeToolboxItem() - log.info(u'Initialise Plugings - Finished') + log.info(u'Initialise Plugins - Finished') def finalise_plugins(self): """ From d9d12f0daf1af91b664384c97ee6d7df197ebdb1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 12 Mar 2011 22:28:37 +0200 Subject: [PATCH 14/19] Updated manifest file. --- MANIFEST.in | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 992685bcf..b51cd4c06 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,13 +4,10 @@ recursive-include openlp *.csv recursive-include openlp *.html recursive-include openlp *.js recursive-include openlp *.css -recursive-include openlp *.qm recursive-include documentation * -recursive-include resources/forms * -recursive-include resources/i18n * -recursive-include resources/images * -recursive-include scripts *.py -include resources/*.desktop +recursive-include resources * +recursive-include scripts * include copyright.txt include LICENSE +include README.txt include openlp/.version From d89b7543003d887f2e3e3a2cdeb16449274ca02e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 12 Mar 2011 22:36:33 +0200 Subject: [PATCH 15/19] Fixed up some spaces->tabs that went awry. --- resources/debian/Makefile | 10 +++++----- resources/debian/debian/rules | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/resources/debian/Makefile b/resources/debian/Makefile index 94e6e2499..1fe02b479 100644 --- a/resources/debian/Makefile +++ b/resources/debian/Makefile @@ -4,14 +4,14 @@ build: mkdir -p resources/i18n/qm for TSFILE in resources/i18n/*.ts; do\ - lrelease-qt4 $$TSFILE -qm resources/i18n/qm/`basename $$TSFILE .ts`.qm;\ + lrelease-qt4 $$TSFILE -qm resources/i18n/qm/`basename $$TSFILE .ts`.qm;\ done install: - mkdir -p $(DESTDIR)/usr/share/openlp/i18n - cd resources/i18n/qm && for QMFILE in*.qm; do\ - mv $QMFILE $(DESTDIR)/usr/share/openlp/i18n;\ - done + mkdir -p $(DESTDIR)/usr/share/openlp/i18n + cd resources/i18n/qm && for QMFILE in*.qm; do\ + mv $QMFILE $(DESTDIR)/usr/share/openlp/i18n;\ + done clean: rm -fR resources/i18n/qm diff --git a/resources/debian/debian/rules b/resources/debian/debian/rules index a9f7a5711..c8fe91ecc 100755 --- a/resources/debian/debian/rules +++ b/resources/debian/debian/rules @@ -10,12 +10,12 @@ include /usr/share/cdbs/1/class/python-distutils.mk include /usr/share/cdbs/1/class/makefile.mk binary-post-install/openlp:: - for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \ - mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \ - cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \ - done + for SIZE in 16x16 32x32 48x48 64x64 128x128 256x256; do \ + mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \ + cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \ + done - mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \ - cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg + mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \ + cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg - cd debian/openlp/usr/bin/ && mv openlp.pyw openlp + cd debian/openlp/usr/bin/ && mv openlp.pyw openlp From 8cc21cef79bf4e3bf08288646bb8698b785d5099 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Mar 2011 14:50:14 +0100 Subject: [PATCH 16/19] removed need to have a verseOrder; removed attempt to fix missing verse_numbers --- openlp/plugins/songs/lib/xml.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index bd22ea4b2..8353fc927 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -444,7 +444,6 @@ class OpenLyrics(object): """ sxml = SongXML() search_text = u'' - temp_verse_order = [] for verse in lyrics.verse: text = u'' for lines in verse.lines: @@ -455,11 +454,6 @@ class OpenLyrics(object): verse_type_index = VerseType.from_tag(verse_name[0]) verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) - verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) - # OpenLyrics allows e. g. "c", but we need "c1". - if not verse_number: - verse_number = u'1' - temp_verse_order.append((verse_type, verse_number, verse_part)) lang = None if self._get(verse, u'lang'): lang = self._get(verse, u'lang') @@ -470,24 +464,6 @@ class OpenLyrics(object): # Process verse order if hasattr(properties, u'verseOrder'): song.verse_order = self._text(properties.verseOrder) - else: - # We have to process the temp_verse_order, as the verseOrder - # property is not present. - previous_type = u'' - previous_number = u'' - previous_part = u'' - verse_order = [] - # Currently we do not support different "parts"! - for name in temp_verse_order: - if name[0] == previous_type: - if name[1] != previous_number: - verse_order.append(u''.join((name[0][0], name[1]))) - else: - verse_order.append(u''.join((name[0][0], name[1]))) - previous_type = name[0] - previous_number = name[1] - previous_part = name[2] - song.verse_order = u' '.join(verse_order) def _process_songbooks(self, properties, song): """ From 99eba705c5d741808ae6b19d1271ce9af1b29129 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Mar 2011 15:39:55 +0100 Subject: [PATCH 17/19] add the verse tag fix back --- openlp/plugins/songs/lib/xml.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8353fc927..a59395d65 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -454,6 +454,10 @@ class OpenLyrics(object): verse_type_index = VerseType.from_tag(verse_name[0]) verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) + # OpenLyrics allows e. g. "c", but we need "c1". However, this does + # not correct the verse order. + if not verse_number: + verse_number = u'1' lang = None if self._get(verse, u'lang'): lang = self._get(verse, u'lang') From 0ae31ce861449002a02ead3cd2b26fdaa7422677 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Mar 2011 16:01:01 +0100 Subject: [PATCH 18/19] fixed old service files --- openlp/core/lib/serviceitem.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 2dd87f6f5..2d7f542d6 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -183,6 +183,10 @@ class ServiceItem(object): else: log.error(u'Invalid value renderer :%s' % self.service_item_type) self.title = clean_tags(self.title) + # The footer should never be None, but to be compatible with older + # release of OpenLP, we have to correct this to avoid tracebacks. + if self.raw_footer is None: + self.raw_footer = [] self.foot_text = \ u'
'.join([footer for footer in self.raw_footer if footer]) From 9c30635fcb350e77e81b074341ad1104b3543c1b Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Mar 2011 16:58:27 +0100 Subject: [PATCH 19/19] remove corrupted bibles --- openlp/plugins/bibles/lib/manager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index dcbad3e63..c11e10588 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -25,14 +25,14 @@ ############################################################################### import logging +import os from PyQt4 import QtCore from openlp.core.lib import Receiver, SettingsManager, translate -from openlp.core.utils import AppLocation +from openlp.core.utils import AppLocation, delete_file from openlp.plugins.bibles.lib import parse_reference from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta - from csvbible import CSVBible from http import HTTPBible from opensong import OpenSongBible @@ -144,6 +144,10 @@ class BibleManager(object): for filename in files: bible = BibleDB(self.parent, path=self.path, file=filename) name = bible.get_name() + # Remove corrupted files. + if name is None: + delete_file(os.path.join(self.path, filename)) + continue log.debug(u'Bible Name: "%s"', name) self.db_cache[name] = bible # Look to see if lazy load bible exists and get create getter.