From 174a85d96959c6f35f30cbc81da21faf4dff01aa Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 21 Feb 2010 12:28:35 +0200 Subject: [PATCH 01/26] Couple more visual tweaks, to make OpenLP look good in Windows. Print the location of file OpenLP is logging to in debug mode. --- openlp.pyw | 7 +++++-- openlp/core/ui/mainwindow.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 5c18486b6..c7dbb77fe 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -47,9 +47,11 @@ QMainWindow::separator QDockWidget::title { - border: none; + /*background: palette(dark);*/ + border: 1px solid palette(dark); padding-left: 5px; - padding-top: 3px; + padding-top: 2px; + margin: 1px 0; } QToolBar @@ -169,6 +171,7 @@ def main(): qt_args = [] if options.loglevel.lower() in ['d', 'debug']: log.setLevel(logging.DEBUG) + print 'Logging to:', filename elif options.loglevel.lower() in ['w', 'warning']: log.setLevel(logging.WARNING) else: diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index df66d5e97..2e62398d9 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -39,16 +39,16 @@ from openlp.core.utils import check_latest_version media_manager_style = """ QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(midlight), stop: 1.0 palette(mid)); + stop: 0 palette(button), stop: 1.0 palette(dark)); border-width: 1px; border-style: outset; - border-color: palette(midlight); + border-color: palette(dark); border-radius: 5px; } QToolBox::tab:selected { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(light), stop: 1.0 palette(mid)); - border-color: palette(light); + stop: 0 palette(light), stop: 1.0 palette(button)); + border-color: palette(dark); } """ class versionThread(QtCore.QThread): From 6f4b4b2616cb3d7eb18920a087f066fec0133e14 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 21 Feb 2010 14:43:03 +0200 Subject: [PATCH 02/26] Moved all "get_xxxxx_directory" functions into one "AppLocation" class. Set the plugin manager to use this new AppLocation class as well. --- openlp.pyw | 5 +- openlp/core/lib/pluginmanager.py | 2 +- openlp/core/ui/mainwindow.py | 6 +-- openlp/core/utils/__init__.py | 82 ++++++++++++++++++------------- openlp/core/utils/confighelper.py | 6 +-- 5 files changed, 58 insertions(+), 43 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index c7dbb77fe..d748b339a 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, str_to_bool from openlp.core.resources import qInitResources from openlp.core.ui import MainWindow, SplashScreen, ScreenList -from openlp.core.utils import get_config_directory, ConfigHelper +from openlp.core.utils import AppLocation, ConfigHelper log = logging.getLogger() @@ -160,7 +160,8 @@ def main(): parser.add_option("-s", "--style", dest="style", help="Set the Qt4 style (passed directly to Qt4).") # Set up logging - filename = os.path.join(get_config_directory(), u'openlp.log') + filename = os.path.join(AppLocation.get_directory(AppLocation.ConfigDir), + u'openlp.log') logfile = FileHandler(filename, u'w') logfile.setFormatter(logging.Formatter( u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index b06f23953..512b47870 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -77,7 +77,7 @@ class PluginManager(object): if name.endswith(u'.py') and not name.startswith(u'__'): path = os.path.abspath(os.path.join(root, name)) thisdepth = len(path.split(os.sep)) - if thisdepth-startdepth > 2: + if thisdepth - startdepth > 2: # skip anything lower down continue modulename, pyext = os.path.splitext(path) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2e62398d9..88575b5ec 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -34,7 +34,7 @@ from openlp.core.ui import AboutForm, SettingsForm, \ PluginForm, MediaDockManager from openlp.core.lib import RenderManager, PluginConfig, build_icon, \ OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool -from openlp.core.utils import check_latest_version +from openlp.core.utils import check_latest_version, AppLocation media_manager_style = """ QToolBox::tab { @@ -434,9 +434,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) # Set up the path with plugins - pluginpath = os.path.split(os.path.abspath(__file__))[0] - pluginpath = os.path.abspath( - os.path.join(pluginpath, u'..', u'..', u'plugins')) + pluginpath = AppLocation.get_directory(AppLocation.PluginsDir) self.plugin_manager = PluginManager(pluginpath) self.plugin_helpers = {} # Set up the interface diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index e85b2d939..187d85cd2 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -24,12 +24,60 @@ ############################################################################### import os +import sys import logging import urllib2 from datetime import datetime log = logging.getLogger(__name__) +class AppLocation(object): + """ + Retrieve a directory based on the directory type. + """ + AppDir = 1 + ConfigDir = 2 + DataDir = 3 + PluginsDir = 4 + + @staticmethod + def get_directory(dir_type): + if dir_type == AppLocation.AppDir: + return os.path.abspath(os.path.split(sys.argv[0])[0]) + elif dir_type == AppLocation.ConfigDir: + if os.name == u'nt': + path = os.path.join(os.getenv(u'APPDATA'), u'openlp') + elif os.name == u'mac': + path = os.path.join(os.getenv(u'HOME'), u'Library', + u'Application Support', u'openlp') + else: + try: + from xdg import BaseDirectory + path = os.path.join(BaseDirectory.xdg_config_home, u'openlp') + except ImportError: + path = os.path.join(os.getenv(u'HOME'), u'.openlp') + return path + elif dir_type == AppLocation.DataDir: + if os.name == u'nt': + path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data') + elif os.name == u'mac': + path = os.path.join(os.getenv(u'HOME'), u'Library', + u'Application Support', u'openlp', u'Data') + else: + try: + from xdg import BaseDirectory + path = os.path.join(BaseDirectory.xdg_data_home, u'openlp') + except ImportError: + path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') + return path + elif dir_type == AppLocation.PluginsDir: + app_path = os.path.abspath(os.path.split(sys.argv[0])[0]) + if hasattr(sys, u'frozen') and sys.frozen == 1: + return os.path.join(app_path, u'plugins') + else: + return os.path.join(app_path, u'openlp', u'plugins') + + def check_latest_version(config, current_version): version_string = current_version #set to prod in the distribution confif file. @@ -50,39 +98,7 @@ def check_latest_version(config, current_version): log.exception(u'Reason for failure: %s', e.reason) return version_string -def get_config_directory(): - path = u'' - if os.name == u'nt': - path = os.path.join(os.getenv(u'APPDATA'), u'openlp') - elif os.name == u'mac': - path = os.path.join(os.getenv(u'HOME'), u'Library', - u'Application Support', u'openlp') - else: - try: - from xdg import BaseDirectory - path = os.path.join(BaseDirectory.xdg_config_home, u'openlp') - except ImportError: - path = os.path.join(os.getenv(u'HOME'), u'.openlp') - return path - -def get_data_directory(): - path = u'' - if os.name == u'nt': - # ask OS for path to application data, set on Windows XP and Vista - path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data') - elif os.name == u'mac': - path = os.path.join(os.getenv(u'HOME'), u'Library', - u'Application Support', u'openlp', u'Data') - else: - try: - from xdg import BaseDirectory - path = os.path.join(BaseDirectory.xdg_data_home, u'openlp') - except ImportError: - path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') - return path - from registry import Registry from confighelper import ConfigHelper -__all__ = [u'Registry', u'ConfigHelper', u'get_config_directory', - u'get_data_directory', u'check_latest_version'] +__all__ = [u'Registry', u'ConfigHelper', u'AppLocations', u'check_latest_version'] diff --git a/openlp/core/utils/confighelper.py b/openlp/core/utils/confighelper.py index d49157f55..7920013f2 100644 --- a/openlp/core/utils/confighelper.py +++ b/openlp/core/utils/confighelper.py @@ -25,7 +25,7 @@ import os -from openlp.core.utils import get_data_directory, get_config_directory +from openlp.core.utils import AppLocation from openlp.core.utils.registry import Registry class ConfigHelper(object): @@ -36,7 +36,7 @@ class ConfigHelper(object): @staticmethod def get_data_path(): - path = get_data_directory() + path = AppLocation.get_directory(AppLocation.DataDir) if not os.path.exists(path): os.makedirs(path) return path @@ -70,7 +70,7 @@ class ConfigHelper(object): current operating system, and returns an instantiation of that class. """ if ConfigHelper.__registry__ is None: - config_path = get_config_directory() + config_path = AppLocation.get_directory(AppLocation.ConfigDir) ConfigHelper.__registry__ = Registry(config_path) return ConfigHelper.__registry__ From 0ddaa2bf4a52653c5372004dfe9c5804b5cd6662 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 24 Feb 2010 20:39:12 +0200 Subject: [PATCH 03/26] Some more visual tweaks. Fixes for older versions of PyQt4. --- openlp/core/ui/slidecontroller.py | 7 +++-- openlp/plugins/alerts/__init__.py | 2 +- .../plugins/bibles/forms/importwizardform.py | 26 +++++++++---------- openlp/plugins/bibles/lib/common.py | 2 +- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e88699b71..a8c7042a6 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -108,15 +108,14 @@ class SlideController(QtGui.QWidget): # Type label for the top of the slide controller self.TypeLabel = QtGui.QLabel(self.Panel) if self.isLive: - self.TypeLabel.setText(u'%s' % - self.trUtf8('Live')) + self.TypeLabel.setText(self.trUtf8('Live')) self.split = 1 prefix = u'live_slidecontroller' else: - self.TypeLabel.setText(u'%s' % - self.trUtf8('Preview')) + self.TypeLabel.setText(self.trUtf8('Preview')) self.split = 0 prefix = u'preview_slidecontroller' + self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter) self.PanelLayout.addWidget(self.TypeLabel) # Splitter diff --git a/openlp/plugins/alerts/__init__.py b/openlp/plugins/alerts/__init__.py index a78b7d0d7..bc50edda3 100644 --- a/openlp/plugins/alerts/__init__.py +++ b/openlp/plugins/alerts/__init__.py @@ -21,4 +21,4 @@ # You should have received a copy of the GNU General Public License along # # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### +############################################################################### \ No newline at end of file diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index a684c01a3..b4de19da2 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -237,22 +237,22 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): u'license_permission', self.PermissionEdit) def setDefaults(self): - self.setField(u'source_format', 0) - self.setField(u'osis_location', '') - self.setField(u'csv_booksfile', '') - self.setField(u'csv_versefile', '') - self.setField(u'opensong_file', '') - self.setField(u'web_location', DownloadLocation.Crosswalk) - self.setField(u'web_biblename', self.BibleComboBox) + self.setField(u'source_format', QtCore.QVariant(0)) + self.setField(u'osis_location', QtCore.QVariant('')) + self.setField(u'csv_booksfile', QtCore.QVariant('')) + self.setField(u'csv_versefile', QtCore.QVariant('')) + self.setField(u'opensong_file', QtCore.QVariant('')) + self.setField(u'web_location', QtCore.QVariant(DownloadLocation.Crosswalk)) + self.setField(u'web_biblename', QtCore.QVariant(self.BibleComboBox)) self.setField(u'proxy_server', - self.config.get_config(u'proxy address', '')) + QtCore.QVariant(self.config.get_config(u'proxy address', ''))) self.setField(u'proxy_username', - self.config.get_config(u'proxy username','')) + QtCore.QVariant(self.config.get_config(u'proxy username',''))) self.setField(u'proxy_password', - self.config.get_config(u'proxy password','')) - self.setField(u'license_version', self.VersionNameEdit) - self.setField(u'license_copyright', self.CopyrightEdit) - self.setField(u'license_permission', self.PermissionEdit) + QtCore.QVariant(self.config.get_config(u'proxy password',''))) + self.setField(u'license_version', QtCore.QVariant(self.VersionNameEdit)) + self.setField(u'license_copyright', QtCore.QVariant(self.CopyrightEdit)) + self.setField(u'license_permission', QtCore.QVariant(self.PermissionEdit)) self.onLocationComboBoxChanged(DownloadLocation.Crosswalk) def loadWebBibles(self): diff --git a/openlp/plugins/bibles/lib/common.py b/openlp/plugins/bibles/lib/common.py index 5152ca496..b8ad245bb 100644 --- a/openlp/plugins/bibles/lib/common.py +++ b/openlp/plugins/bibles/lib/common.py @@ -24,10 +24,10 @@ ############################################################################### import urllib2 -import chardet import logging import re import sqlite3 +import chardet only_verses = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*([0-9]+)' r'(?:[ ]*-[ ]*([0-9]+|end))?(?:[ ]*,[ ]*([0-9]+)(?:[ ]*-[ ]*([0-9]+|end))?)?', From 804b18b03426bfb919ec29d03c45fc6371c2d48a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 24 Feb 2010 20:55:34 +0200 Subject: [PATCH 04/26] Add PyInstaller hooks. --- .../pyinstaller/hook-openlp.plugins.bibles.lib.common.py | 1 + ...ok-openlp.plugins.presentations.presentationplugin.py | 3 +++ resources/pyinstaller/hook-openlp.py | 9 +++++++++ 3 files changed, 13 insertions(+) create mode 100644 resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py create mode 100644 resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py create mode 100644 resources/pyinstaller/hook-openlp.py diff --git a/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py b/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py new file mode 100644 index 000000000..dc71dc088 --- /dev/null +++ b/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py @@ -0,0 +1 @@ +hiddenimports = ['chardet'] \ No newline at end of file diff --git a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py new file mode 100644 index 000000000..8b7d6b8a2 --- /dev/null +++ b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py @@ -0,0 +1,3 @@ +hiddenimports = ['openlp.plugins.presentations.lib.impresscontroller', + 'openlp.plugins.presentations.lib.powerpointcontroller', + 'openlp.plugins.presentations.lib.pptviewcontroller'] \ No newline at end of file diff --git a/resources/pyinstaller/hook-openlp.py b/resources/pyinstaller/hook-openlp.py new file mode 100644 index 000000000..bd97e4aec --- /dev/null +++ b/resources/pyinstaller/hook-openlp.py @@ -0,0 +1,9 @@ +hiddenimports = ['plugins.songs.songsplugin', + 'plugins.bibles.bibleplugin', + 'plugins.presentations.presentationplugin', + 'plugins.media.mediaplugin', + 'plugins.images.imageplugin', + 'plugins.custom.customplugin', + 'plugins.songusage.songusageplugin', + 'plugins.remotes.remoteplugin', + 'plugins.alerts.alertsplugin'] \ No newline at end of file From e0875fa90e0335906e946d19b7cc370556628214 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 26 Feb 2010 20:22:34 +0000 Subject: [PATCH 05/26] Import fixes --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 73cecd97a..d6f4b7503 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python from setuptools import setup, find_packages -import sys, os VERSION_FILE = 'openlp/.version' From 2185f4e84271e61ee6cbb28617f8d0cbab9fe5a3 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 26 Feb 2010 23:47:59 +0000 Subject: [PATCH 06/26] Remove C-style semi-colons --- openlp/core/lib/__init__.py | 2 +- openlp/core/lib/renderer.py | 10 +++++----- openlp/core/ui/maindisplay.py | 2 +- openlp/core/ui/slidecontroller.py | 4 ++-- openlp/migration/display.py | 8 ++++---- openlp/migration/migratebibles.py | 4 ++-- openlp/migration/migratefiles.py | 18 +++++++++--------- .../presentations/lib/pptviewcontroller.py | 2 +- .../songs/forms/songmaintenancedialog.py | 8 ++++---- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 93512f946..899b5cf73 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -146,7 +146,7 @@ def resize_image(image, width, height): preview = QtGui.QImage(image) preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - realw = preview.width(); + realw = preview.width() realh = preview.height() # and move it to the centre of the preview space newImage = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32_Premultiplied) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index cc976dae5..03b53eca8 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -406,8 +406,8 @@ class Renderer(object): Defaults to *False*. Whether or not this is a live screen. """ x, y = tlcorner - maxx = self._rect.width(); - maxy = self._rect.height(); + maxx = self._rect.width() + maxy = self._rect.height() lines = [] lines.append(line) startx = x @@ -415,11 +415,11 @@ class Renderer(object): rightextent = None self.painter = QtGui.QPainter() self.painter.begin(self._frame) - self.painter.setRenderHint(QtGui.QPainter.Antialiasing); + self.painter.setRenderHint(QtGui.QPainter.Antialiasing) if self._theme.display_slideTransition: self.painter2 = QtGui.QPainter() self.painter2.begin(self._frameOp) - self.painter2.setRenderHint(QtGui.QPainter.Antialiasing); + self.painter2.setRenderHint(QtGui.QPainter.Antialiasing) self.painter2.setOpacity(0.7) # dont allow alignment messing with footers if footer: @@ -458,7 +458,7 @@ class Renderer(object): x = maxx - w # centre elif align == 2: - x = (maxx - w) / 2; + x = (maxx - w) / 2 rightextent = x + w if live: # now draw the text, and any outlines/shadows diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index bdb396498..2671732ec 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -65,7 +65,7 @@ class DisplayWidget(QtGui.QWidget): Receiver.send_message(u'live_slidecontroller_last') event.accept() elif event.key() in self.hotkey_map: - Receiver.send_message(self.hotkey_map[event.key()]); + Receiver.send_message(self.hotkey_map[event.key()]) event.accept() elif event.key() == QtCore.Qt.Key_Escape: self.resetDisplay() diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e88699b71..c21afa4f5 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, \ -PluginConfig, resize_image + PluginConfig, resize_image class SlideList(QtGui.QTableWidget): """ @@ -63,7 +63,7 @@ class SlideList(QtGui.QTableWidget): self.parent.onSlideSelectedLast() event.accept() elif event.key() in self.hotkey_map and self.parent.isLive: - Receiver.send_message(self.hotkey_map[event.key()]); + Receiver.send_message(self.hotkey_map[event.key()]) event.accept() event.ignore() else: diff --git a/openlp/migration/display.py b/openlp/migration/display.py index 9a3f6e44e..f427c5fb6 100644 --- a/openlp/migration/display.py +++ b/openlp/migration/display.py @@ -32,11 +32,11 @@ class Display(): @staticmethod def output(string): - log.debug(string); - print (string) + log.debug(string) + #print (string) @staticmethod def sub_output(string): if not string is None: - log.debug(u' '+string); - print (u' '+string) \ No newline at end of file + log.debug(u' '+string) + #print (u' '+string) diff --git a/openlp/migration/migratebibles.py b/openlp/migration/migratebibles.py index 92504e907..f9e10b756 100644 --- a/openlp/migration/migratebibles.py +++ b/openlp/migration/migratebibles.py @@ -28,5 +28,5 @@ class MigrateBibles(): self.display = display def process(self): - self.display.output(u'Bible process started'); - self.display.output(u'Bible process finished'); \ No newline at end of file + self.display.output(u'Bible process started') + self.display.output(u'Bible process finished') \ No newline at end of file diff --git a/openlp/migration/migratefiles.py b/openlp/migration/migratefiles.py index 9c38fbb88..f1c9435ab 100644 --- a/openlp/migration/migratefiles.py +++ b/openlp/migration/migratefiles.py @@ -30,20 +30,20 @@ class MigrateFiles(): self.display = display def process(self): - self.display.output(u'Files process started'); + self.display.output(u'Files process started') self._initial_setup() - self.display.output(u'Files process finished'); + self.display.output(u'Files process finished') def _initial_setup(self): - self.display.output(u'Initial Setup started'); + self.display.output(u'Initial Setup started') ConfigHelper.get_data_path() - self.display.sub_output(u'Config created'); + self.display.sub_output(u'Config created') ConfigHelper.get_config(u'bible', u'data path') - self.display.sub_output(u'Config created'); + self.display.sub_output(u'Config created') ConfigHelper.get_config(u'videos', u'data path') - self.display.sub_output(u'videos created'); + self.display.sub_output(u'videos created') ConfigHelper.get_config(u'images', u'data path') - self.display.sub_output(u'images created'); + self.display.sub_output(u'images created') ConfigHelper.get_config(u'presentations', u'data path') - self.display.sub_output(u'presentations created'); - self.display.output(u'Initial Setup finished'); \ No newline at end of file + self.display.sub_output(u'presentations created') + self.display.output(u'Initial Setup finished') \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 2ed457fc0..56372e352 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -110,7 +110,7 @@ class PptviewController(PresentationController): rendermanager = self.plugin.render_manager rect = rendermanager.screens.current[u'size'] rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom()) - filepath = str(presentation.replace(u'/', u'\\')); + filepath = str(presentation.replace(u'/', u'\\')) try: self.pptid = self.process.OpenPPT(filepath, None, rect, str(os.path.join(self.thumbnailpath, self.thumbnailprefix))) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 5730e8c56..643676ff6 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -51,10 +51,10 @@ class Ui_SongMaintenanceDialog(object): self.TypeListWidget.sizePolicy().hasHeightForWidth()) self.TypeListWidget.setSizePolicy(sizePolicy) self.TypeListWidget.setViewMode(QtGui.QListView.IconMode) - self.TypeListWidget.setIconSize(QtCore.QSize(112, 100)); - self.TypeListWidget.setMovement(QtGui.QListView.Static); - self.TypeListWidget.setMaximumWidth(118); - self.TypeListWidget.setSpacing(0); + self.TypeListWidget.setIconSize(QtCore.QSize(112, 100)) + self.TypeListWidget.setMovement(QtGui.QListView.Static) + self.TypeListWidget.setMaximumWidth(118) + self.TypeListWidget.setSpacing(0) self.TypeListWidget.setSortingEnabled(False) self.TypeListWidget.setUniformItemSizes(True) self.TypeListWidget.setObjectName(u'TypeListWidget') From 80d54dc1be05a2582095203ad2827a254b22041e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 27 Feb 2010 00:11:26 +0000 Subject: [PATCH 07/26] None tests --- openlp/core/ui/servicemanager.py | 2 +- openlp/plugins/presentations/lib/powerpointcontroller.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 22fbb7ecc..ab36660b4 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -694,7 +694,7 @@ class ServiceManager(QtGui.QWidget): if plugin == u'ServiceManager': startpos, startCount = self.findServiceItem() item = self.ServiceManagerList.itemAt(event.pos()) - if item == None: + if item is None: endpos = len(self.serviceItems) else: parentitem = item.parent() diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index a9775e086..4ac7ada66 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -150,7 +150,7 @@ class PowerpointController(PresentationController): Triggerent by new object being added to SlideController orOpenLP being shut down """ - if self.presentation == None: + if self.presentation is None: return try: self.presentation.Close() @@ -165,9 +165,9 @@ class PowerpointController(PresentationController): if not self.is_loaded(): return False try: - if self.presentation.SlideShowWindow == None: + if self.presentation.SlideShowWindow is None: return False - if self.presentation.SlideShowWindow.View == None: + if self.presentation.SlideShowWindow.View is None: return False except: return False From 447446fe9e05fda4b15e60cf63e7597f564e4b54 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 28 Feb 2010 19:43:05 +0200 Subject: [PATCH 08/26] Changed location and name of version file. --- openlp.pyw | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index d748b339a..1bdfa8424 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -32,6 +32,7 @@ from logging import FileHandler from optparse import OptionParser from PyQt4 import QtCore, QtGui +import openlp from openlp.core.lib import Receiver, str_to_bool from openlp.core.resources import qInitResources from openlp.core.ui import MainWindow, SplashScreen, ScreenList @@ -79,8 +80,10 @@ class OpenLP(QtGui.QApplication): Run the OpenLP application. """ #Load and store current Application Version - filepath = os.path.split(os.path.abspath(__file__))[0] - filepath = os.path.abspath(os.path.join(filepath, u'version.txt')) + filepath = AppLocation.get_directory(AppLocation.AppDir) + if not hasattr(sys, u'frozen'): + filepath = os.path.join(filepath, u'openlp') + filepath = os.path.join(filepath, u'.version') fversion = None try: fversion = open(filepath, u'r') @@ -97,9 +100,9 @@ class OpenLP(QtGui.QApplication): app_version[u'version'], app_version[u'build'])) except: app_version = { - u'full': u'1.9.0-000', + u'full': u'1.9.0-bzr000', u'version': u'1.9.0', - u'build': u'000' + u'build': u'bzr000' } finally: if fversion: From 132022205edc7aea4e74c5fcafa572f6be11f42c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 4 Mar 2010 18:43:53 +0000 Subject: [PATCH 09/26] None tests redux --- openlp/plugins/presentations/lib/powerpointcontroller.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 64c435ebf..935fa9929 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -165,7 +165,7 @@ class PowerpointDocument(PresentationDocument): Triggerent by new object being added to SlideController orOpenLP being shut down """ - if self.presentation == None: + if self.presentation is None: return try: self.presentation.Close() @@ -181,9 +181,9 @@ class PowerpointDocument(PresentationDocument): if not self.controller.is_loaded(): return False try: - if self.presentation.SlideShowWindow == None: + if self.presentation.SlideShowWindow is None: return False - if self.presentation.SlideShowWindow.View == None: + if self.presentation.SlideShowWindow.View is None: return False except: return False From 97fc65163a83259abf2aa8d939a62d5e9122a068 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 5 Mar 2010 20:34:19 +0200 Subject: [PATCH 10/26] Ignoring a few things. --- .bzrignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index e7b399b49..00884055d 100644 --- a/.bzrignore +++ b/.bzrignore @@ -12,3 +12,5 @@ documentation/build/doctrees *.log* dist OpenLP.egg-info +build +resources/innosetup/Output From a355c381c2dfff3d3eecd4cd48edf836cb2e01fd Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 6 Mar 2010 01:03:00 +0200 Subject: [PATCH 11/26] Fixed up a bug introduced in the merge. --- openlp.pyw | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp.pyw b/openlp.pyw index ea30b6a28..c4a5fb428 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -32,6 +32,8 @@ from logging import FileHandler from optparse import OptionParser from PyQt4 import QtCore, QtGui +log = logging.getLogger() + import openlp from openlp.core.lib import Receiver, str_to_bool from openlp.core.resources import qInitResources From 61ff8ec91ae5358b7746367606259c0f75330b27 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 6 Mar 2010 01:09:18 +0200 Subject: [PATCH 12/26] Removed an unnecessary file. --- resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py diff --git a/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py b/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py deleted file mode 100644 index dc71dc088..000000000 --- a/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py +++ /dev/null @@ -1 +0,0 @@ -hiddenimports = ['chardet'] \ No newline at end of file From 1932ed886e0893b40051ec483422376bea628c14 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Mar 2010 08:00:36 +0000 Subject: [PATCH 13/26] Fix up service notes --- openlp/core/ui/servicemanager.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ad0da357b..0c955f392 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -42,7 +42,6 @@ class ServiceManagerList(QtGui.QTreeWidget): def __init__(self, parent=None, name=None): QtGui.QTreeWidget.__init__(self,parent) self.parent = parent - self.setExpandsOnDoubleClick(False) def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -250,6 +249,7 @@ class ServiceManager(QtGui.QWidget): if self.serviceItemNoteForm.exec_(): self.serviceItems[item][u'service_item'].notes = \ self.serviceItemNoteForm.textEdit.toPlainText() + self.repaintServiceList(item, 0) def nextItem(self): """ @@ -429,15 +429,20 @@ class ServiceManager(QtGui.QWidget): for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) - treewidgetitem.setText(0,serviceitem.title) - treewidgetitem.setIcon(0,serviceitem.iconic_representation) + if len(serviceitem.notes) > 0: + title = self.trUtf8(u'(N) - %s' % serviceitem.title) + else: + title = serviceitem.title + treewidgetitem.setText(0, title) + treewidgetitem.setToolTip(0, serviceitem.notes) + treewidgetitem.setIcon(0, serviceitem.iconic_representation) treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) treewidgetitem.setExpanded(item[u'expanded']) for count, frame in enumerate(serviceitem.get_frames()): treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) text = frame[u'title'] - treewidgetitem1.setText(0,text[:40]) + treewidgetitem1.setText(0, text[:40]) treewidgetitem1.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count)) if serviceItem == itemcount and serviceItemCount == count: From d3564b2df7b122bd760caf60cbf42a62b00fb05e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 6 Mar 2010 14:08:51 +0000 Subject: [PATCH 14/26] Fix translation --- 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 0c955f392..4b29fd7e7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -430,7 +430,7 @@ class ServiceManager(QtGui.QWidget): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) if len(serviceitem.notes) > 0: - title = self.trUtf8(u'(N) - %s' % serviceitem.title) + title = u'%s - %s' % (self.trUtf8('(N)'), serviceitem.title) else: title = serviceitem.title treewidgetitem.setText(0, title) From 77e671bd78192072d8d1435cfb3adeebcac658ab Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 7 Mar 2010 06:42:22 +0000 Subject: [PATCH 15/26] Remove unneeded version tagging --- openlp/core/utils/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index e85b2d939..256d5a090 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -33,13 +33,12 @@ log = logging.getLogger(__name__) def check_latest_version(config, current_version): version_string = current_version #set to prod in the distribution confif file. - environment = config.get_config(u'run environment', u'dev') last_test = config.get_config(u'last version test', datetime.now().date()) this_test = unicode(datetime.now().date()) config.set_config(u'last version test', this_test) if last_test != this_test: version_string = u'' - req = urllib2.Request(u'http://www.openlp.org/files/%s_version.txt' % environment) + req = urllib2.Request(u'http://www.openlp.org/files/version.txt') req.add_header(u'User-Agent', u'OpenLP/%s' % current_version) try: handle = urllib2.urlopen(req, None) From 5560aac57580502e0388199953422fcda13d5a1b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 7 Mar 2010 19:22:54 +0000 Subject: [PATCH 16/26] Fix expanding service items --- openlp/core/ui/servicemanager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 4b29fd7e7..ba9269244 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -599,12 +599,12 @@ class ServiceManager(QtGui.QWidget): self.serviceItems = [] self.isNew = True for item in tempServiceItems: - self.addServiceItem(item[u'service_item'], True) + self.addServiceItem(item[u'service_item'], False, item[u'expanded']) #Set to False as items may have changed rendering #does not impact the saved song so True may aslo be valid self.parent.serviceChanged(False, self.serviceName) - def addServiceItem(self, item, rebuild=False): + def addServiceItem(self, item, rebuild=False, expand=True): """ Add a Service item to the list @@ -624,12 +624,12 @@ class ServiceManager(QtGui.QWidget): if sitem == -1: self.serviceItems.append({u'service_item': item, u'order': len(self.serviceItems) + 1, - u'expanded':True}) + u'expanded':expand}) self.repaintServiceList(len(self.serviceItems) + 1, 0) else: self.serviceItems.insert(sitem + 1, {u'service_item': item, u'order': len(self.serviceItems)+1, - u'expanded':True}) + u'expanded':expand}) self.repaintServiceList(sitem + 1, 0) #if rebuilding list make sure live is fixed. if rebuild: From 6f87c362d1ff54f42d76acb3c6fe35d65bf3e081 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 7 Mar 2010 20:45:27 +0000 Subject: [PATCH 17/26] Use Icon to show we have Notes --- openlp/core/ui/servicemanager.py | 17 +++++++++++++---- openlp/plugins/images/lib/mediaitem.py | 2 +- resources/images/openlp-2.qrc | 1 + resources/images/service_item_notes.png | Bin 0 -> 876 bytes 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 resources/images/service_item_notes.png diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ba9269244..6765334dc 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -430,12 +430,21 @@ class ServiceManager(QtGui.QWidget): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) if len(serviceitem.notes) > 0: - title = u'%s - %s' % (self.trUtf8('(N)'), serviceitem.title) + icon = QtGui.QImage(serviceitem.icon) + icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, + QtCore.Qt.SmoothTransformation) + + overlay = QtGui.QImage(':/services/service_item_notes.png') + overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, + QtCore.Qt.SmoothTransformation) + painter = QtGui.QPainter(icon) + painter.drawImage(0, 0, overlay) + painter.end() + treewidgetitem.setIcon(0, build_icon(icon)) else: - title = serviceitem.title - treewidgetitem.setText(0, title) + treewidgetitem.setIcon(0, serviceitem.iconic_representation) + treewidgetitem.setText(0, serviceitem.title) treewidgetitem.setToolTip(0, serviceitem.notes) - treewidgetitem.setIcon(0, serviceitem.iconic_representation) treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) treewidgetitem.setExpanded(item[u'expanded']) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 830459843..75f2fd981 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -61,7 +61,7 @@ class ImageMediaItem(MediaManagerItem): def retranslateUi(self): self.OnNewPrompt = self.trUtf8('Select Image(s)') self.OnNewFileMasks = \ - self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp)') + self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp);; All files (*)') def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index b6509b528..28af4c31a 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -78,6 +78,7 @@ service_edit.png service_notes.png + service_item_notes.png service_bottom.png service_down.png service_top.png diff --git a/resources/images/service_item_notes.png b/resources/images/service_item_notes.png new file mode 100644 index 0000000000000000000000000000000000000000..59991dba85e745b69fbec46267c1e6414dc506c8 GIT binary patch literal 876 zcmV-y1C#uTP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00LnE00LnF!7x?&00007bV*G`2igM% z6A(GBp-}Ju00QhuL_t(I%k7lSYn)XS#((GB_nkL0X3VJ37F&O1hM}?L0kxK6v3}W)Y)E)e@67Y1)`%(wR)=ejFDw3F%b9 zwe(yL&xLz2JMM8ADK#>Uva&o|d^ zA-?j};~$mEgU8ywqODk!+VJ2&xiXaHna3$+2!e@;fEff&3cDn~Lu_6qwpM0p&;I#J zKe3*l=bN(I7#gl_RY&eG57zD^E8H5I8d%&A!j@Rv1iyu(ZD14p6|D6W64p@V_~zLM zkKK~-)YMcqb8>xoxF#bq;1Ed|h9%fb@*pB$(Xg0E!LVSY7*>$%NcE}TH}^BH*X!Zu zMRz8VaJitFqPd_sXx5Ltvyz}C#qD{Pk1F=TO|1a>E%QMzZj zpap25Xzp;iLv#0XbN0}Qn^XZXck1x`kumpZHjp7sFiT*)h}26VbuUH@NSGPc5mE=t z8!4n+i#A=EzW9Ug5r6kf>HW_34!+$X?0RA+l0xcYOeCL3F<~)bsoQXIg5;pNqPgNS zS2(9LJF|y|+#c~?{*k$-A8Wi`R$q>tL<$KDh9&C`D}i9Ww`BX}iYS622qFq-O|%%_ zCtg}wN=GN}n|OGnJ&pm%Fzc0T{iHpaq%M7TIYb=d?ztf42j0|!ll*q!j+4zcA;mz9 zkrX2-L@ey>(*d`hCt@r@qgDCs-2CWU)30@2%*H=GFa5&){JpUsCl6nHLdESXL{t#x z&@3ZTiaxkz+h@&2t91E~mCE<0&hq7@Wxot;0N3mF`i-og`1FP0H_FxGW8d7`@zHIy zI{8|om91_x%ZtA*l`bw^vL)auunIKm^>g-5pU~eVT7kkm>?h0s0000 Date: Mon, 8 Mar 2010 19:50:35 +0000 Subject: [PATCH 18/26] Minor servicemanager fixes --- openlp/core/ui/servicemanager.py | 34 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 6765334dc..c813e787e 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -158,20 +158,20 @@ class ServiceManager(QtGui.QWidget): # Add the bottom toolbar self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move to top'), u':/services/service_top.png', + self.trUtf8('Move to &top'), u':/services/service_top.png', self.trUtf8('Move to top'), self.onServiceTop) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move up'), u':/services/service_up.png', + self.trUtf8('Move &up'), u':/services/service_up.png', self.trUtf8('Move up order'), self.onServiceUp) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move down'), u':/services/service_down.png', + self.trUtf8('Move &down'), u':/services/service_down.png', self.trUtf8('Move down order'), self.onServiceDown) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move to bottom'), u':/services/service_bottom.png', + self.trUtf8('Move to &bottom'), u':/services/service_bottom.png', self.trUtf8('Move to end'), self.onServiceEnd) self.OrderToolbar.addSeparator() self.OrderToolbar.addToolbarButton( - self.trUtf8('Delete From Service'), u':/services/service_delete.png', + self.trUtf8('&Delete From Service'), u':/services/service_delete.png', self.trUtf8('Delete From Service'), self.onDeleteFromService) self.Layout.addWidget(self.OrderToolbar) # Connect up our signals and slots @@ -199,18 +199,20 @@ class ServiceManager(QtGui.QWidget): #build the context menu self.menu = QtGui.QMenu() self.editAction = self.menu.addAction(self.trUtf8('&Edit Item')) - self.editAction.setIcon(build_icon(':/services/service_edit.png')) + self.editAction.setIcon(build_icon(u':/services/service_edit.png')) self.notesAction = self.menu.addAction(self.trUtf8('&Notes')) - self.notesAction.setIcon(build_icon(':/services/service_notes.png')) + self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) + self.deleteAction = self.menu.addAction(self.trUtf8('&Delete From Service')) + self.deleteAction.setIcon(build_icon(u':/services/service_delete.png')) self.sep1 = self.menu.addAction(u'') self.sep1.setSeparator(True) self.previewAction = self.menu.addAction(self.trUtf8('&Preview Verse')) - self.previewAction.setIcon(build_icon(':/system/system_preview.png')) + self.previewAction.setIcon(build_icon(u':/system/system_preview.png')) self.liveAction = self.menu.addAction(self.trUtf8('&Live Verse')) - self.liveAction.setIcon(build_icon(':/system/system_live.png')) + self.liveAction.setIcon(build_icon(u':/system/system_live.png')) self.sep2 = self.menu.addAction(u'') self.sep2.setSeparator(True) - self.themeMenu = QtGui.QMenu(self.trUtf8('&Change Item Theme')) + self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme')) self.menu.addMenu(self.themeMenu) def contextMenu(self, point): @@ -232,6 +234,8 @@ class ServiceManager(QtGui.QWidget): action = self.menu.exec_(self.ServiceManagerList.mapToGlobal(point)) if action == self.editAction: self.remoteEdit() + if action == self.deleteAction: + self.onDeleteFromService() if action == self.notesAction: self.onServiceItemNoteForm() if action == self.previewAction: @@ -327,6 +331,7 @@ class ServiceManager(QtGui.QWidget): Record if an item is collapsed Used when repainting the list to get the correct state """ + print "expand" pos = item.data(0, QtCore.Qt.UserRole).toInt()[0] self.serviceItems[pos -1 ][u'expanded'] = True @@ -428,12 +433,12 @@ class ServiceManager(QtGui.QWidget): self.ServiceManagerList.clear() for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] + print item[u'expanded'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) if len(serviceitem.notes) > 0: icon = QtGui.QImage(serviceitem.icon) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - overlay = QtGui.QImage(':/services/service_item_notes.png') overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) @@ -447,7 +452,6 @@ class ServiceManager(QtGui.QWidget): treewidgetitem.setToolTip(0, serviceitem.notes) treewidgetitem.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(item[u'order'])) - treewidgetitem.setExpanded(item[u'expanded']) for count, frame in enumerate(serviceitem.get_frames()): treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem) text = frame[u'title'] @@ -455,7 +459,11 @@ class ServiceManager(QtGui.QWidget): treewidgetitem1.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count)) if serviceItem == itemcount and serviceItemCount == count: - self.ServiceManagerList.setCurrentItem(treewidgetitem1) + #preserve expanding status as setCurrentItem sets it to True + temp = item[u'expanded'] + self.ServiceManagerList.setCurrentItem(treewidgetitem1) + item[u'expanded'] = temp + treewidgetitem.setExpanded(item[u'expanded']) def onSaveService(self, quick=False): """ From b75bc2abbf64b792f4eb54066c0db6b4594438c8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 8 Mar 2010 19:55:13 +0000 Subject: [PATCH 19/26] Remove Print statements --- openlp/core/ui/servicemanager.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c813e787e..b263e2366 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -331,7 +331,6 @@ class ServiceManager(QtGui.QWidget): Record if an item is collapsed Used when repainting the list to get the correct state """ - print "expand" pos = item.data(0, QtCore.Qt.UserRole).toInt()[0] self.serviceItems[pos -1 ][u'expanded'] = True @@ -433,7 +432,6 @@ class ServiceManager(QtGui.QWidget): self.ServiceManagerList.clear() for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] - print item[u'expanded'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) if len(serviceitem.notes) > 0: icon = QtGui.QImage(serviceitem.icon) From 0ef8005b52df384cbed49268a9ae731634b4209f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 9 Mar 2010 08:07:42 +0200 Subject: [PATCH 20/26] Fixed up some problems and inadvertant bugs from the move to the scripts directory. --- openlp/plugins/alerts/lib/alertsmanager.py | 2 +- resources/i18n/openlp_en.ts | 5488 +++++++++++++++++--- scripts/get-strings.py | 21 +- 3 files changed, 4684 insertions(+), 827 deletions(-) diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 6838fefa0..41fc25562 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -76,7 +76,7 @@ class AlertsManager(QtCore.QObject): display text """ log.debug(u'display alert called %s' % text) - self.parent.maindisplay.parent.StatusBar.showMessage(self.trUtf8(u'')) + self.parent.maindisplay.parent.StatusBar.showMessage(u'') self.alertList.append(text) if self.timer_id != 0 or self.parent.maindisplay.mediaLoaded: self.parent.maindisplay.parent.StatusBar.showMessage(\ diff --git a/resources/i18n/openlp_en.ts b/resources/i18n/openlp_en.ts index d92273c1d..6f9d4a26a 100644 --- a/resources/i18n/openlp_en.ts +++ b/resources/i18n/openlp_en.ts @@ -4,879 +4,2296 @@ BibleMediaItem - + Quick - - AlertsTab - - - Alerts - - - - - Font - - - - - Ui_OpenLPExportDialog - - - Author - - - - - Ui_AmendThemeDialog - - - Vertical - - - - - AlertForm - - - Display - - - - - SplashScreen - - - Starting - - - - - MediaManagerItem - - - New - - - - - EditCustomForm - - - Error - - - - - Ui_AmendThemeDialog - - - Center - - - - - TestMediaManager: - - - Item2 - - - - - AboutForm - - - License - - - - - TestMediaManager: - - - Item1 - - - - - Ui_MainWindow - - - English - - - - - Ui_AmendThemeDialog - - - pt - - - - - Ui_OpenSongImportDialog - - - Close - - - - - Ui_AmendThemeDialog - - - Middle - - - - - Opaque - - - Ui_customEditDialog - - Clear - - - - - Save - - - - - BibleImportForm - - - Information - - - - - Ui_OpenSongExportDialog - - - Lyrics - - - - - Ui_customEditDialog - - - Delete - - - - - Ui_OpenLPImportDialog - - - Close - - - - - ImageTab - - - sec - - - - - Ui_OpenSongExportDialog - - - Close - - - - - BibleMediaItem - - - Clear - - - - - Ui_OpenSongExportDialog - - - Author - - - - - Ui_PluginViewDialog - - - Inactive - - - - - Ui_OpenLPImportDialog - - - Import - - - - - Ui_MainWindow - - - F9 - - - - - F8 - - - - - Ui_SongMaintenanceDialog - - - Topics - - - - - Ui_AmendThemeDialog - - - Left - - - - - SongMaintenanceForm - - - Error - - - - - Ui_AmendThemeDialog - - - Top - - - - - Ui_MainWindow - - - F7 - - - - - Ui_AmendThemeDialog - - - Alignment - - - - - MediaManagerItem - - - Add - - - - - BibleMediaItem - - - Search - - - - - Ui_SongMaintenanceDialog - - - Edit - - - - - Ui_EditSongDialog - - - Theme - - - - - SongsPlugin - - - OpenSong - - - - - MediaManagerItem - - - Edit - - - - - Load - - - - - Ui_AmendThemeDialog - - - Bottom - - - - - Ui_BibleImportDialog - - - NIV - - - - - Ui_AmendThemeDialog - - - Image - - - - - GeneralTab - - - Screen - - - - - ThemeManager - - - Error - - - - - Ui_AmendThemeDialog - - - Normal - - - - - AlertsTab - - - s - - - - - Ui_OpenLPExportDialog - - - Close - - - - - Ui_OpenLPImportDialog - - - Author + + Delete selected slide BiblesTab - - Bibles + + ( and ) - Ui_AuditDetailDialog + RemoteTab - - Summary + + Remotes - Ui_BibleImportDialog + ServiceManager - - Import - - - - - SongBookForm - - - Error - - - - - Ui_OpenLPImportDialog - - - Title - - - - - Ui_PluginViewDialog - - - TextLabel - - - - - AboutForm - - - Contribute - - - - - GeneralTab - - - Monitors + + Save Service Ui_AmendThemeDialog - - Bold - - - - - TopicsForm - - - Error - - - - - SlideController - - - Preview - - - - - Ui_OpenLPExportDialog - - - Export - - - - - BibleMediaItem - - - Keep - - - - - Ui_AmendThemeDialog - - - Right - - - - - Ui_EditSongDialog - - - Comments - - - - - AboutForm - - - Credits - - - - - AlertForm - - - Cancel - - - - - AuthorsForm - - - Error + + Shadow Size: Ui_OpenSongExportDialog - - Export - - - - - MediaManagerItem - - - Preview - - - - - Ui_SettingsDialog - - - Settings - - - - - BibleMediaItem - - - Information - - - - - Ui_OpenLPExportDialog - - - Lyrics - - - - - ImageTab - - - Images - - - - - Ui_AmendThemeDialog - - - Horizontal - - - - - Circular - - - - - Ui_EditSongDialog - - - Topic - - - - - BibleMediaItem - - - Advanced - - - - - MediaTab - - - Media - - - - - AboutForm - - + Close - Ui_EditSongDialog + ThemeManager - - Edit - - - - - Ui_OpenLPImportDialog - - - Lyrics + + Import Theme Ui_AmendThemeDialog - - px + + Slide Transition - Ui_EditSongDialog + ImportWizardForm - - Delete - - - - - Ui_OpenSongExportDialog - - - Title + + Bible Exists ThemesTab - - Themes + + Theme level - Ui_EditSongDialog + BibleMediaItem - - Authors + + Bible - Ui_BibleImportDialog + ServiceManager - - KJV + + Save Changes to Service? - Ui_SongMaintenanceDialog + SongUsagePlugin - - Authors - - - - - Ui_AuditDetailDialog - - - Detailed - - - - - Ui_SongMaintenanceDialog - - - Delete - - - - - SlideController - - - s - - - - - SongMediaItem - - - Titles - - - - - Clear - - - - - Ui_BibleImportDialog - - - Crosswalk - - - - - Ui_customEditDialog - - - Edit - - - - - PresentationTab - - - available - - - - - ThemeManager - - - default - - - - - EditSongForm - - - Error - - - - - Ui_SongMaintenanceDialog - - - Add - - - - - Ui_BibleImportDialog - - - Cancel + + &Delete recorded data Ui_OpenLPExportDialog - - Title + + Song Title - GeneralTab + Ui_customEditDialog - - General - - - - - primary + + Edit selected slide - Ui_AmendThemeDialog + SongMediaItem - - Preview + + CCLI Licence: + + + + + Ui_SongUsageDeleteDialog + + + Audit Delete + + + + + BibleMediaItem + + + Clear + + + + + Ui_BibleImportWizard + + + Bible Import Wizard + + + + + Ui_customEditDialog + + + Edit All + + + + + Ui_ServiceNoteEdit + + + Service Item Notes + + + + + SongMaintenanceForm + + + Couldn't save your author! + + + + + Ui_customEditDialog + + + Clear + + + + + ThemesTab + + + Global theme + + + + + SongUsagePlugin + + + Start/Stop live song usage recording + + + + + MainWindow + + + The Main Display has been blanked out + + + + + Ui_OpenSongExportDialog + + + Lyrics + + + + + Ui_AlertDialog + + + Display + + + + + Ui_customEditDialog + + + Delete + + + + + SongMaintenanceForm + + + This author can't be deleted, they are currently assigned to at least one song! + + + + + ThemeManager + + + Create a new theme + + + + + Ui_MainWindow + + + Open an existing service SlideController - - Live + + Move to previous + + + + + Edit and re-preview Song + + + + + Ui_PluginViewDialog + + + Plugin Details AlertsTab - - Preview + + pt + + + + + Edit History: + + + + + SlideController + + + Delay between slides in seconds + + + + + SongMaintenanceForm + + + Couldn't add your book! BiblesTab - - continuous + + verse per line + + + + + Ui_customEditDialog + + + Theme: + + + + + SongMaintenanceForm + + + Error + + + + + Ui_BibleImportWizard + + + Bible: + + + + + ImportWizardForm + + + You need to specify a file with books of the Bible to use in the import! + + + + + ThemeManager + + + Delete Theme + + + + + SplashScreen + + + Splash Screen + + + + + SongMediaItem + + + Song + + + + + SongUsageDeleteForm + + + Delete Selected Audit Events? + + + + + Ui_OpenSongExportDialog + + + Song Title + + + + + BibleMediaItem + + + Search + + + + + Ui_MainWindow + + + List the Plugins + + + + + SongMaintenanceForm + + + No author selected! + + + + + SongUsagePlugin + + + <b>SongUsage Plugin</b><br>This plugin records the use of songs and when they have been used during a live service + + + + + Ui_customEditDialog + + + Move slide Up 1 + + + + + SongsPlugin + + + OpenSong + + + + + AlertsManager + + + Alert message created and delayed + + + + + Ui_EditSongDialog + + + Alternative Title: + + + + + ServiceManager + + + Open Service + + + + + BiblesTab + + + Display Style: Ui_AmendThemeDialog - + + Image + + + + + EditSongForm + + + You need to enter a song title. + + + + + ThemeManager + + + Error + + + + + ImportWizardForm + + + Invalid Bible Location + + + + + ThemesTab + + + Global level + + + + + ThemeManager + + + Make Global + + + + + Ui_MainWindow + + + &Service Manager + + + + + Ui_OpenLPImportDialog + + + Author + + + + + Ui_AmendThemeDialog + + + Height: + + + + + Ui_BibleImportWizard + + + Books Location: + + + + + ThemeManager + + + Delete a theme + + + + + Ui_BibleImportWizard + + + Crosswalk + + + + + SongBookForm + + + Error + + + + + Ui_AuthorsDialog + + + Last name: + + + + + Ui_customEditDialog + + + Title: + + + + + ImportWizardForm + + + You need to set a copyright for your Bible! Bibles in the Public Domain need to be marked as such. + + + + + SongMediaItem + + + Maintain the lists of authors, topics and books + + + + + Ui_AlertEditDialog + + + Save + + + + + EditCustomForm + + + You have unsaved data + + + + + BibleMediaItem + + + To: + + + + + Ui_AmendThemeDialog + + + Outline + + + + + BibleMediaItem + + + Text Search + + + + + Ui_OpenLPExportDialog + + + openlp.org Song Exporter + + + + + SongUsagePlugin + + + Delete song usage to specified date + + + + + Ui_SongUsageDetailDialog + + + Report Location + + + + + Ui_BibleImportWizard + + + OpenSong + + + + + Ui_MainWindow + + + Open Service + + + + + SongMediaItem + + + Titles + + + + + ImageMediaItem + + + Select Image(s) + + + + + BibleMediaItem + + + Search Type: + + + + + Ui_MainWindow + + + Media Manager + + + + + ImageMediaItem + + + Images (*.jpg *jpeg *.gif *.png *.bmp);; All files (*) + + + + + Ui_MainWindow + + + Alt+F4 + + + + + MediaManagerItem + + + &Preview + + + + + GeneralTab + + + CCLI Details + + + + + SongSelect Password: + + + + + Ui_MainWindow + + + Toggle the visibility of the Preview Panel + + + + + SongMaintenanceForm + + + Are you sure you want to delete the selected book? + + + + + Ui_MainWindow + + + &User Guide + + + + + SongUsageDeleteForm + + + Are you sure you want to delete selected Audit Data? + + + + + Ui_MainWindow + + + Set the interface language to English + + + + + Ui_AmendThemeDialog + + + Main Font + + + + + ImportWizardForm + + + Empty Copyright + + + + + CustomPlugin + + + <b>Custom Plugin</b><br>This plugin allows slides to be displayed on the screen in the same way songs are. This plugin provides greater freedom over the songs plugin.<br> + + + + + AuthorsForm + + + You need to type in the first name of the author. + + + + + SongsTab + + + Display Verses on Live Tool bar: + + + + + ServiceManager + + + Move to top + + + + + ImageMediaItem + + + Override background + + + + + Ui_SongMaintenanceDialog + + + Edit + + + + + Ui_OpenSongExportDialog + + + Select All + + + + + ThemesTab + + + Use the theme from each song in the database. If a song doesn't have a theme associated with it, then use the service's theme. If the service doesn't have a theme, then use the global theme. + + + + + PresentationMediaItem + + + Presentation + + + + + Ui_AmendThemeDialog + + + Solid Color + + + + + CustomTab + + + Custom + + + + + Ui_OpenLPImportDialog + + + Ready to import + + + + + MainWindow + + + OpenLP version %s has been updated to version %s + +You can obtain the latest version from http://openlp.org + + + + + Ui_BibleImportWizard + + + File Location: + + + + + SlideController + + + Go to Verse + + + + + Ui_MainWindow + + + &Import + + + + + Quit OpenLP + + + + + Ui_BibleImportWizard + + + This wizard will help you to import Bibles from a variety of formats. Click the next button below to start the process by selecting a format to import from. + + + + + Ui_OpenLPExportDialog + + + Title + + + + + ImportWizardForm + + + Empty Version Name + + + + + Ui_MainWindow + + + &Preview Panel + + + + + SlideController + + + Start continuous loop + + + + + Ui_AboutDialog + + + License + + + + + GeneralTab + + + primary + + + + + Ui_EditSongDialog + + + Add a Theme + + + + + Ui_MainWindow + + + &New + + + + + Ui_customEditDialog + + + Credits: + + + + + SlideController + + + Live + + + + + ImportWizardForm + + + You need to specify a file of Bible verses to import! + + + + + BiblesTab + + + continuous + + + + + Ui_EditVerseDialog + + + Number + + + + + GeneralTab + + + Application Startup + + + + + Ui_AmendThemeDialog + + + Use Default Location: + + + + + Ui_OpenSongImportDialog + + + Import + + + + + Ui_MainWindow + + + Ctrl+N + + + + + Ui_EditSongDialog + + + Verse Order: + + + + + Ui_SongUsageDetailDialog + + + ASelect Date Range + + + + + Ui_MainWindow + + + Default Theme: + + + + + Toggle Preview Panel + + + + + SongMediaItem + + + Lyrics + + + + + Ui_OpenLPImportDialog + + + Progress: + + + + + Ui_AmendThemeDialog + + + Shadow + + + + + GeneralTab + + + Select monitor for output display: + + + + + Ui_AmendThemeDialog + + + Italics + + + + + ServiceManager + + + Create a new service + + + + + Ui_AmendThemeDialog + + + Background: + + + + + Ui_OpenLPImportDialog + + + openlp.org Song Importer + + + + + Ui_BibleImportWizard + + + Copyright: + + + + + ThemesTab + + + Service level + + + + + BiblesTab + + + [ and ] + + + + + Ui_customEditDialog + + + Save + + + + + MediaManagerItem + + + You must select one or more items + + + + + GeneralTab + + + Application Settings + + + + + ServiceManager + + + Save this service + + + + + ImportWizardForm + + + Open Books CSV file + + + + + GeneralTab + + + SongSelect Username: + + + + + Ui_AmendThemeDialog + + + X Position: + + + + + BibleMediaItem + + + No matching book could be found in this Bible. + + + + + Ui_BibleImportWizard + + + Server: + + + + + Download Options + + + + + ImportWizardForm + + + Invalid OpenSong Bible + + + + + GeneralTab + + + CCLI Number: + + + + + Ui_AmendThemeDialog + + + Center + + + + + ServiceManager + + + Theme: + + + + + Ui_MainWindow + + + &Live + + + + + SongMaintenanceForm + + + Delete Topic + + + + + Ui_MainWindow + + + English + + + + + ImageMediaItem + + + You must select one or more items + + + + + Ui_AuthorsDialog + + + First name: + + + + + Ui_BibleImportWizard + + + Permission: + + + + + Ui_OpenSongImportDialog + + + Close + + + + + Ui_AmendThemeDialog + + + Opaque + + + + + SongMaintenanceForm + + + This book can't be deleted, it is currently assigned to at least one song! + + + + + ImportWizardForm + + + Your Bible import failed. + + + + + SlideController + + + Start playing media + + + + + SongMediaItem + + + Type: + + + + + Ui_AboutDialog + + + Close + + + + + TopicsForm + + + You need to type in a topic name! + + + + + Ui_OpenSongExportDialog + + + Song Export List + + + + + BibleMediaItem + + + Dual: + + + + + ImageTab + + + sec + + + + + ServiceManager + + + Delete From Service + + + + + GeneralTab + + + Automatically open the last service + + + + + Ui_OpenLPImportDialog + + + Song Import List + + + + + Ui_OpenSongExportDialog + + + Author + + + + + Ui_AmendThemeDialog + + + Outline Color: + + + + + Ui_BibleImportWizard + + + Select Import Source + + + + + Ui_MainWindow + + + F9 + + + + + F8 + + + + + ServiceManager + + + &Change Item Theme + + + + + Ui_SongMaintenanceDialog + + + Topics + + + + + Ui_OpenLPImportDialog + + + Import File Song List + + + + + Ui_customEditDialog + + + Edit Custom Slides + + + + + Ui_EditSongDialog + + + &Remove + + + + + Ui_BibleImportWizard + + + Set up the Bible's license details. + + + + + Ui_AmendThemeDialog + + + Alignment + + + + + SongMaintenanceForm + + + Delete Book + + + + + ThemeManager + + + Edit a theme + + + + + Ui_BibleImportWizard + + + BibleGateway + + + + + GeneralTab + + + Preview Next Song from Service Manager + + + + + Ui_EditSongDialog + + + Title && Lyrics + + + + + SongMaintenanceForm + + + No book selected! + + + + + SlideController + + + Move to live + + + + + Ui_EditVerseDialog + + + Other + + + + + Ui_EditSongDialog + + + Theme + + + + + Ui_EditVerseDialog + + + Verse + + + + + Ui_MainWindow + + + Save the current service to disk + + + + + BibleMediaItem + + + Chapter: + + + + + Ui_AmendThemeDialog + + + Bottom + + + + + PresentationTab + + + Available Controllers + + + + + ImportWizardForm + + + Open Verses CSV file + + + + + TopicsForm + + + Error + + + + + RemoteTab + + + Remotes Receiver Port + + + + + Ui_MainWindow + + + &View + + + + + Ui_AmendThemeDialog + + + Normal + + + + + Ui_OpenLPExportDialog + + + Close + + + + + Ui_BibleImportWizard + + + Username: + + + + + ThemeManager + + + Edit Theme + + + + + ServiceManager + + + &Preview Verse + + + + + Ui_AlertDialog + + + Alert Message + + + + + ImportWizardForm + + + Finished import. + + + + + GeneralTab + + + Show blank screen warning + + + + + AlertsTab + + + Location: + + + + + Ui_EditSongDialog + + + Authors, Topics && Book + + + + + EditSongForm + + + You need to enter some verses. + + + + + BibleMediaItem + + + Bible not fully loaded + + + + + CustomTab + + + Display Footer: + + + + + BiblePlugin + + + <strong>Bible Plugin</strong><br />This plugin allows bible verses from different sources to be displayed on the screen during the service. + + + + + Ui_EditSongDialog + + + Copyright Information + + + + + Ui_MainWindow + + + &Export + + + + + Ui_AmendThemeDialog + + + Bold + + + + + SongsPlugin + + + Export songs in OpenLP 2.0 format + + + + + MediaManagerItem + + + Load a new + + + + + AlertEditForm + + + Missing data + + + + + SongsPlugin + + + <b>Song Plugin</b> <br>This plugin allows Songs to be managed and displayed.<br> + + + + + Ui_AmendThemeDialog + + + Footer Font + + + + + EditSongForm + + + Invalid verse entry - vX + + + + + BibleMediaItem + + + No Book Found + + + + + Ui_OpenLPExportDialog + + + Export + + + + + Ui_BibleImportWizard + + + Location: + + + + + BibleMediaItem + + + Keep + + + + + SongUsagePlugin + + + Generate report on Song Usage + + + + + Ui_EditSongDialog + + + Topic + + + + + Ui_MainWindow + + + &Open + + + + + PresentationMediaItem + + + Present using: + + + + + ServiceManager + + + &Live Verse + + + + + Ui_EditVerseDialog + + + Pre-Chorus + + + + + Ui_EditSongDialog + + + Lyrics: + + + + + Ui_AboutDialog + + + Project Lead + Raoul "superfly" Snyman + +Developers + Tim "TRB143" Bentley + Jonathan "gushie" Corwin + Michael "cocooncrash" Gorven + Scott "sguerrieri" Guerrieri + Raoul "superfly" Snyman + Maikel Stuivenberg + Martin "mijiti" Thompson + Jon "Meths" Tibble + Carsten "catini" Tingaard + +Testers + Wesley "wrst" Stout + + + + + Ui_OpenLPExportDialog + + + Lyrics + + + + + AuthorsForm + + + You haven't set a display name for the author, would you like me to combine the first and last names for you? + + + + + SongMediaItem + + + Clear + + + + + AmendThemeForm + + + Slide Height is %s rows + + + + + Ui_OpenSongImportDialog + + + Progress: + + + + + Ui_MainWindow + + + Toggle Theme Manager + + + + + Ui_AlertDialog + + + Alert Text: + + + + + Ui_EditSongDialog + + + Edit + + + + + AlertsTab + + + Font Color: + + + + + Ui_AmendThemeDialog + + + Theme Maintenance + + + + + CustomTab + + + Custom Display + + + + + Ui_OpenSongExportDialog + + + Title + + + + + Ui_AmendThemeDialog + + + <Color1> + + + + + Ui_EditSongDialog + + + Authors + + + + + ThemeManager + + + Export Theme + + + + + ImageMediaItem + + + No items selected... + + + + + Ui_SongBookDialog + + + Name: + + + + + Ui_AuthorsDialog + + + Author Maintenance + + + + + Ui_AmendThemeDialog + + + Font Footer + + + + + Ui_MainWindow + + + &Settings + + + + + &Options + + + + + BibleMediaItem + + + Results: + + + + + Ui_OpenLPExportDialog + + + Full Song List + + + + + Ui_OpenSongImportDialog + + + OpenSong Folder: + + + + + SlideController + + + Move to last + + + + + Ui_OpenLPExportDialog + + + Progress: + + + + + Ui_SongMaintenanceDialog + + + Add + + + + + SongMaintenanceForm + + + Are you sure you want to delete the selected author? + + + + + SongUsagePlugin + + + Song Usage Status + + + + + BibleMediaItem + + + Verse Search + + + + + Ui_SongBookDialog + + + Edit Book + + + + + EditSongForm + + + Save && Preview + + + + + Ui_SongBookDialog + + + Publisher: + + + + + Ui_AmendThemeDialog + + + Font Weight: + + + + + Ui_BibleImportWizard + + + Bible Filename: + + + + + Ui_AmendThemeDialog + + Transparent @@ -884,84 +2301,63 @@ SongMediaItem - + Search - Ui_OpenSongImportDialog + Ui_BibleImportWizard - - Import + + Format: Ui_AmendThemeDialog - + Background - Ui_EditSongDialog + Ui_BibleImportWizard - - Add + + Importing + + + + + Ui_customEditDialog + + + Edit all slides + + + + + MediaMediaItem + + + Select Media + + + + + PresentationMediaItem + + + Select Presentation(s) SongMediaItem - - Lyrics - - - - - MediaManagerItem - - - Delete - - - - - Ui_MainWindow - - - F11 - - - - - F10 - - - - - Ui_AuditDetailDialog - - - to - - - - - Ui_MainWindow - - - F12 - - - - - SongMediaItem - - + Authors @@ -969,23 +2365,2479 @@ Ui_PluginViewDialog - + Active + + Ui_MainWindow + + + Save the current service under a new name + + + + + Ctrl+O + + + Ui_AmendThemeDialog - - Italics + + Other Options + + + + + SongMaintenanceForm + + + Couldn't add your author! + + + + + Ui_AlertEditDialog + + + Edit + + + + + Ui_EditSongDialog + + + Song Editor + + + + + AlertsTab + + + Font + + + + + SongsPlugin + + + &Song + + + + + Ui_MainWindow + + + &File + + + + + MediaManagerItem + + + &Edit + + + + + Ui_AmendThemeDialog + + + Vertical - + + Width: + + + + + ThemeManager + + + You are unable to delete the default theme! + + + + + ThemesTab + + + Use the global theme, overriding any themes associated with either the service or the songs. + + + + + BibleMediaItem + + + Version: + + + + + Ui_AboutDialog + + + OpenLP <version> build <revision> - Open Source Lyrics Projection + +OpenLP is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) for church worship using a computer and a data projector. + +Find out more about OpenLP: http://openlp.org/ + +OpenLP is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below. + + + + + SongsPlugin + + + OpenLP 2.0 + + + + + ServiceManager + + + New Service + + + + + Ui_TopicsDialog + + + Topic name: + + + + + ThemeManager + + + File is not a valid theme! + + + + + Ui_BibleImportWizard + + + License Details + + + + + ServiceManager + + + Move down + + + + + Ui_EditSongDialog + + + R&emove + + + + + Ui_AmendThemeDialog + + + Middle + + + + + Ui_BibleImportWizard + + + Verse Location: + + + + + AlertEditForm + + + Item selected to Edit + + + + + BibleMediaItem + + + From: + + + + + Ui_AmendThemeDialog + + + Shadow Color: + + + + + ServiceManager + + + &Notes + + + + + Ui_MainWindow + + + E&xit + + + + + Ui_OpenLPImportDialog + + + Close + + + + + MainWindow + + + OpenLP Version Updated + + + + + Ui_customEditDialog + + + Replace edited slide + + + + + Add new slide at bottom + + + + + EditCustomForm + + + You need to enter a title + + + + + ThemeManager + + + Theme Exists + + + + + Ui_MainWindow + + + &Help + + + + + Ui_OpenSongExportDialog + + + OpenSong Song Exporter + + + + + Ui_AmendThemeDialog + + + Vertical Align: + + + + + TestMediaManager + + + Item2 + + + + + Item1 + + + + + Ui_AmendThemeDialog + + + Top + + + + + BiblesTab + + + Display Dual Bible Verses + + + + + Ui_MainWindow + + + Toggle Service Manager + + + + + MediaManagerItem + + + &Add to Service + + + + + AmendThemeForm + + + First Color: + + + + + ThemesTab + + + Song level + + + + + alertsPlugin + + + Show an alert message + + + + + Ui_MainWindow + + + Ctrl+F1 + + + + + SongMaintenanceForm + + + Couldn't save your topic! + + + + + Ui_OpenLPExportDialog + + + Remove Selected + + + + + ThemeManager + + + Delete theme + + + + + ImageTab + + + Image Settings + + + + + Ui_OpenSongImportDialog + + + OpenSong Song Importer + + + + + BiblesTab + + + Bibles + + + + + SongUsagePlugin + + + &Extract recorded data + + + + + AlertsTab + + + Font Name: + + + + + Ui_MainWindow + + + &Web Site + + + + + MediaManagerItem + + + Send the selected item live + + + + + Ui_MainWindow + + + M&ode + + + + + Translate the interface to your language + + + + + Service Manager + + + + + CustomMediaItem + + + Custom + + + + + Ui_BibleImportWizard + + + OSIS + + + + + SongsPlugin + + + openlp.org 1.0 + + + + + Ui_MainWindow + + + &Theme + + + + + Ui_EditVerseDialog + + + Edit Verse + + + + + Ui_MainWindow + + + &Language + + + + + SlideController + + + Verse + + + + + ImportWizardForm + + + You need to specify an OpenSong Bible file to import! + + + + + ServiceManager + + + Your service is unsaved, do you want to save those changes before creating a new one ? + + + + + Ui_OpenSongExportDialog + + + Remove Selected + + + + + SongMediaItem + + + Search: + + + + + MainWindow + + + Save Changes to Service? + + + + + Your service has changed, do you want to save those changes? + + + + + EditSongForm + + + Invalid verse entry - values must be Numeric, I,B,C,T,P,E,O + + + + + Ui_EditSongDialog + + + &Add to Song + + + + + Ui_MainWindow + + + &About + + + + + BiblesTab + + + Only show new chapter numbers + + + + + ImportWizardForm + + + You need to specify a version name for your Bible! + + + + + Ui_AlertEditDialog + + + Delete + + + + + EditCustomForm + + + Error + + + + + RemotesPlugin + + + <b>Remote Plugin</b><br>This plugin provides the ability to send messages to a running version of openlp on a different computer.<br>The Primary use for this would be to send alerts from a creche + + + + + SongMaintenanceForm + + + This topic can't be deleted, it is currently assigned to at least one song! + + + + + BibleMediaItem + + + Find: + + + + + AlertEditForm + + + Item selected to Add + + + + + Ui_AmendThemeDialog + + + Right + + + + + ThemeManager + + + Save Theme - (%s) + + + + + ImageMediaItem + + + Allow background of live slide to be overridden + + + + + MediaManagerItem + + + Add the selected item(s) to the service + + + + + AuthorsForm + + + Error + + + + + BibleMediaItem + + + Book: + + + + + Ui_AmendThemeDialog + + + Font Color: + + + + + Ui_OpenLPExportDialog + + + Select openlp.org export filename: + + + + + Ui_SettingsDialog + + + Settings + + + + + BiblesTab + + + Verse Display + + + + + MediaManagerItem + + + Edit the selected + + + + + SlideController + + + Move to next + + + + + Ui_MainWindow + + + &Plugin List + + + + + BiblePlugin + + + &Bible + + + + + Ui_BibleImportWizard + + + Web Download + + + + + Ui_AmendThemeDialog + + + Horizontal + + + + + ImportWizardForm + + + Open OSIS file + + + + + SongMaintenanceForm + + + Couldn't save your book! + + + + + Couldn't add your topic! + + + + + Ui_AmendThemeDialog + + + pt + + + + + Ui_MainWindow + + + &Add Tool... + + + + + Ui_AmendThemeDialog + + + <Color2> + + + + + ServiceManager + + + Move up + + + + + Ui_OpenLPImportDialog + + + Lyrics + + + + + BiblesTab + + + No brackets + + + + + Ui_AlertEditDialog + + + Maintain Alerts + + + + + Ui_AmendThemeDialog + + + px + + + + + ServiceManager + + + Select a theme for the service + + + + + ThemesTab + + + Themes + + + + + ServiceManager + + + Move to bottom + + + + + Ui_PluginViewDialog + + + Status: + + + + + Ui_EditSongDialog + + + CCLI Number: + + + + + ImportWizardForm + + + This Bible already exists! Please import a different Bible or first delete the existing one. + + + + + Ui_MainWindow + + + &Translate + + + + + AlertEditForm + + + Please Save or Clear seletced item + + + + + Ui_MainWindow + + + Save Service As + + + + + Ui_SongMaintenanceDialog + + + Authors + + + + + SongUsageDetailForm + + + Output File Location + + + + + BiblesTab + + + { and } + + + + + GeneralTab + + + Prompt to save Service before starting New + + + + + ImportWizardForm + + + Starting import... + + + + + BiblesTab + + + Note: +Changes don't affect verses already in the service + + + + + Ui_EditVerseDialog + + + Intro + + + + + ServiceManager + + + Move up order + + + + + PresentationTab + + + available + + + + + ThemeManager + + + default + + + + + SongMaintenanceForm + + + Delete Author + + + + + Ui_AmendThemeDialog + + + Display Location + + + + + Ui_PluginViewDialog + + + Version: + + + + + Ui_AlertEditDialog + + + Add + + + + + GeneralTab + + + General + + + + + Ui_AmendThemeDialog + + + Y Position: + + + + + ServiceManager + + + Move down order + + + + + BiblesTab + + + verse per slide + + + + + Ui_BibleImportWizard + + + Welcome to the Bible Import Wizard + + + + + Ui_AmendThemeDialog + + + Show Shadow: + + + + + AlertsTab + + + Preview + + + + + alertsPlugin + + + <b>Alerts Plugin</b><br>This plugin controls the displaying of alerts on the presentations screen + + + + + GeneralTab + + + Show the splash screen + + + + + Ui_MainWindow + + + New Service + + + + + SlideController + + + Move to first + + + + + Ui_MainWindow + + + &Online Help + + + + + SlideController + + + Blank Screen + + + + + Ui_MainWindow + + + Save Service + + + + + Save &As... + + + + + Toggle the visibility of the Media Manager + + + + + MediaManagerItem + + + Delete the selected item + + + + + Ui_EditSongDialog + + + Add + + + + + alertsPlugin + + + &Alert + + + + + BibleMediaItem + + + Advanced + + + + + ImageMediaItem + + + Image(s) + + + + + Ui_MainWindow + + + F11 + + + + + F10 + + + + + F12 + + + + + Ui_BibleImportWizard + + + Select the import format, and where to import from. + + + + + Ui_MainWindow + + + Alt+F7 + + + + + Add an application to the list of tools + + + + + MediaPlugin + + + <b>Media Plugin</b><br>This plugin allows the playing of audio and video media + + + + + BiblesTab + + + Bible Theme: + + + + + SongsPlugin + + + Export songs in openlp.org 1.0 format + + + + + Ui_MainWindow + + + Theme Manager + + + + + AlertsTab + + + Alerts + + + + + Ui_customEditDialog + + + Move slide down 1 + + + + + Ui_AmendThemeDialog + + + Font: + + + + + ServiceManager + + + Load an existing service + + + + + Ui_MainWindow + + + Toggle the visibility of the Theme Manager + + + + + PresentationTab + + + Presentations + + + + + SplashScreen + + + Starting + + + + + ImageTab + + + Slide Loop Delay: + + + + + ServiceManager + + + Move to end + + + + + AlertsTab + + + Alert timeout: + + + + + Ui_MainWindow + + + &Preview Pane + + + + + MediaManagerItem + + + Add a new + + + + + ThemeManager + + + Select Theme Import File + + + + + New Theme + + + + + MediaMediaItem + + + Media + + + + + Ui_BibleImportWizard + + + Password: + + + + + Ui_AmendThemeDialog + + + Outline Size: + + + + + Ui_OpenSongExportDialog + + + Progress: + + + + + AmendThemeForm + + + Second Color: + + + + + Ui_EditSongDialog + + + Theme, Copyright Info && Comments + + + + + Ui_MainWindow + + + &Theme Manager + + + + + Ui_OpenLPImportDialog + + + Select openlp.org songfile to import: + + + + + Ui_EditSongDialog + + + Song Book + + + + + alertsPlugin + + + F7 + + + + + Ui_OpenLPExportDialog + + + Author + + + + + Ui_AmendThemeDialog + + + Wrap Indentation + + + + + ThemeManager + + + Import a theme + + + + + PresentationPlugin + + + <b>Presentation Plugin</b> <br> Delivers the ability to show presentations using a number of different programs. The choice of available presentation programs is available to the user in a drop down box. + + + + + ImageMediaItem + + + Image + + + + + SongsTab + + + Enable search as you type: + + + + + Ui_AlertDialog + + + Cancel + + + + + Ui_OpenLPImportDialog + + + Import + + + + + Ui_EditVerseDialog + + + Chorus + + + + + Ui_EditSongDialog + + + Edit All + + + + + AuthorsForm + + + You need to type in the last name of the author. + + + + + SongsTab + + + Songs Mode + + + + + Ui_AmendThemeDialog + + + Left + + + + + ThemesTab + + + Use the theme from the service, overriding any of the individual songs' themes. If the service doesn't have a theme, then use the global theme. + + + + + ImageTab + + + Images + + + + + BibleMediaItem + + + Verse: + + + + + Ui_BibleImportWizard + + + CSV + + + + + Ui_OpenLPExportDialog + + + Song Export List + + + + + ThemeManager + + + Export theme + + + + + Ui_SongMaintenanceDialog + + + Delete + + + + + Ui_AmendThemeDialog + + + Theme Name: + + + + + Ui_AboutDialog + + + About OpenLP + + + + + Ui_MainWindow + + + Toggle the visibility of the Service Manager + + + + + PresentationMediaItem + + + A presentation with that filename already exists. + + + + + AlertsTab + + + openlp.org + + + + + ImportWizardForm + + + Invalid Books File + + + + + Ui_OpenLPImportDialog + + + Song Title + + + + + MediaManagerItem + + + &Show Live + + + + + AlertsTab + + + Keep History: + + + + + Ui_AmendThemeDialog + + + Image: + + + + + Ui_customEditDialog + + + Set Theme for Slides + + + + + Ui_MainWindow + + + More information about OpenLP + + + + + AlertsTab + + + Background Color: + + + + + SongMaintenanceForm + + + No topic selected! + + + + + Ui_MainWindow + + + &Media Manager + + + + + &Tools + + + + + AmendThemeForm + + + Background Color: + + + + + Ui_EditSongDialog + + + A&dd to Song + + + + + Title: + + + + + GeneralTab + + + Screen + + + + + AlertsTab + + + s + + + + + ImagePlugin + + + <b>Image Plugin</b><br>Allows images of all types to be displayed. If a number of images are selected together and presented on the live controller it is possible to turn them into a timed loop.<br<br>From the plugin if the <i>Override background</i> is chosen and an image is selected any somgs which are rendered will use the selected image from the background instead of the one provied by the theme.<br> + + + + + Ui_AlertEditDialog + + + Clear + + + + + Ui_BibleImportWizard + + + Please wait while your Bible is imported. + + + + + MediaManagerItem + + + No items selected... + + + + + Ui_OpenLPImportDialog + + + Select All + + + + + Ui_AmendThemeDialog + + + Font Main + + + + + Ui_OpenLPImportDialog + + + Title + + + + + Ui_OpenSongExportDialog + + + Select OpenSong song folder: + + + + + Ui_MainWindow + + + Toggle Media Manager + + + + + SongUsagePlugin + + + &Song Usage + + + + + GeneralTab + + + Monitors + + + + + EditCustomForm + + + You need to enter a slide + + + + + ImportWizardForm + + + You need to specify a file to import your Bible from! + + + + + Ui_EditVerseDialog + + + Verse Type + + + + + ThemeManager + + + You have not selected a theme! + + + + + Ui_EditSongDialog + + + Comments + + + + + AlertsTab + + + Bottom + + + + + Ui_MainWindow + + + Create a new Service + + + + + AlertsTab + + + Top + + + + + SlideController + + + Preview + + + + + Ui_PluginViewDialog + + + TextLabel + + + + + About: + + + + + Inactive + + + + + Ui_OpenSongExportDialog + + + Ready to export + + + + + Export + + + + + Ui_PluginViewDialog + + + Plugin List + + + + + Ui_AmendThemeDialog + + + Transition Active: + + + + + Ui_BibleImportWizard + + + Proxy Server (Optional) + + + + + Ui_EditSongDialog + + + &Manage Authors, Topics, Books + + + + + Ui_SongUsageDetailDialog + + + Audit Detail Extraction + + + + + Ui_OpenLPExportDialog + + + Ready to export + + + + + EditCustomForm + + + Save && Preview + + + + + Ui_OpenLPExportDialog + + + Select All + + + + + Ui_SongUsageDetailDialog + + + to + + + + + Ui_AmendThemeDialog + + + Size: + + + + + MainWindow + + + OpenLP Main Display Blanked + + + + + Ui_OpenLPImportDialog + + + Remove Selected + + + + + OpenSongBible + + + Importing + + + + + Ui_EditSongDialog + + + Delete + + + + + Ui_MainWindow + + + Ctrl+S + + + + + PresentationMediaItem + + + File exists + + + + + Ui_OpenSongImportDialog + + + Ready to import + + + + + SlideController + + + Stop continuous loop + + + + + s + + + + + SongMediaItem + + + Song Maintenance + + + + + Ui_customEditDialog + + + Edit + + + + + Ui_AmendThemeDialog + + + Gradient : + + + + + BiblesTab + + + Layout Style: + + + + + ImportWizardForm + + + Invalid Verse File + + + + + EditSongForm + + + Error + + + + + Ui_customEditDialog + + + Add New + + + + + Ui_AuthorsDialog + + + Display name: + + + + + SongMaintenanceForm + + + Are you sure you want to delete the selected topic? + + + + + Ui_AmendThemeDialog + + + Bold/Italics + + + + + Ui_SongMaintenanceDialog + + + Song Maintenance + + + + + Ui_EditVerseDialog + + + Bridge + + + + + SongsTab + + + Songs + + + + + Ui_AmendThemeDialog + + + Preview + + + + + Ui_AboutDialog + + + Credits + + + + + MediaManagerItem + + + Preview the selected item + + + + + Ui_BibleImportWizard + + + Version Name: + + + + + Ui_AboutDialog + + + About + + + + + Ui_EditVerseDialog + + + Ending + + + + + Ui_AmendThemeDialog + + + Horizontal Align: + + + + + ServiceManager + + + &Edit Item + + + + + Ui_AmendThemeDialog + + + Background Type: + + + + + Ui_MainWindow + + + &Save + + + + + OpenLP 2.0 + + + + + ThemeManager + + + A theme with this name already exists, would you like to overwrite it? + + + + + Export a theme + + + + + AmendThemeForm + + + Open file + + + + + Ui_TopicsDialog + + + Topic Maintenance + + + + + Ui_customEditDialog + + + Clear edit area + + + + + Ui_AmendThemeDialog + + + Show Outline: + + + + + SongBookForm + + + You need to type in a book name! + + + + + ImportWizardForm + + + Open OpenSong Bible + + + + + Ui_MainWindow + + + Look && &Feel + + + + + Ui_BibleImportWizard + + + Ready. + + + + + Ui_SongMaintenanceDialog + + + Books/Hymnals + + + + + Ui_AboutDialog + + + Contribute + + + + + Ui_AmendThemeDialog + + Gradient + + AlertsTab + + + Font Size: + + + + + Ui_OpenSongExportDialog + + + Full Song List + + + + + Ui_AmendThemeDialog + + + Circular + + + diff --git a/scripts/get-strings.py b/scripts/get-strings.py index 8d9dad174..ed3cdcb41 100755 --- a/scripts/get-strings.py +++ b/scripts/get-strings.py @@ -24,6 +24,7 @@ ############################################################################### import os +from cgi import escape from ast import parse, NodeVisitor, Str ts_file = u""" @@ -45,7 +46,8 @@ ts_message = u""" class StringExtractor(NodeVisitor): - def __init__(self, strings, filename): + def __init__(self, strings, filename, base_path): + self.base_path = base_path self.filename = filename self.strings = strings self.classname = 'unknown' @@ -58,10 +60,10 @@ class StringExtractor(NodeVisitor): if hasattr(node.func, 'attr') and node.func.attr == 'trUtf8' and isinstance(node.args[0], Str): string = node.args[0].s key = '%s-%s' % (self.classname, string) - self.strings[key] = [self.classname, self.filename, node.lineno, string] + self.strings[key] = [self.classname, self.filename[len(self.base_path) + 1:], node.lineno, escape(string)] self.generic_visit(node) -def parse_file(filename, strings): +def parse_file(base_path, filename, strings): file = open(filename, u'r') try: ast = parse(file.read()) @@ -70,7 +72,7 @@ def parse_file(filename, strings): return file.close() - StringExtractor(strings, filename).visit(ast) + StringExtractor(strings, filename, base_path).visit(ast) def write_file(filename, strings): translation_file = u'' @@ -94,15 +96,18 @@ def write_file(filename, strings): def main(): strings = {} - start_dir = os.path.abspath(u'.') + start_dir = os.path.abspath(u'..') for root, dirs, files in os.walk(start_dir): for file in files: if file.endswith(u'.py'): print u'Parsing "%s"' % file - parse_file(os.path.join(root, file), strings) + parse_file(start_dir, os.path.join(root, file), strings) print u'Generating TS file...', - write_file(os.path.join(start_dir, u'i18n', u'openlp_en.ts'), strings) + write_file(os.path.join(start_dir, u'resources', u'i18n', u'openlp_en.ts'), strings) print u'done.' if __name__ == u'__main__': - main() \ No newline at end of file + if os.path.split(os.path.abspath(u'.'))[1] != u'scripts': + print u'You need to run this script from the scripts directory.' + else: + main() From 0b1ce89017f4fa2ac5bddf777f027211f961c627 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 9 Mar 2010 18:19:58 +0000 Subject: [PATCH 21/26] Fix translation --- openlp/plugins/alerts/alertsplugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 3e065f6af..90e7946c7 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -66,7 +66,7 @@ class alertsPlugin(Plugin): self.toolsAlertItem.setObjectName(u'toolsAlertItem') self.toolsAlertItem.setText(self.trUtf8('&Alert')) self.toolsAlertItem.setStatusTip(self.trUtf8('Show an alert message')) - self.toolsAlertItem.setShortcut(self.trUtf8('F7')) + self.toolsAlertItem.setShortcut(u'F7') self.service_manager.parent.ToolsMenu.addAction(self.toolsAlertItem) QtCore.QObject.connect(self.toolsAlertItem, QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger) From e40f1b41ef47e35d3119334cbd6bbe7c52afda6d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 9 Mar 2010 19:43:11 +0000 Subject: [PATCH 22/26] Truth tests and some style fixes --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/renderer.py | 6 +++--- openlp/core/lib/themexmlhandler.py | 9 ++++---- openlp/core/ui/servicemanager.py | 6 +++--- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/alerts/forms/alerteditform.py | 2 +- openlp/plugins/bibles/lib/http.py | 4 ++-- openlp/plugins/custom/forms/editcustomform.py | 2 +- openlp/plugins/custom/lib/mediaitem.py | 8 +++---- .../presentations/presentationplugin.py | 2 +- openlp/plugins/remotes/remoteclient.py | 2 +- openlp/plugins/songs/lib/songxml.py | 21 +++++++++---------- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index ff87f0b0d..fd6d37ca6 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -314,7 +314,7 @@ class MediaManagerItem(QtGui.QWidget): self, self.OnNewPrompt, self.parent.config.get_last_dir(), self.OnNewFileMasks) log.info(u'New files(s)%s', unicode(files)) - if len(files) > 0: + if files: self.loadList(files) dir, filename = os.path.split(unicode(files[0])) self.parent.config.set_last_dir(dir) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 9b2d666ac..4ed0fcf76 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -174,7 +174,7 @@ class Renderer(object): #Must be a blank line so keep it. if len(line) == 0: line = u' ' - while len(line) > 0: + while line: pos = char_per_line split_text = line[:pos] #line needs splitting @@ -199,7 +199,7 @@ class Renderer(object): split_lines.append(split_text) line = line[pos:].lstrip() #if we have more text add up to 10 spaces on the front. - if len(line) > 0 and self._theme.font_main_indentation > 0: + if line and self._theme.font_main_indentation > 0: line = u'%s%s' % \ (u' '[:int(self._theme.font_main_indentation)], line) #Text fits in a line now @@ -210,7 +210,7 @@ class Renderer(object): len(page) == page_length: split_pages.append(page) page = [] - if len(page) > 0 and page != u' ': + if page and page != u' ': split_pages.append(page) return split_pages diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 697c161e2..cbd46d597 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -171,7 +171,8 @@ class ThemeXML(object): self.child_element(background, u'filename', filename) def add_font(self, name, color, proportion, override, fonttype=u'main', - weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0, width=0, height=0): + weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0, + width=0, height=0): """ Add a Font. @@ -363,14 +364,14 @@ class ThemeXML(object): master = u'' for element in iter: element.text = unicode(element.text).decode('unicode-escape') - if len(element.getchildren()) > 0: + if element.getchildren(): master = element.tag + u'_' else: #background transparent tags have no children so special case if element.tag == u'background': for e in element.attrib.iteritems(): setattr(self, element.tag + u'_' + e[0], e[1]) - if len(element.attrib) > 0: + if element.attrib: for e in element.attrib.iteritems(): if master == u'font_' and e[0] == u'type': master += e[1] + u'_' @@ -402,4 +403,4 @@ class ThemeXML(object): for key in dir(self): if key[0:1] != u'_': theme_strings.append(u'%30s: %s' % (key, getattr(self, key))) - return u'\n'.join(theme_strings) \ No newline at end of file + return u'\n'.join(theme_strings) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index b4ce85e5d..9afd07f51 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -428,7 +428,7 @@ class ServiceManager(QtGui.QWidget): for itemcount, item in enumerate(self.serviceItems): serviceitem = item[u'service_item'] treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList) - if len(serviceitem.notes) > 0: + if serviceitem.notes: icon = QtGui.QImage(serviceitem.icon) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) @@ -601,7 +601,7 @@ class ServiceManager(QtGui.QWidget): def regenerateServiceItems(self): #force reset of renderer as theme data has changed self.parent.RenderManager.themedata = None - if len(self.serviceItems) > 0: + if self.serviceItems: tempServiceItems = self.serviceItems self.ServiceManagerList.clear() self.serviceItems = [] @@ -663,7 +663,7 @@ class ServiceManager(QtGui.QWidget): if str_to_bool(PluginConfig(u'General'). get_config(u'auto preview', u'False')): item += 1 - if len(self.serviceItems) > 0 and item < len(self.serviceItems) and \ + if self.serviceItems and item < len(self.serviceItems) and \ self.serviceItems[item][u'service_item'].autoPreviewAllowed: self.parent.PreviewController.addServiceManagerItem( self.serviceItems[item][u'service_item'], 0) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index b6396c7db..5cad41f58 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -246,7 +246,7 @@ class ThemeManager(QtGui.QWidget): self, self.trUtf8('Select Theme Import File'), self.config.get_last_dir(), u'Theme (*.*)') log.info(u'New Themes %s', unicode(files)) - if len(files) > 0: + if files: for file in files: self.config.set_last_dir(unicode(file)) self.unzipTheme(file, self.path) diff --git a/openlp/plugins/alerts/forms/alerteditform.py b/openlp/plugins/alerts/forms/alerteditform.py index 4abc8a660..62c129508 100644 --- a/openlp/plugins/alerts/forms/alerteditform.py +++ b/openlp/plugins/alerts/forms/alerteditform.py @@ -82,7 +82,7 @@ class AlertEditForm(QtGui.QDialog, Ui_AlertEditDialog): self.DeleteButton.setEnabled(False) def onItemSelected(self): - if len(self.AlertLineEdit.text()) > 0: + if self.AlertLineEdit.text(): QtGui.QMessageBox.information(self, self.trUtf8('Item selected to Edit'), self.trUtf8('Please Save or Clear seletced item')) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index d00c1f88a..7c675dee9 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -77,7 +77,7 @@ class HTTPBooks(object): books = HTTPBooks.run_sql(u'SELECT id, testament_id, name, ' u'abbreviation, chapters FROM books WHERE name = ? OR ' u'abbreviation = ?', (name, name)) - if len(books) > 0: + if books: return { u'id': books[0][0], u'testament_id': books[0][1], @@ -95,7 +95,7 @@ class HTTPBooks(object): book = HTTPBooks.get_book(name) chapters = HTTPBooks.run_sql(u'SELECT id, book_id, chapter, ' u'verses FROM chapters WHERE book_id = ?', (book[u'id'],)) - if len(chapters) > 0: + if chapters: return { u'id': chapters[0][0], u'book_id': chapters[0][1], diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 577142f23..b4402ceb3 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -254,7 +254,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): if self.VerseListView.count() == 0: self.VerseTextEdit.setFocus() return False, self.trUtf8('You need to enter a slide') - if len(self.VerseTextEdit.toPlainText()) > 0: + if self.VerseTextEdit.toPlainText(): self.VerseTextEdit.setFocus() return False, self.trUtf8('You have unsaved data') return True, u'' diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 2a3090cf2..61d1b05d7 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -151,7 +151,7 @@ class CustomMediaItem(MediaManagerItem): service_item.edit_enabled = True service_item.editId = item_id theme = customSlide.theme_name - if len(theme) is not 0 : + if theme: service_item.theme = theme songXML = SongXMLParser(customSlide.text) verseList = songXML.get_verses() @@ -160,9 +160,9 @@ class CustomMediaItem(MediaManagerItem): service_item.title = title for slide in raw_slides: service_item.add_from_text(slide[:30], slide) - if str_to_bool(self.parent.config.get_config(u'display footer', True)) or \ - len(credit) > 0: - raw_footer.append(title + u' '+ credit) + if str_to_bool(self.parent.config.get_config(u'display footer', True)) \ + or credit: + raw_footer.append(title + u' ' + credit) else: raw_footer.append(u'') service_item.raw_footer = raw_footer diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 061eb737f..8353611ab 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -103,7 +103,7 @@ class PresentationPlugin(Plugin): self.registerControllers(controller) if controller.enabled: controller.start_process() - if len(self.controllers) > 0: + if self.controllers: return True else: return False diff --git a/openlp/plugins/remotes/remoteclient.py b/openlp/plugins/remotes/remoteclient.py index 6d1abe877..857a7fc7e 100755 --- a/openlp/plugins/remotes/remoteclient.py +++ b/openlp/plugins/remotes/remoteclient.py @@ -54,7 +54,7 @@ def main(): help="Message to be passed for the action") (options, args) = parser.parse_args() - if len(args) > 0: + if args: parser.print_help() parser.error("incorrect number of arguments") elif options.address is None: diff --git a/openlp/plugins/songs/lib/songxml.py b/openlp/plugins/songs/lib/songxml.py index 7d356d848..f9cef7fce 100644 --- a/openlp/plugins/songs/lib/songxml.py +++ b/openlp/plugins/songs/lib/songxml.py @@ -153,12 +153,12 @@ class _OpenSong(XmlRootClass): tmpVerse = [] finalLyrics = [] tag = "" - for l in lyrics: - line = l.rstrip() + for lyric in lyrics: + line = lyric.rstrip() if not line.startswith(u'.'): # drop all chords tmpVerse.append(line) - if len(line) > 0: + if line: if line.startswith(u'['): tag = line else: @@ -298,9 +298,9 @@ class Song(object): chars are: .,:;!?&%#/\@`$'|"^~*- """ punctuation = ".,:;!?&%#'\"/\\@`$|^~*-" - s = title - for c in punctuation: - s = s.replace(c, '') + string = title + for char in punctuation: + string = string.replace(char, '') return s def set_title(self, title): @@ -582,17 +582,16 @@ class Song(object): self.slideList = [] tmpSlide = [] metContent = False - for l in self.lyrics: - if len(l) > 0: + for lyric in self.lyrics: + if lyric: metContent = True - tmpSlide.append(l) + tmpSlide.append(lyric) else: if metContent: metContent = False self.slideList.append(tmpSlide) tmpSlide = [] - # - if len(tmpSlide) > 0: + if tmpSlide: self.slideList.append(tmpSlide) def get_number_of_slides(self): From 16ea5dd0adf9614fca2b866262accdcf31341cb1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 9 Mar 2010 22:26:12 +0200 Subject: [PATCH 23/26] Tidied up the tabs on the media manager. --- openlp/core/ui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6218e35aa..01f3cabbe 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -50,7 +50,7 @@ media_manager_style = """ QToolBox::tab:selected { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 palette(light), stop: 1.0 palette(button)); - border-color: palette(dark); + border-color: palette(button); } """ class versionThread(QtCore.QThread): From 1e79260c5c01aa0fe6947a8441097df519457188 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 9 Mar 2010 22:29:45 +0200 Subject: [PATCH 24/26] Renamed the versionThread class to VersionThread to fit with our coding standards. --- openlp/core/ui/mainwindow.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 01f3cabbe..41b6d245f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -53,13 +53,21 @@ media_manager_style = """ border-color: palette(button); } """ -class versionThread(QtCore.QThread): +class VersionThread(QtCore.QThread): + """ + A special Qt thread class to fetch the version of OpenLP from the website. + This is threaded so that it doesn't affect the loading time of OpenLP. + """ def __init__(self, parent, app_version, generalConfig): QtCore.QThread.__init__(self, parent) self.parent = parent self.app_version = app_version self.generalConfig = generalConfig - def run (self): + + def run(self): + """ + Run the thread. + """ time.sleep(2) version = check_latest_version(self.generalConfig, self.app_version) #new version has arrived @@ -586,7 +594,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): def versionThread(self): app_version = self.applicationVersion[u'full'] - vT = versionThread(self, app_version, self.generalConfig) + vT = VersionThread(self, app_version, self.generalConfig) vT.start() def onHelpAboutItemClicked(self): From 92e515a7631b2a77a929b301dc67454ce89971f2 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 9 Mar 2010 22:32:13 +0200 Subject: [PATCH 25/26] Removed an unnecessary hook file. --- resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py diff --git a/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py b/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py deleted file mode 100644 index dc71dc088..000000000 --- a/resources/pyinstaller/hook-openlp.plugins.bibles.lib.common.py +++ /dev/null @@ -1 +0,0 @@ -hiddenimports = ['chardet'] \ No newline at end of file From ef48079c7924370739c6bde8ffc39aec37bc0cf4 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 9 Mar 2010 22:42:29 +0200 Subject: [PATCH 26/26] Remove now unnecessary and unused version.txt file. --- version.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 version.txt diff --git a/version.txt b/version.txt deleted file mode 100644 index fe8ffff0a..000000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.9.0-725