forked from openlp/openlp
Fix timer that checks for presentation slide change, remove powerpoint event handler that did the same.
This commit is contained in:
parent
0e2e281fa0
commit
14031720be
@ -35,7 +35,7 @@ import logging
|
||||
import os
|
||||
import time
|
||||
|
||||
from openlp.core.common import is_win
|
||||
from openlp.core.common import is_win, Registry
|
||||
|
||||
if is_win():
|
||||
from win32com.client import Dispatch
|
||||
@ -388,6 +388,9 @@ class ImpressDocument(PresentationDocument):
|
||||
else:
|
||||
self.control.activate()
|
||||
self.goto_slide(1)
|
||||
# Make sure impress doesn't steal focus, unless we're on a single screen setup
|
||||
if len(ScreenList().screen_list) > 1:
|
||||
Registry().get('main_window').activateWindow()
|
||||
|
||||
def get_slide_number(self):
|
||||
"""
|
||||
|
@ -356,6 +356,7 @@ class MessageListener(object):
|
||||
self.controller = controller
|
||||
else:
|
||||
controller.add_handler(self.controllers[self.handler], file, hide_mode, message[3])
|
||||
self.timer.start()
|
||||
|
||||
def slide(self, message):
|
||||
"""
|
||||
@ -427,6 +428,7 @@ class MessageListener(object):
|
||||
is_live = message[1]
|
||||
if is_live:
|
||||
self.live_handler.shutdown()
|
||||
self.timer.stop()
|
||||
else:
|
||||
self.preview_handler.shutdown()
|
||||
|
||||
|
@ -32,7 +32,7 @@ import time
|
||||
from openlp.core.common import is_win, Settings
|
||||
|
||||
if is_win():
|
||||
from win32com.client import DispatchWithEvents
|
||||
from win32com.client import Dispatch
|
||||
import win32com
|
||||
import win32con
|
||||
import winreg
|
||||
@ -93,22 +93,9 @@ class PowerpointController(PresentationController):
|
||||
"""
|
||||
Loads PowerPoint process.
|
||||
"""
|
||||
class PowerPointEvents:
|
||||
"""
|
||||
Class to catch events from PowerPoint.
|
||||
"""
|
||||
def OnSlideShowNextClick(self, slideshow_window, effect):
|
||||
"""
|
||||
Occurs on the next click of the slide.
|
||||
If the main OpenLP window is not in focus force update of the slidecontroller.
|
||||
"""
|
||||
if not Registry().get('main_window').isActiveWindow():
|
||||
log.debug('main window is not in focus - should update slidecontroller')
|
||||
Registry().execute('slidecontroller_live_change', slideshow_window.View.CurrentShowPosition)
|
||||
|
||||
log.debug('start_process')
|
||||
if not self.process:
|
||||
self.process = DispatchWithEvents('PowerPoint.Application', PowerPointEvents)
|
||||
self.process = Dispatch('PowerPoint.Application')
|
||||
|
||||
def kill(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user