forked from openlp/openlp
- Renamed some code
This commit is contained in:
parent
2c4dbda42f
commit
2fcd292969
@ -239,7 +239,7 @@ class SlideController(DisplayController, RegistryProperties):
|
|||||||
text=translate('OpenLP.SlideController', 'Show Desktop'),
|
text=translate('OpenLP.SlideController', 'Show Desktop'),
|
||||||
can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut,
|
can_shortcuts=True, context=QtCore.Qt.WidgetWithChildrenShortcut,
|
||||||
category=self.category,
|
category=self.category,
|
||||||
triggers=self.live_escape)
|
triggers=self.on_hide_display_enable)
|
||||||
self.desktop_screen = create_action(self, 'desktopScreen',
|
self.desktop_screen = create_action(self, 'desktopScreen',
|
||||||
text=translate('OpenLP.SlideController', 'Show or hide Desktop'),
|
text=translate('OpenLP.SlideController', 'Show or hide Desktop'),
|
||||||
icon=':/slides/slide_desktop.png',
|
icon=':/slides/slide_desktop.png',
|
||||||
@ -955,7 +955,7 @@ class SlideController(DisplayController, RegistryProperties):
|
|||||||
else:
|
else:
|
||||||
Registry().execute('live_display_show')
|
Registry().execute('live_display_show')
|
||||||
else:
|
else:
|
||||||
self.live_escape()
|
self.on_hide_display_enable()
|
||||||
|
|
||||||
def on_slide_blank(self):
|
def on_slide_blank(self):
|
||||||
"""
|
"""
|
||||||
@ -1015,6 +1015,7 @@ class SlideController(DisplayController, RegistryProperties):
|
|||||||
def on_hide_display(self, checked=None):
|
def on_hide_display(self, checked=None):
|
||||||
"""
|
"""
|
||||||
Handle the Hide screen button
|
Handle the Hide screen button
|
||||||
|
This toggles the desktop screen.
|
||||||
|
|
||||||
:param checked: the new state of the of the widget
|
:param checked: the new state of the of the widget
|
||||||
"""
|
"""
|
||||||
@ -1033,9 +1034,12 @@ class SlideController(DisplayController, RegistryProperties):
|
|||||||
self.update_preview()
|
self.update_preview()
|
||||||
self.on_toggle_loop()
|
self.on_toggle_loop()
|
||||||
|
|
||||||
def live_escape(self, checked=None):
|
def on_hide_display_enable(self, checked=None):
|
||||||
"""
|
"""
|
||||||
If you press ESC on the live screen it should close the display temporarily.
|
Handle the on_hide_display_enable
|
||||||
|
This only enables the desktop screen.
|
||||||
|
|
||||||
|
:param checked: the new state of the of the widget
|
||||||
"""
|
"""
|
||||||
self.blank_screen.setChecked(False)
|
self.blank_screen.setChecked(False)
|
||||||
self.theme_screen.setChecked(False)
|
self.theme_screen.setChecked(False)
|
||||||
|
@ -208,9 +208,9 @@ class TestSlideController(TestCase):
|
|||||||
mocked_on_theme_display.assert_called_once_with(False)
|
mocked_on_theme_display.assert_called_once_with(False)
|
||||||
mocked_on_hide_display.assert_called_once_with(False)
|
mocked_on_hide_display.assert_called_once_with(False)
|
||||||
|
|
||||||
def test_live_escape(self):
|
def test_on_hide_display_enable(self):
|
||||||
"""
|
"""
|
||||||
Test that when the live_escape() method is called, the display is set to invisible and any media is stopped
|
Test that when the on_hide_display_enable() method is called, the display is set to invisible and any media is stopped
|
||||||
"""
|
"""
|
||||||
# GIVEN: A new SlideController instance and mocked out display and media_controller
|
# GIVEN: A new SlideController instance and mocked out display and media_controller
|
||||||
mocked_display = MagicMock()
|
mocked_display = MagicMock()
|
||||||
@ -224,8 +224,8 @@ class TestSlideController(TestCase):
|
|||||||
slide_controller.play_slides_loop = play_slides
|
slide_controller.play_slides_loop = play_slides
|
||||||
slide_controller.play_slides_once = play_slides
|
slide_controller.play_slides_once = play_slides
|
||||||
|
|
||||||
# WHEN: live_escape() is called
|
# WHEN: on_hide_display_enable() is called
|
||||||
slide_controller.live_escape()
|
slide_controller.on_hide_display_enable()
|
||||||
|
|
||||||
# THEN: the display should be set to invisible and the media controller stopped
|
# THEN: the display should be set to invisible and the media controller stopped
|
||||||
mocked_display.setVisible.assert_called_once_with(False)
|
mocked_display.setVisible.assert_called_once_with(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user