Fix stuttering powerpoint start

This commit is contained in:
Jonathan Corwin 2011-04-07 23:57:12 +01:00
parent 9b04385f34
commit 78a9c89025
3 changed files with 17 additions and 14 deletions

View File

@ -646,7 +646,7 @@ class SlideController(QtGui.QWidget):
self.display.buildHtml(self.serviceItem)
if serviceItem.is_media():
self.onMediaStart(serviceItem)
self.onSlideSelected()
self.onSlideSelected(True)
self.previewListWidget.setFocus()
Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix,
[serviceItem])
@ -833,7 +833,7 @@ class SlideController(QtGui.QWidget):
% self.serviceItem.name.lower(),
[self.serviceItem, self.isLive])
def onSlideSelected(self):
def onSlideSelected(self, start=False):
"""
Generate the preview when you click on a slide.
if this is the Live Controller also display on the screen
@ -842,7 +842,7 @@ class SlideController(QtGui.QWidget):
self.selectedRow = 0
if row > -1 and row < self.previewListWidget.rowCount():
if self.serviceItem.is_command():
if self.isLive:
if self.isLive and not start:
Receiver.send_message(
u'%s_slide' % self.serviceItem.name.lower(),
[self.serviceItem, self.isLive, row])

View File

@ -49,7 +49,7 @@ class Controller(object):
self.doc = None
log.info(u'%s controller loaded' % live)
def add_handler(self, controller, file, hide_mode):
def add_handler(self, controller, file, hide_mode, slide_no):
"""
Add a handler, which is an instance of a presentation and
slidecontroller combination. If the slidecontroller has a display
@ -64,8 +64,8 @@ class Controller(object):
# Display error message to user
# Inform slidecontroller that the action failed?
return
self.doc.slidenumber = slide_no
if self.is_live:
self.doc.start_presentation()
if hide_mode == HideMode.Screen:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.stop()
@ -73,11 +73,14 @@ class Controller(object):
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
self.blank()
elif hide_mode == HideMode.Blank:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
self.blank()
else:
self.doc.start_presentation()
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
self.doc.slidenumber = 0
self.doc.slidenumber = 0
if slide_no > 1:
self.slide(slide_no)
def activate(self):
"""
@ -281,7 +284,8 @@ class MessageListener(object):
controller = self.live_handler
else:
controller = self.preview_handler
controller.add_handler(self.controllers[self.handler], file, hide_mode)
controller.add_handler(self.controllers[self.handler], file, hide_mode,
message[3])
def slide(self, message):
"""

View File

@ -251,14 +251,13 @@ class PowerpointDocument(PresentationDocument):
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
except win32ui.error:
dpi = 96
self.presentation.SlideShowSettings.Run()
self.presentation.SlideShowWindow.View.GotoSlide(1)
rendermanager = self.controller.plugin.renderManager
rect = rendermanager.screens.current[u'size']
self.presentation.SlideShowWindow.Top = rect.y() * 72 / dpi
self.presentation.SlideShowWindow.Height = rect.height() * 72 / dpi
self.presentation.SlideShowWindow.Left = rect.x() * 72 / dpi
self.presentation.SlideShowWindow.Width = rect.width() * 72 / dpi
ppt_window = self.presentation.SlideShowSettings.Run()
ppt_window.Top = rect.y() * 72 / dpi
ppt_window.Height = rect.height() * 72 / dpi
ppt_window.Left = rect.x() * 72 / dpi
ppt_window.Width = rect.width() * 72 / dpi
def get_slide_number(self):
"""