From 2bc78ffd256819b5960f6ad7931427e85777a734 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 2 Jun 2015 22:16:10 +0100 Subject: [PATCH] Fix traceback when going live with presentation while blanked to desktop --- openlp/plugins/presentations/lib/messagelistener.py | 4 ++++ openlp/plugins/presentations/lib/powerpointcontroller.py | 1 + openlp/plugins/presentations/lib/presentationtab.py | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 69a23cc7f..d39c2ca94 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -243,6 +243,10 @@ class Controller(object): Instruct the controller to stop and hide the presentation. """ log.debug('Live = %s, stop' % self.is_live) + # The document has not been loaded yet, so don't do anything. This can happen when going live with a + # presentation while blanked to desktop. + if not self.doc: + return # Save the current slide number to be able to return to this slide if the presentation is activated again. if self.doc.is_active(): self.doc.slidenumber = self.doc.get_slide_number() diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 107ebe4cd..e0419f5b6 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -330,6 +330,7 @@ class PowerpointDocument(PresentationDocument): """ log.debug('start_presentation') # SlideShowWindow measures its size/position by points, not pixels + # https://technet.microsoft.com/en-us/library/dn528846.aspx try: dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88) except win32ui.error: diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index a93ceb7b9..f15012c70 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -128,7 +128,8 @@ class PresentationTab(SettingsTab): 'Clicking on a selected slide in the slidecontroller advances to next effect.')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Let PowerPoint control the size and position of the presentation window.')) + 'Let PowerPoint control the size and position of the presentation window ' + '(workaround for Windows 8 scaling issue).')) self.pdf_program_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:'))