forked from openlp/openlp
Presentation tidyups
This commit is contained in:
parent
4ba065a338
commit
fe01718d46
@ -331,7 +331,10 @@ class ImpressDocument(PresentationDocument):
|
|||||||
|
|
||||||
def stop_presentation(self):
|
def stop_presentation(self):
|
||||||
log.debug(u'stop presentation OpenOffice')
|
log.debug(u'stop presentation OpenOffice')
|
||||||
self.control.deactivate()
|
# deactivate should hide the screen according to docs, but doesn't
|
||||||
|
#self.control.deactivate()
|
||||||
|
self.presentation.end()
|
||||||
|
self.control = None
|
||||||
|
|
||||||
def start_presentation(self):
|
def start_presentation(self):
|
||||||
log.debug(u'start presentation OpenOffice')
|
log.debug(u'start presentation OpenOffice')
|
||||||
|
@ -41,31 +41,31 @@ class Controller(object):
|
|||||||
log.info(u'Controller loaded')
|
log.info(u'Controller loaded')
|
||||||
|
|
||||||
def __init__(self, live):
|
def __init__(self, live):
|
||||||
self.isLive = live
|
self.is_live = live
|
||||||
self.doc = None
|
self.doc = None
|
||||||
log.info(u'%s controller loaded' % live)
|
log.info(u'%s controller loaded' % live)
|
||||||
|
|
||||||
def addHandler(self, controller, file, isBlank):
|
def add_handler(self, controller, file, is_blank):
|
||||||
log.debug(u'Live = %s, addHandler %s' % (self.isLive, file))
|
log.debug(u'Live = %s, add_handler %s' % (self.is_live, file))
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
if self.doc is not None:
|
if self.doc is not None:
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
self.doc = self.controller.add_doc(file)
|
self.doc = self.controller.add_doc(file)
|
||||||
self.doc.load_presentation()
|
self.doc.load_presentation()
|
||||||
if self.isLive:
|
if self.is_live:
|
||||||
self.doc.start_presentation()
|
self.doc.start_presentation()
|
||||||
if isBlank:
|
if is_blank:
|
||||||
self.blank()
|
self.blank()
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
self.doc.slidenumber = 0
|
self.doc.slidenumber = 0
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
log.debug(u'Live = %s, activate' % self.isLive)
|
log.debug(u'Live = %s, activate' % self.is_live)
|
||||||
if self.doc.is_active():
|
if self.doc.is_active():
|
||||||
return
|
return
|
||||||
if not self.doc.is_loaded():
|
if not self.doc.is_loaded():
|
||||||
self.doc.load_presentation()
|
self.doc.load_presentation()
|
||||||
if self.isLive:
|
if self.is_live:
|
||||||
self.doc.start_presentation()
|
self.doc.start_presentation()
|
||||||
if self.doc.slidenumber > 1:
|
if self.doc.slidenumber > 1:
|
||||||
self.doc.goto_slide(self.doc.slidenumber)
|
self.doc.goto_slide(self.doc.slidenumber)
|
||||||
@ -85,36 +85,36 @@ class Controller(object):
|
|||||||
"""
|
"""
|
||||||
Based on the handler passed at startup triggers the first slide
|
Based on the handler passed at startup triggers the first slide
|
||||||
"""
|
"""
|
||||||
log.debug(u'Live = %s, first' % self.isLive)
|
log.debug(u'Live = %s, first' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if self.doc.is_blank():
|
if self.doc.is_blank():
|
||||||
self.doc.slidenumber = 1
|
self.doc.slidenumber = 1
|
||||||
return
|
return
|
||||||
self.activate()
|
self.activate()
|
||||||
self.doc.start_presentation()
|
self.doc.start_presentation()
|
||||||
self.doc.poll_slidenumber(self.isLive)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
||||||
def last(self):
|
def last(self):
|
||||||
"""
|
"""
|
||||||
Based on the handler passed at startup triggers the first slide
|
Based on the handler passed at startup triggers the first slide
|
||||||
"""
|
"""
|
||||||
log.debug(u'Live = %s, last' % self.isLive)
|
log.debug(u'Live = %s, last' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if self.doc.is_blank():
|
if self.doc.is_blank():
|
||||||
self.doc.slidenumber = self.doc.get_slide_count()
|
self.doc.slidenumber = self.doc.get_slide_count()
|
||||||
return
|
return
|
||||||
self.activate()
|
self.activate()
|
||||||
self.doc.goto_slide(self.doc.get_slide_count())
|
self.doc.goto_slide(self.doc.get_slide_count())
|
||||||
self.doc.poll_slidenumber(self.isLive)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
||||||
def next(self):
|
def next(self):
|
||||||
"""
|
"""
|
||||||
Based on the handler passed at startup triggers the next slide event
|
Based on the handler passed at startup triggers the next slide event
|
||||||
"""
|
"""
|
||||||
log.debug(u'Live = %s, next' % self.isLive)
|
log.debug(u'Live = %s, next' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if self.doc.is_blank():
|
if self.doc.is_blank():
|
||||||
if self.doc.slidenumber < self.doc.get_slide_count():
|
if self.doc.slidenumber < self.doc.get_slide_count():
|
||||||
@ -122,14 +122,14 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
self.activate()
|
self.activate()
|
||||||
self.doc.next_step()
|
self.doc.next_step()
|
||||||
self.doc.poll_slidenumber(self.isLive)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
||||||
def previous(self):
|
def previous(self):
|
||||||
"""
|
"""
|
||||||
Based on the handler passed at startup triggers the previous slide event
|
Based on the handler passed at startup triggers the previous slide event
|
||||||
"""
|
"""
|
||||||
log.debug(u'Live = %s, previous' % self.isLive)
|
log.debug(u'Live = %s, previous' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if self.doc.is_blank():
|
if self.doc.is_blank():
|
||||||
if self.doc.slidenumber > 1:
|
if self.doc.slidenumber > 1:
|
||||||
@ -137,14 +137,14 @@ class Controller(object):
|
|||||||
return
|
return
|
||||||
self.activate()
|
self.activate()
|
||||||
self.doc.previous_step()
|
self.doc.previous_step()
|
||||||
self.doc.poll_slidenumber(self.isLive)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""
|
"""
|
||||||
Based on the handler passed at startup triggers slide show to shut down
|
Based on the handler passed at startup triggers slide show to shut down
|
||||||
"""
|
"""
|
||||||
log.debug(u'Live = %s, shutdown' % self.isLive)
|
log.debug(u'Live = %s, shutdown' % self.is_live)
|
||||||
if self.isLive:
|
if self.is_live:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'maindisplay_show')
|
||||||
self.doc.close_presentation()
|
self.doc.close_presentation()
|
||||||
self.doc = None
|
self.doc = None
|
||||||
@ -152,8 +152,8 @@ class Controller(object):
|
|||||||
#self.timer.stop()
|
#self.timer.stop()
|
||||||
|
|
||||||
def blank(self):
|
def blank(self):
|
||||||
log.debug(u'Live = %s, blank' % self.isLive)
|
log.debug(u'Live = %s, blank' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if not self.doc.is_loaded():
|
if not self.doc.is_loaded():
|
||||||
return
|
return
|
||||||
@ -162,8 +162,8 @@ class Controller(object):
|
|||||||
self.doc.blank_screen()
|
self.doc.blank_screen()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
log.debug(u'Live = %s, stop' % self.isLive)
|
log.debug(u'Live = %s, stop' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
if not self.doc.is_loaded():
|
if not self.doc.is_loaded():
|
||||||
return
|
return
|
||||||
@ -172,8 +172,8 @@ class Controller(object):
|
|||||||
self.doc.stop_presentation()
|
self.doc.stop_presentation()
|
||||||
|
|
||||||
def unblank(self):
|
def unblank(self):
|
||||||
log.debug(u'Live = %s, unblank' % self.isLive)
|
log.debug(u'Live = %s, unblank' % self.is_live)
|
||||||
if not self.isLive:
|
if not self.is_live:
|
||||||
return
|
return
|
||||||
self.activate()
|
self.activate()
|
||||||
if self.doc.slidenumber and \
|
if self.doc.slidenumber and \
|
||||||
@ -183,7 +183,7 @@ class Controller(object):
|
|||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
|
|
||||||
def poll(self):
|
def poll(self):
|
||||||
self.doc.poll_slidenumber(self.isLive)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
||||||
class MessageListener(object):
|
class MessageListener(object):
|
||||||
"""
|
"""
|
||||||
@ -195,8 +195,8 @@ class MessageListener(object):
|
|||||||
def __init__(self, mediaitem):
|
def __init__(self, mediaitem):
|
||||||
self.controllers = mediaitem.controllers
|
self.controllers = mediaitem.controllers
|
||||||
self.mediaitem = mediaitem
|
self.mediaitem = mediaitem
|
||||||
self.previewHandler = Controller(False)
|
self.preview_handler = Controller(False)
|
||||||
self.liveHandler = Controller(True)
|
self.live_handler = Controller(True)
|
||||||
# messages are sent from core.ui.slidecontroller
|
# messages are sent from core.ui.slidecontroller
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'presentations_start'), self.startup)
|
QtCore.SIGNAL(u'presentations_start'), self.startup)
|
||||||
@ -228,9 +228,10 @@ class MessageListener(object):
|
|||||||
Start of new presentation
|
Start of new presentation
|
||||||
Save the handler as any new presentations start here
|
Save the handler as any new presentations start here
|
||||||
"""
|
"""
|
||||||
isLive, item = self.decode_message(message)
|
is_live = message[1]
|
||||||
|
item = message[0]
|
||||||
log.debug(u'Startup called with message %s' % message)
|
log.debug(u'Startup called with message %s' % message)
|
||||||
isBlank = message[2]
|
is_blank = message[2]
|
||||||
file = os.path.join(item.get_frame_path(),
|
file = os.path.join(item.get_frame_path(),
|
||||||
item.get_frame_title())
|
item.get_frame_title())
|
||||||
self.handler = item.title
|
self.handler = item.title
|
||||||
@ -238,75 +239,71 @@ class MessageListener(object):
|
|||||||
self.handler = self.mediaitem.findControllerByType(file)
|
self.handler = self.mediaitem.findControllerByType(file)
|
||||||
if not self.handler:
|
if not self.handler:
|
||||||
return
|
return
|
||||||
if isLive:
|
if is_live:
|
||||||
controller = self.liveHandler
|
controller = self.live_handler
|
||||||
else:
|
else:
|
||||||
controller = self.previewHandler
|
controller = self.preview_handler
|
||||||
controller.addHandler(self.controllers[self.handler], file, isBlank)
|
controller.add_handler(self.controllers[self.handler], file, is_blank)
|
||||||
|
|
||||||
def decode_message(self, message):
|
|
||||||
if len(message) == 3:
|
|
||||||
return message[1], message[0], message[2]
|
|
||||||
else:
|
|
||||||
return message[1], message[0]
|
|
||||||
|
|
||||||
def slide(self, message):
|
def slide(self, message):
|
||||||
isLive, item, slide = self.decode_message(message)
|
is_live = message[1]
|
||||||
if isLive:
|
slide = message[2]
|
||||||
self.liveHandler.slide(slide, isLive)
|
item = message[0]
|
||||||
|
if is_live:
|
||||||
|
self.live_handler.slide(slide, item)
|
||||||
else:
|
else:
|
||||||
self.previewHandler.slide(slide, isLive)
|
self.preview_handler.slide(slide, item)
|
||||||
|
|
||||||
def first(self, message):
|
def first(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.first()
|
self.live_handler.first()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.first()
|
self.preview_handler.first()
|
||||||
|
|
||||||
def last(self, message):
|
def last(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.last()
|
self.live_handler.last()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.last()
|
self.preview_handler.last()
|
||||||
|
|
||||||
def next(self, message):
|
def next(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.next()
|
self.live_handler.next()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.next()
|
self.preview_handler.next()
|
||||||
|
|
||||||
def previous(self, message):
|
def previous(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.previous()
|
self.live_handler.previous()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.previous()
|
self.preview_handler.previous()
|
||||||
|
|
||||||
def shutdown(self, message):
|
def shutdown(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'maindisplay_show')
|
||||||
self.liveHandler.shutdown()
|
self.live_handler.shutdown()
|
||||||
else:
|
else:
|
||||||
self.previewHandler.shutdown()
|
self.preview_handler.shutdown()
|
||||||
|
|
||||||
def hide(self, message):
|
def hide(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.stop()
|
self.live_handler.stop()
|
||||||
|
|
||||||
def blank(self, message):
|
def blank(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.blank()
|
self.live_handler.blank()
|
||||||
|
|
||||||
def unblank(self, message):
|
def unblank(self, message):
|
||||||
isLive = self.decode_message(message)[0]
|
is_live = message[1]
|
||||||
if isLive:
|
if is_live:
|
||||||
self.liveHandler.unblank()
|
self.live_handler.unblank()
|
||||||
|
|
||||||
def timeout(self):
|
def timeout(self):
|
||||||
self.liveHandler.poll()
|
self.live_handler.poll()
|
||||||
|
@ -30,6 +30,7 @@ if os.name == u'nt':
|
|||||||
from win32com.client import Dispatch
|
from win32com.client import Dispatch
|
||||||
import _winreg
|
import _winreg
|
||||||
import win32ui
|
import win32ui
|
||||||
|
import pywintypes
|
||||||
|
|
||||||
from presentationcontroller import PresentationController, PresentationDocument
|
from presentationcontroller import PresentationController, PresentationDocument
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ class PowerpointController(PresentationController):
|
|||||||
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
|
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
|
||||||
u'PowerPoint.Application').Close()
|
u'PowerPoint.Application').Close()
|
||||||
return True
|
return True
|
||||||
except:
|
except WindowsError:
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ class PowerpointController(PresentationController):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
self.process.Quit()
|
self.process.Quit()
|
||||||
except:
|
except pywintypes.com_error:
|
||||||
pass
|
pass
|
||||||
self.process = None
|
self.process = None
|
||||||
|
|
||||||
@ -121,11 +122,8 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
log.debug(u'LoadPresentation')
|
log.debug(u'LoadPresentation')
|
||||||
if not self.controller.process.Visible:
|
if not self.controller.process.Visible:
|
||||||
self.controller.start_process()
|
self.controller.start_process()
|
||||||
#try:
|
|
||||||
self.controller.process.Presentations.Open(self.filepath, False, False,
|
self.controller.process.Presentations.Open(self.filepath, False, False,
|
||||||
True)
|
True)
|
||||||
#except:
|
|
||||||
# return
|
|
||||||
self.presentation = self.controller.process.Presentations(
|
self.presentation = self.controller.process.Presentations(
|
||||||
self.controller.process.Presentations.Count)
|
self.controller.process.Presentations.Count)
|
||||||
self.create_thumbnails()
|
self.create_thumbnails()
|
||||||
@ -154,7 +152,7 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
if self.presentation:
|
if self.presentation:
|
||||||
try:
|
try:
|
||||||
self.presentation.Close()
|
self.presentation.Close()
|
||||||
except:
|
except pywintypes.com_error:
|
||||||
pass
|
pass
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.controller.remove_doc(self)
|
self.controller.remove_doc(self)
|
||||||
@ -170,7 +168,9 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
return False
|
return False
|
||||||
if self.controller.process.Presentations.Count == 0:
|
if self.controller.process.Presentations.Count == 0:
|
||||||
return False
|
return False
|
||||||
except:
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
except pywintypes.com_error:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -186,7 +186,9 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
return False
|
return False
|
||||||
if self.presentation.SlideShowWindow.View is None:
|
if self.presentation.SlideShowWindow.View is None:
|
||||||
return False
|
return False
|
||||||
except:
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
except pywintypes.com_error:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -208,7 +210,10 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
"""
|
"""
|
||||||
Returns true if screen is blank
|
Returns true if screen is blank
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
return self.presentation.SlideShowWindow.View.State == 3
|
return self.presentation.SlideShowWindow.View.State == 3
|
||||||
|
except pywintypes.com_error:
|
||||||
|
return False
|
||||||
|
|
||||||
def stop_presentation(self):
|
def stop_presentation(self):
|
||||||
"""
|
"""
|
||||||
@ -224,11 +229,11 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
#SlideShowWindow measures its size/position by points, not pixels
|
#SlideShowWindow measures its size/position by points, not pixels
|
||||||
try:
|
try:
|
||||||
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
|
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
|
||||||
except:
|
except win32ui.error:
|
||||||
try:
|
try:
|
||||||
dpi = \
|
dpi = \
|
||||||
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
|
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
|
||||||
except:
|
except win32ui.error:
|
||||||
dpi = 96
|
dpi = 96
|
||||||
self.presentation.SlideShowSettings.Run()
|
self.presentation.SlideShowSettings.Run()
|
||||||
self.presentation.SlideShowWindow.View.GotoSlide(1)
|
self.presentation.SlideShowWindow.View.GotoSlide(1)
|
||||||
|
@ -72,7 +72,7 @@ class PptviewController(PresentationController):
|
|||||||
try:
|
try:
|
||||||
self.start_process()
|
self.start_process()
|
||||||
return self.process.CheckInstalled()
|
return self.process.CheckInstalled()
|
||||||
except:
|
except WindowsError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def start_process(self):
|
def start_process(self):
|
||||||
@ -84,6 +84,7 @@ class PptviewController(PresentationController):
|
|||||||
log.debug(u'start PPTView')
|
log.debug(u'start PPTView')
|
||||||
self.process = cdll.LoadLibrary(
|
self.process = cdll.LoadLibrary(
|
||||||
r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
|
r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
|
||||||
|
#self.process.SetDebug(1)
|
||||||
|
|
||||||
def kill(self):
|
def kill(self):
|
||||||
"""
|
"""
|
||||||
@ -106,6 +107,7 @@ class PptviewDocument(PresentationDocument):
|
|||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.pptid = None
|
self.pptid = None
|
||||||
self.blanked = False
|
self.blanked = False
|
||||||
|
self.hidden = False
|
||||||
|
|
||||||
def load_presentation(self):
|
def load_presentation(self):
|
||||||
"""
|
"""
|
||||||
@ -123,13 +125,11 @@ class PptviewDocument(PresentationDocument):
|
|||||||
rect = rendermanager.screens.current[u'size']
|
rect = rendermanager.screens.current[u'size']
|
||||||
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
|
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
|
||||||
filepath = str(self.filepath.replace(u'/', u'\\'))
|
filepath = str(self.filepath.replace(u'/', u'\\'))
|
||||||
try:
|
|
||||||
self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
|
self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
|
||||||
str(os.path.join(self.thumbnailpath,
|
str(os.path.join(self.thumbnailpath,
|
||||||
self.controller.thumbnailprefix)))
|
self.controller.thumbnailprefix)))
|
||||||
|
if self.pptid:
|
||||||
self.stop_presentation()
|
self.stop_presentation()
|
||||||
except:
|
|
||||||
log.exception(u'Failed to load presentation')
|
|
||||||
|
|
||||||
def close_presentation(self):
|
def close_presentation(self):
|
||||||
"""
|
"""
|
||||||
@ -156,7 +156,7 @@ class PptviewDocument(PresentationDocument):
|
|||||||
"""
|
"""
|
||||||
Returns true if a presentation is currently active
|
Returns true if a presentation is currently active
|
||||||
"""
|
"""
|
||||||
return self.is_loaded()
|
return self.is_loaded() and not self.hidden
|
||||||
|
|
||||||
def blank_screen(self):
|
def blank_screen(self):
|
||||||
"""
|
"""
|
||||||
@ -183,12 +183,17 @@ class PptviewDocument(PresentationDocument):
|
|||||||
"""
|
"""
|
||||||
Stops the current presentation and hides the output
|
Stops the current presentation and hides the output
|
||||||
"""
|
"""
|
||||||
|
self.hidden = True
|
||||||
self.controller.process.Stop(self.pptid)
|
self.controller.process.Stop(self.pptid)
|
||||||
|
|
||||||
def start_presentation(self):
|
def start_presentation(self):
|
||||||
"""
|
"""
|
||||||
Starts a presentation from the beginning
|
Starts a presentation from the beginning
|
||||||
"""
|
"""
|
||||||
|
if self.hidden:
|
||||||
|
self.hidden = False
|
||||||
|
self.controller.process.Resume(self.pptid)
|
||||||
|
else:
|
||||||
self.controller.process.RestartShow(self.pptid)
|
self.controller.process.RestartShow(self.pptid)
|
||||||
|
|
||||||
def get_slide_number(self):
|
def get_slide_number(self):
|
||||||
|
@ -23,6 +23,8 @@ This README.TXT must be distributed with the pptviewlib.dll
|
|||||||
|
|
||||||
This library has a limit of 50 PowerPoints which can be opened simultaneously.
|
This library has a limit of 50 PowerPoints which can be opened simultaneously.
|
||||||
|
|
||||||
|
This project can be built with the free Microsoft Visual C++ 2008 Express Edition.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
-----
|
-----
|
||||||
BOOL CheckInstalled(void);
|
BOOL CheckInstalled(void);
|
||||||
|
@ -150,7 +150,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewp
|
|||||||
pptviewobj[id].rect.bottom = rect.bottom;
|
pptviewobj[id].rect.bottom = rect.bottom;
|
||||||
pptviewobj[id].rect.right = rect.right;
|
pptviewobj[id].rect.right = rect.right;
|
||||||
}
|
}
|
||||||
strcat_s(cmdline, MAX_PATH * 2, "/S \"");
|
strcat_s(cmdline, MAX_PATH * 2, "/F /S \"");
|
||||||
strcat_s(cmdline, MAX_PATH * 2, filename);
|
strcat_s(cmdline, MAX_PATH * 2, filename);
|
||||||
strcat_s(cmdline, MAX_PATH * 2, "\"");
|
strcat_s(cmdline, MAX_PATH * 2, "\"");
|
||||||
memset(&si, 0, sizeof(si));
|
memset(&si, 0, sizeof(si));
|
||||||
@ -211,7 +211,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewp
|
|||||||
}
|
}
|
||||||
DEBUG("OpenPPT: Steps %d, first slide steps %d\n",pptviewobj[id].steps,pptviewobj[id].firstSlideSteps);
|
DEBUG("OpenPPT: Steps %d, first slide steps %d\n",pptviewobj[id].steps,pptviewobj[id].firstSlideSteps);
|
||||||
SavePPTInfo(id);
|
SavePPTInfo(id);
|
||||||
if(pptviewobj[id].state==PPT_CLOSING){
|
if(pptviewobj[id].state==PPT_CLOSING||pptviewobj[id].slideCount<=0){
|
||||||
ClosePPT(id);
|
ClosePPT(id);
|
||||||
id=-1;
|
id=-1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user