forked from openlp/openlp
HEAD
This commit is contained in:
commit
f9adf856f1
@ -152,8 +152,14 @@ class DisplayWindow(QtWidgets.QWidget):
|
|||||||
self.setGeometry(screen.display_geometry)
|
self.setGeometry(screen.display_geometry)
|
||||||
self.screen_number = screen.number
|
self.screen_number = screen.number
|
||||||
|
|
||||||
def set_single_image(self, bg_color, image):
|
def set_single_image(self, bg_color, image_path):
|
||||||
image_uri = image.as_uri()
|
"""
|
||||||
|
|
||||||
|
: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,
|
self.run_javascript('Display.setFullscreenImage("{bg_color}", "{image}");'.format(bg_color=bg_color,
|
||||||
image=image_uri))
|
image=image_uri))
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ from openlp.core.common import SlideLimits
|
|||||||
from openlp.core.common.actions import ActionList, CategoryOrder
|
from openlp.core.common.actions import ActionList, CategoryOrder
|
||||||
from openlp.core.common.i18n import UiStrings, translate
|
from openlp.core.common.i18n import UiStrings, translate
|
||||||
from openlp.core.common.mixins import LogMixin, RegistryProperties
|
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.registry import Registry, RegistryBase
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.display.screens import ScreenList
|
from openlp.core.display.screens import ScreenList
|
||||||
@ -1182,7 +1183,7 @@ class SlideController(QtWidgets.QWidget, LogMixin, RegistryProperties):
|
|||||||
QtCore.QTimer.singleShot(2500, self.grab_maindisplay)
|
QtCore.QTimer.singleShot(2500, self.grab_maindisplay)
|
||||||
else:
|
else:
|
||||||
# If not live, use the slide's thumbnail/icon instead
|
# 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):
|
# if self.service_item.is_capable(ItemCapabilities.HasThumbnails):
|
||||||
# image = self.image_manager.get_image(image_path, ImageSource.CommandPlugins)
|
# image = self.image_manager.get_image(image_path, ImageSource.CommandPlugins)
|
||||||
# self.slide_image = QtGui.QPixmap.fromImage(image)
|
# self.slide_image = QtGui.QPixmap.fromImage(image)
|
||||||
|
@ -337,7 +337,12 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
log.debug('main display size: y={y:d}, height={height:d}, '
|
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={x:d}, width={width:d}'.format(y=size.y(), height=size.height(),
|
||||||
x=size.x(), width=size.width()))
|
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
|
# Make sure powerpoint doesn't steal focus, unless we're on a single screen setup
|
||||||
if len(ScreenList()) > 1:
|
if len(ScreenList()) > 1:
|
||||||
Registry().get('main_window').activateWindow()
|
Registry().get('main_window').activateWindow()
|
||||||
@ -369,6 +374,10 @@ class PowerpointDocument(PresentationDocument):
|
|||||||
self.presentation_hwnd = hwnd
|
self.presentation_hwnd = hwnd
|
||||||
# Stop powerpoint from flashing in the taskbar
|
# Stop powerpoint from flashing in the taskbar
|
||||||
win32gui.FlashWindowEx(self.presentation_hwnd, win32con.FLASHW_STOP, 0, 0)
|
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):
|
def get_slide_number(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user