From f74413ebe07f9261f7150030c39f4308d2f68dfd Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 19 Jun 2014 09:21:10 +0200 Subject: [PATCH] yet another go at minimizing ppt 2013 --- .../presentations/lib/powerpointcontroller.py | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 0898fd074..2dded438b 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -136,15 +136,9 @@ class PowerpointDocument(PresentationDocument): # Powerpoint 2013 pops up when loading a file, so we minimize it again if self.presentation.Application.Version == u'15.0': try: - self.presentation.Application.ActiveWindow.WindowState = 2 + self.presentation.Application.WindowState = 2 except: - log.error(u'this failed: "self.presentation.Application.ActiveWindow.WindowState = 2", trying option 2...') - log.error(sys.exc_info()) - try: - self.presentation.Application.WindowState = 2 - except: - log.error(u'option 2 failed as well') - log.error(sys.exc_info()) + log.error(u'Failed to minimize main powerpoint window') return True except pywintypes.com_error as e: @@ -308,15 +302,9 @@ class PowerpointDocument(PresentationDocument): # Powerpoint 2013 pops up when starting a file, so we minimize it again if self.presentation.Application.Version == u'15.0': try: - self.presentation.Application.ActiveWindow.WindowState = 2 + self.presentation.Application.WindowState = 2 except: - log.error(u'this failed: "self.presentation.Application.ActiveWindow.WindowState = 2", trying option 2...') - log.error(sys.exc_info()) - try: - self.presentation.Application.WindowState = 2 - except: - log.error(u'option 2 failed as well') - log.error(sys.exc_info()) + log.error(u'Failed to minimize main powerpoint window') def get_slide_number(self): """