From fecd56106dffd1e9ac7cd4167894bb865d112a0f Mon Sep 17 00:00:00 2001 From: Felipe Polo-Wood Date: Thu, 31 Oct 2013 22:53:52 -0400 Subject: [PATCH] Removed extra line Made PowerpontController class compatible with Linux --- openlp/core/ui/slidecontroller.py | 1 - .../presentations/lib/powerpointcontroller.py | 42 ++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 069d88a59..a2299ad54 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1037,7 +1037,6 @@ class SlideController(DisplayController): Registry().execute('%s_next' % self.service_item.name.lower(), [self.service_item, self.is_live]) if self.service_item.is_command() and self.is_live: self.update_preview() - else: row = self.preview_widget.current_slide_number() + 1 if row == self.preview_widget.slide_count(): diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 94f12df69..caf25697b 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -32,13 +32,14 @@ This modul is for controlling powerpiont. PPT API documentation: """ import os import logging + if os.name == 'nt': from win32com.client import Dispatch - from .ppt import * import win32com import winreg import win32ui import pywintypes + from .ppt import constants from openlp.core.lib import ScreenList, Registry from .presentationcontroller import PresentationController, PresentationDocument @@ -356,19 +357,32 @@ def _get_text_from_shapes(shapes): text += shape.TextFrame.TextRange.Text + '\n' return text -ppE = win32com.client.getevents("PowerPoint.Application") +if os.name == "nt": + ppE = win32com.client.getevents("PowerPoint.Application") -class PowerpointEvents(ppE): - def OnSlideShowBegin(self, hwnd ): - print("SS Begin") - def OnSlideShowEnd(self, pres): - print("SS End") + class PowerpointEvents(ppE): + def OnSlideShowBegin(self, hwnd ): + #print("SS Begin") + return - def OnSlideShowNextSlide( self, hwnd ): - Registry().execute('slidecontroller_live_change', hwnd.View.CurrentShowPosition - 1) - print('Slide change:',hwnd.View.CurrentShowPosition) - def OnSlideShowOnNext(self, hwnd ): - print("SS Advance") - def OnSlideShowOnPrevious(self, hwnd): - print("SS GoBack") + def OnSlideShowEnd(self, pres): + #print("SS End") + return + + def OnSlideShowNextSlide( self, hwnd ): + Registry().execute('slidecontroller_live_change', hwnd.View.CurrentShowPosition - 1) + #print('Slide change:',hwnd.View.CurrentShowPosition) + return + + def OnSlideShowOnNext(self, hwnd ): + #print("SS Advance") + return + + def OnSlideShowOnPrevious(self, hwnd): + #print("SS GoBack") + return + +else: + class constants(): + ppPlaceholderBody = 2