From 212103ce7bd4c19bfe1f42388a0f2902449782fd Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 23 Jun 2011 23:26:36 +0100 Subject: [PATCH 1/4] Some uno constants missing on some systems --- openlp/plugins/songs/lib/oooimport.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 62a5f0cdd..ba442bb35 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -37,14 +37,16 @@ log = logging.getLogger(__name__) if os.name == u'nt': from win32com.client import Dispatch - PAGE_BEFORE = 4 - PAGE_AFTER = 5 - PAGE_BOTH = 6 NoConnectException = Exception else: import uno from com.sun.star.connection import NoConnectException +try: from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH +except ImportError: + PAGE_BEFORE = 4 + PAGE_AFTER = 5 + PAGE_BOTH = 6 class OooImport(SongImport): """ From e1dc332be4c0256b0c957b5b61c5f0a177366bf2 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 23 Jun 2011 23:30:56 +0100 Subject: [PATCH 2/4] Trap meta key combinations for bug 743273. (Tested with Win key on Windows, don't have OS-X to test CMD key) --- openlp/core/ui/shortcutlistform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 0be7fc85d..6bdcc46bc 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -98,6 +98,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): if event.modifiers() & QtCore.Qt.ShiftModifier == \ QtCore.Qt.ShiftModifier: key_string = u'Shift+' + key_string + if event.modifiers() & QtCore.Qt.MetaModifier == \ + QtCore.Qt.MetaModifier: + key_string = u'Meta+' + key_string key_sequence = QtGui.QKeySequence(key_string) if self._validiate_shortcut(self._currentItemAction(), key_sequence): if self.primaryPushButton.isChecked(): From d58682ad6bbd923c8a365796219774af0e5ae9cc Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 23 Jun 2011 23:53:24 +0100 Subject: [PATCH 3/4] SOF UNO constants too --- openlp/plugins/songs/lib/sofimport.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index 4168670e7..d37c069e9 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -41,20 +41,23 @@ from oooimport import OooImport log = logging.getLogger(__name__) if os.name == u'nt': - BOLD = 150.0 - ITALIC = 2 from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH RuntimeException = Exception else: try: - from com.sun.star.awt.FontWeight import BOLD - from com.sun.star.awt.FontSlant import ITALIC from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \ PAGE_BOTH from com.sun.star.uno import RuntimeException except ImportError: pass - +try: + from com.sun.star.awt.FontWeight import BOLD +except ImportError: + BOLD = 150.0 +try: + from com.sun.star.awt.FontSlant import ITALIC +except ImportError: + ITALIC = 2 class SofImport(OooImport): """ From 4e216bdd1337dbba34fe16be1b962189e46bdc0d Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 24 Jun 2011 00:05:06 +0100 Subject: [PATCH 4/4] Indent --- openlp/plugins/songs/lib/sofimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index d37c069e9..e0134f282 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -57,7 +57,7 @@ except ImportError: try: from com.sun.star.awt.FontSlant import ITALIC except ImportError: - ITALIC = 2 + ITALIC = 2 class SofImport(OooImport): """