From 5f9ed32bfecc35905cd45bcdd69a43db660cadae Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 23 Oct 2011 18:22:11 +0100 Subject: [PATCH 01/10] Fix assignment error --- openlp/core/ui/exceptionform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 10fee7f6f..0cda4bd60 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -178,6 +178,8 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Please add the information that bug reports are favoured written ' 'in English.')) content = self._createReport() + source = u'' + exception = u'' for line in content[2].split(u'\n'): if re.search(r'[/\\]openlp[/\\]', line): source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line) From 35875b700809378f530c04a668c65bbed4102c12 Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Tue, 25 Oct 2011 20:09:35 -0400 Subject: [PATCH 02/10] Added code to point pyinstaller to the OpenLP pyinstaller hooks directory --- scripts/windows-builder.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index b7bf70472..b94ba93cc 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -48,10 +48,10 @@ Inno Setup 5 Sphinx This is used to build the documentation. The documentation trunk must be at - the same directory level as Openlp trunk and named "documentation" + the same directory level as Openlp trunk and named "documentation". HTML Help Workshop - This is used to create the help file + This is used to create the help file. PyInstaller PyInstaller should be a checkout of revision 1470 of trunk, and in a @@ -61,14 +61,10 @@ PyInstaller To install PyInstaller, first checkout trunk from Subversion. The easiest way is to install TortoiseSVN and then checkout the following URL to a - directory called "pyinstaller":: + directory called "pyinstaller". http://svn.pyinstaller.org/trunk - Then you need to copy the two hook-*.py files from the "pyinstaller" - subdirectory in OpenLP's "resources" directory into PyInstaller's - "PyInstaller/hooks" directory. - Bazaar You need the command line "bzr" client installed. @@ -79,7 +75,7 @@ OpenLP Visual C++ 2008 Express Edition This is to build pptviewlib.dll, the library for controlling the - PowerPointViewer + PowerPointViewer. windows-builder.py This script, of course. It should be in the "scripts" directory of OpenLP. @@ -89,6 +85,8 @@ psvince.dll running on the users machine prior to the setup. If OpenLP is running, the install will fail. The dll can be obtained from here: http://www.vincenzo.net/isxkb/index.php?title=PSVince) + + The dll is presently included in .\resources\windows Mako Mako Templates for Python. This package is required for building the @@ -149,6 +147,7 @@ build_path = os.path.join(branch_path, u'build') dist_path = os.path.join(branch_path, u'dist', u'OpenLP') pptviewlib_path = os.path.join(source_path, u'plugins', u'presentations', u'lib', u'pptviewlib') +hooks_path = os.path.join(branch_path , u'resources', u'pyinstaller') def update_code(): os.chdir(branch_path) @@ -173,7 +172,8 @@ def run_pyinstaller(): pyinstaller = Popen((python_exe, pyi_build, u'--noconfirm', u'--windowed', - u'--noupx', + u'--noupx', + u'--additional-hooks-dir', hooks_path, u'-o', branch_path, u'-i', win32_icon, u'-p', branch_path, From c12a7b09013e275b3312c958b582eba98c0e710d Mon Sep 17 00:00:00 2001 From: M2j Date: Wed, 26 Oct 2011 09:40:12 +0200 Subject: [PATCH 03/10] add uno to the dependency check --- scripts/check_dependencies.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check_dependencies.py b/scripts/check_dependencies.py index dd2907ba9..d1ec2228b 100755 --- a/scripts/check_dependencies.py +++ b/scripts/check_dependencies.py @@ -73,6 +73,7 @@ MODULES = [ 'BeautifulSoup', 'mako', 'migrate', + 'uno', ] From fe3453a7a5f2b7810dc3a3800409cab9dfe8434d Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Thu, 27 Oct 2011 17:06:40 -0400 Subject: [PATCH 04/10] Fixed the documentation section of the script --- scripts/windows-builder.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index b94ba93cc..170d15e83 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -61,7 +61,7 @@ PyInstaller To install PyInstaller, first checkout trunk from Subversion. The easiest way is to install TortoiseSVN and then checkout the following URL to a - directory called "pyinstaller". + directory called "pyinstaller":: http://svn.pyinstaller.org/trunk @@ -83,17 +83,19 @@ windows-builder.py psvince.dll This dll is used during the actual install of OpenLP to check if OpenLP is running on the users machine prior to the setup. If OpenLP is running, - the install will fail. The dll can be obtained from here: - http://www.vincenzo.net/isxkb/index.php?title=PSVince) + the install will fail. The dll can be obtained from here:: + + http://www.vincenzo.net/isxkb/index.php?title=PSVince) - The dll is presently included in .\resources\windows + The dll is presently included in .\\resources\\windows Mako Mako Templates for Python. This package is required for building the remote plugin. It can be installed by going to your python_directory\scripts\.. and running "easy_install Mako". If you do not - have easy_install, the Mako package can be obtained here: - http://www.makotemplates.org/download.html + have easy_install, the Mako package can be obtained here:: + + http://www.makotemplates.org/download.html """ From f522c79b1ea90b4d3f08d75a5d86a2baf3066e8b Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Fri, 28 Oct 2011 09:28:57 -0400 Subject: [PATCH 05/10] Added sqlalchemy-migrate to comments section. Made some changes to comments section to preserve links. --- scripts/windows-builder.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 170d15e83..9076971cb 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -83,7 +83,7 @@ windows-builder.py psvince.dll This dll is used during the actual install of OpenLP to check if OpenLP is running on the users machine prior to the setup. If OpenLP is running, - the install will fail. The dll can be obtained from here:: + the install will fail. The dll can be obtained from here: http://www.vincenzo.net/isxkb/index.php?title=PSVince) @@ -93,10 +93,16 @@ Mako Mako Templates for Python. This package is required for building the remote plugin. It can be installed by going to your python_directory\scripts\.. and running "easy_install Mako". If you do not - have easy_install, the Mako package can be obtained here:: + have easy_install, the Mako package can be obtained here: http://www.makotemplates.org/download.html - + +Sqlalchemy Migrate + Required for the data-bases used in OpenLP. The package can be + obtained here: + + http://code.google.com/p/sqlalchemy-migrate/ + """ import os From 8e853f10b1d2f4b79b7b062e624069b00678eb5b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 29 Oct 2011 10:33:48 +0100 Subject: [PATCH 06/10] Fix crash with alerts over video Change default to bottom from middle Remove unused from from previous merge Fixes: https://launchpad.net/bugs/875798, https://launchpad.net/bugs/883414 --- openlp/core/lib/htmlbuilder.py | 21 --------------------- openlp/core/ui/maindisplay.py | 6 +++--- openlp/plugins/alerts/lib/alertsmanager.py | 5 +++-- openlp/plugins/alerts/lib/alertstab.py | 2 +- 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 863943e40..5dfe00d36 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -610,24 +610,3 @@ def build_footer_css(item, height): theme.font_footer_size, theme.font_footer_color) return lyrics_html -def build_alert_css(alertTab, width): - """ - Build the display of the footer - - ``alertTab`` - Details from the Alert tab for fonts etc - """ - style = u""" - width: %spx; - vertical-align: %s; - font-family: %s; - font-size: %spt; - color: %s; - background-color: %s; - """ - if not alertTab: - return u'' - align = VerticalType.Names[alertTab.location] - alert = style % (width, align, alertTab.font_face, alertTab.font_size, - alertTab.font_color, alertTab.bg_color) - return alert diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index aa94454b7..4077181ab 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -213,7 +213,7 @@ class MainDisplay(QtGui.QGraphicsView): self.frame.evaluateJavaScript(u'show_text("%s")' % slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')) - def alert(self, text): + def alert(self, text, location): """ Display an alert. @@ -241,10 +241,10 @@ class MainDisplay(QtGui.QGraphicsView): alert_height = int(height.toString()) shrinkItem.resize(self.width(), alert_height) shrinkItem.setVisible(True) - if self.alertTab.location == 1: + if location == 1: shrinkItem.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2) - elif self.alertTab.location == 2: + elif location == 2: shrinkItem.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height) else: diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 8e91aecf5..e73273fe7 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -85,7 +85,7 @@ class AlertsManager(QtCore.QObject): return text = self.alertList.pop(0) alertTab = self.parent().settings_tab - self.parent().liveController.display.alert(text) + self.parent().liveController.display.alert(text, alertTab.location) # Check to see if we have a timer running. if self.timer_id == 0: self.timer_id = self.startTimer(int(alertTab.timeout) * 1000) @@ -100,7 +100,8 @@ class AlertsManager(QtCore.QObject): """ log.debug(u'timer event') if event.timerId() == self.timer_id: - self.parent().liveController.display.alert(u'') + alertTab = self.parent().settings_tab + self.parent().liveController.display.alert(u'', alertTab.location) self.killTimer(self.timer_id) self.timer_id = 0 self.generateAlert() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8720c5111..8fd2cb3aa 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -159,7 +159,7 @@ class AlertsTab(SettingsTab): self.font_face = unicode(settings.value( u'font face', QtCore.QVariant(QtGui.QFont().family())).toString()) self.location = settings.value( - u'location', QtCore.QVariant(1)).toInt()[0] + u'location', QtCore.QVariant(2)).toInt()[0] settings.endGroup() self.fontSizeSpinBox.setValue(self.font_size) self.timeoutSpinBox.setValue(self.timeout) From ea4cb7f7edc99ad660f921d41a52f32918412208 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 29 Oct 2011 14:21:54 +0100 Subject: [PATCH 07/10] Add Class instead of magic numbers --- openlp/core/ui/__init__.py | 18 ++++++++++++++++++ openlp/core/ui/maindisplay.py | 6 +++--- openlp/plugins/alerts/lib/alertstab.py | 3 ++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 7d2dfa0ba..f5fece1f0 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -52,6 +52,24 @@ class HideMode(object): Theme = 2 Screen = 3 +class Location(object): + """ + This is an enumeration class which specifies the different modes of hiding + the display. + + ``Top`` + Place the text at the top of the screen. + + ``Middle`` + Place the text in the middle of the screen. + + ``Bottom`` + Place the text at the bottom of the screen. + """ + Top = 0 + Middle = 1 + Bottom = 2 + from firsttimeform import FirstTimeForm from firsttimelanguageform import FirstTimeLanguageForm from themelayoutform import ThemeLayoutForm diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 4077181ab..90203922f 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -37,7 +37,7 @@ from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \ translate, PluginManager -from openlp.core.ui import HideMode, ScreenList +from openlp.core.ui import HideMode, ScreenList, Location log = logging.getLogger(__name__) @@ -241,10 +241,10 @@ class MainDisplay(QtGui.QGraphicsView): alert_height = int(height.toString()) shrinkItem.resize(self.width(), alert_height) shrinkItem.setVisible(True) - if location == 1: + if location == Location.Middle: shrinkItem.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2) - elif location == 2: + elif location == Location.Bottom: shrinkItem.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height) else: diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8fd2cb3aa..10bec702d 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate, Receiver +from openlp.core.ui import Location from openlp.core.lib.ui import UiStrings, create_valign_combo class AlertsTab(SettingsTab): @@ -159,7 +160,7 @@ class AlertsTab(SettingsTab): self.font_face = unicode(settings.value( u'font face', QtCore.QVariant(QtGui.QFont().family())).toString()) self.location = settings.value( - u'location', QtCore.QVariant(2)).toInt()[0] + u'location', QtCore.QVariant(Location.Bottom)).toInt()[0] settings.endGroup() self.fontSizeSpinBox.setValue(self.font_size) self.timeoutSpinBox.setValue(self.timeout) From c8e9496db1717692bc7ec6584f7b195f1a47919b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 29 Oct 2011 20:13:11 +0100 Subject: [PATCH 08/10] Fix up review comments --- openlp/core/ui/__init__.py | 6 +++--- openlp/core/ui/maindisplay.py | 6 +++--- openlp/plugins/alerts/lib/alertstab.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index f5fece1f0..6a04a080b 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -52,10 +52,10 @@ class HideMode(object): Theme = 2 Screen = 3 -class Location(object): +class AlertLocation(object): """ - This is an enumeration class which specifies the different modes of hiding - the display. + This is an enumeration class which controls where Alerts are placed on the + screen. ``Top`` Place the text at the top of the screen. diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 90203922f..0f932c2f5 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -37,7 +37,7 @@ from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \ translate, PluginManager -from openlp.core.ui import HideMode, ScreenList, Location +from openlp.core.ui import HideMode, ScreenList, AlertLocation log = logging.getLogger(__name__) @@ -241,10 +241,10 @@ class MainDisplay(QtGui.QGraphicsView): alert_height = int(height.toString()) shrinkItem.resize(self.width(), alert_height) shrinkItem.setVisible(True) - if location == Location.Middle: + if location == AlertLocation.Middle: shrinkItem.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2) - elif location == Location.Bottom: + elif location == AlertLocation.Bottom: shrinkItem.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height) else: diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 10bec702d..bd879fef3 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -28,7 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate, Receiver -from openlp.core.ui import Location +from openlp.core.ui import AlertLocation from openlp.core.lib.ui import UiStrings, create_valign_combo class AlertsTab(SettingsTab): @@ -160,7 +160,7 @@ class AlertsTab(SettingsTab): self.font_face = unicode(settings.value( u'font face', QtCore.QVariant(QtGui.QFont().family())).toString()) self.location = settings.value( - u'location', QtCore.QVariant(Location.Bottom)).toInt()[0] + u'location', QtCore.QVariant(AlertLocation.Bottom)).toInt()[0] settings.endGroup() self.fontSizeSpinBox.setValue(self.font_size) self.timeoutSpinBox.setValue(self.timeout) From 0ed66b6a9c488d22343c6d361b1023d712280f2d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 30 Oct 2011 21:24:04 +0100 Subject: [PATCH 09/10] fixed alert position not being recalculated properly when changing options --- openlp/plugins/alerts/alertsplugin.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 213c6814f..493f08ba0 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -71,11 +71,24 @@ JAVASCRIPT = """ function update_css(align, font, size, color, bgcolor){ var text = document.getElementById('alert'); - text.style.verticalAlign = align; text.style.fontSize = size + "pt"; text.style.fontFamily = font; text.style.color = color; text.style.backgroundColor = bgcolor; + switch(align) + { + case 'top': + text.style.top = '0px'; + break; + case 'middle': + text.style.top = ((window.innerHeight - text.clientHeight) / 2) + + 'px'; + break; + case 'bottom': + text.style.top = (window.innerHeight - text.clientHeight) + + 'px'; + break; + } } """ CSS = """ From 15e19f9700f57e4ee4dc01b1f8e5dd5b11426839 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 30 Oct 2011 22:38:02 +0100 Subject: [PATCH 10/10] fixed rename errors --- openlp/plugins/songs/lib/oooimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 4a97e43b0..f817bfb45 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -65,7 +65,7 @@ class OooImport(SongImport): if not isinstance(self.importSource, list): return try: - self.start_ooo() + self.startOoo() except NoConnectException as exc: self.logError( self.importSource[0], @@ -145,7 +145,7 @@ class OooImport(SongImport): process.waitForStarted() self.processStarted = True except: - log.exception("start_ooo_process failed") + log.exception("startOooProcess failed") def openOooFile(self, filepath): """ @@ -171,7 +171,7 @@ class OooImport(SongImport): self.importWizard.incrementProgressBar( u'Processing file ' + filepath, 0) except AttributeError: - log.exception("open_ooo_file failed: %s", url) + log.exception("openOooFile failed: %s", url) return def closeOooFile(self):