This commit is contained in:
Raoul Snyman 2018-11-30 22:54:20 -07:00
commit f9adf856f1
3 changed files with 20 additions and 4 deletions

View File

@ -152,8 +152,14 @@ class DisplayWindow(QtWidgets.QWidget):
self.setGeometry(screen.display_geometry)
self.screen_number = screen.number
def set_single_image(self, bg_color, image):
image_uri = image.as_uri()
def set_single_image(self, bg_color, image_path):
"""
:param str bg_color:
:param Path image_path:
:return:
"""
image_uri = image_path.as_uri()
self.run_javascript('Display.setFullscreenImage("{bg_color}", "{image}");'.format(bg_color=bg_color,
image=image_uri))

View File

@ -32,6 +32,7 @@ from openlp.core.common import SlideLimits
from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.common.i18n import UiStrings, translate
from openlp.core.common.mixins import LogMixin, RegistryProperties
from openlp.core.common.path import Path
from openlp.core.common.registry import Registry, RegistryBase
from openlp.core.common.settings import Settings
from openlp.core.display.screens import ScreenList
@ -1182,7 +1183,7 @@ class SlideController(QtWidgets.QWidget, LogMixin, RegistryProperties):
QtCore.QTimer.singleShot(2500, self.grab_maindisplay)
else:
# If not live, use the slide's thumbnail/icon instead
image_path = self.service_item.get_rendered_frame(self.selected_row)
image_path = Path(self.service_item.get_rendered_frame(self.selected_row))
# if self.service_item.is_capable(ItemCapabilities.HasThumbnails):
# image = self.image_manager.get_image(image_path, ImageSource.CommandPlugins)
# self.slide_image = QtGui.QPixmap.fromImage(image)

View File

@ -337,7 +337,12 @@ class PowerpointDocument(PresentationDocument):
log.debug('main display size: y={y:d}, height={height:d}, '
'x={x:d}, width={width:d}'.format(y=size.y(), height=size.height(),
x=size.x(), width=size.width()))
win32gui.EnumWindows(self._window_enum_callback, size)
try:
win32gui.EnumWindows(self._window_enum_callback, size)
except pywintypes.error:
# When _window_enum_callback returns False to stop the enumeration (looping over open windows)
# it causes an exception that is ignored here
pass
# Make sure powerpoint doesn't steal focus, unless we're on a single screen setup
if len(ScreenList()) > 1:
Registry().get('main_window').activateWindow()
@ -369,6 +374,10 @@ class PowerpointDocument(PresentationDocument):
self.presentation_hwnd = hwnd
# Stop powerpoint from flashing in the taskbar
win32gui.FlashWindowEx(self.presentation_hwnd, win32con.FLASHW_STOP, 0, 0)
# Returning false stops the enumeration (looping over open windows)
return False
else:
return True
def get_slide_number(self):
"""