Removed extra line

Made PowerpontController class compatible with Linux
This commit is contained in:
Felipe Polo-Wood 2013-10-31 22:53:52 -04:00
parent e958e17889
commit fecd56106d
2 changed files with 28 additions and 15 deletions

View File

@ -1037,7 +1037,6 @@ class SlideController(DisplayController):
Registry().execute('%s_next' % self.service_item.name.lower(), [self.service_item, self.is_live]) 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: if self.service_item.is_command() and self.is_live:
self.update_preview() self.update_preview()
else: else:
row = self.preview_widget.current_slide_number() + 1 row = self.preview_widget.current_slide_number() + 1
if row == self.preview_widget.slide_count(): if row == self.preview_widget.slide_count():

View File

@ -32,13 +32,14 @@ This modul is for controlling powerpiont. PPT API documentation:
""" """
import os import os
import logging import logging
if os.name == 'nt': if os.name == 'nt':
from win32com.client import Dispatch from win32com.client import Dispatch
from .ppt import *
import win32com import win32com
import winreg import winreg
import win32ui import win32ui
import pywintypes import pywintypes
from .ppt import constants
from openlp.core.lib import ScreenList, Registry from openlp.core.lib import ScreenList, Registry
from .presentationcontroller import PresentationController, PresentationDocument from .presentationcontroller import PresentationController, PresentationDocument
@ -356,19 +357,32 @@ def _get_text_from_shapes(shapes):
text += shape.TextFrame.TextRange.Text + '\n' text += shape.TextFrame.TextRange.Text + '\n'
return text return text
ppE = win32com.client.getevents("PowerPoint.Application") if os.name == "nt":
ppE = win32com.client.getevents("PowerPoint.Application")
class PowerpointEvents(ppE): class PowerpointEvents(ppE):
def OnSlideShowBegin(self, hwnd ): def OnSlideShowBegin(self, hwnd ):
print("SS Begin") #print("SS Begin")
return
def OnSlideShowEnd(self, pres): def OnSlideShowEnd(self, pres):
print("SS End") #print("SS End")
return
def OnSlideShowNextSlide( self, hwnd ): def OnSlideShowNextSlide( self, hwnd ):
Registry().execute('slidecontroller_live_change', hwnd.View.CurrentShowPosition - 1) Registry().execute('slidecontroller_live_change', hwnd.View.CurrentShowPosition - 1)
print('Slide change:',hwnd.View.CurrentShowPosition) #print('Slide change:',hwnd.View.CurrentShowPosition)
def OnSlideShowOnNext(self, hwnd ): return
print("SS Advance")
def OnSlideShowOnPrevious(self, hwnd): def OnSlideShowOnNext(self, hwnd ):
print("SS GoBack") #print("SS Advance")
return
def OnSlideShowOnPrevious(self, hwnd):
#print("SS GoBack")
return
else:
class constants():
ppPlaceholderBody = 2