forked from openlp/openlp
fixed: replacing background with video unblank screen even if it blanked to theme
bzr-revno: 2360
This commit is contained in:
commit
cd06c994d8
@ -2,6 +2,7 @@
|
||||
*.*~
|
||||
\#*\#
|
||||
*.eric4project
|
||||
*.eric5project
|
||||
*.ropeproject
|
||||
*.e4*
|
||||
.eric4project
|
||||
|
@ -173,7 +173,7 @@ def create_button(parent, name, **kwargs):
|
||||
kwargs.setdefault('tooltip', translate('OpenLP.Ui', 'Move selection down one position.'))
|
||||
else:
|
||||
log.warn('The role "%s" is not defined in create_push_button().', role)
|
||||
if kwargs.pop('class', '') == 'toolbutton':
|
||||
if kwargs.pop('btn_class', '') == 'toolbutton':
|
||||
button = QtGui.QToolButton(parent)
|
||||
else:
|
||||
button = QtGui.QPushButton(parent)
|
||||
|
@ -506,6 +506,7 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
|
||||
else:
|
||||
self.media_volume(controller, controller.media_info.volume)
|
||||
if status:
|
||||
if not controller.media_info.is_background:
|
||||
display.frame.evaluateJavaScript('show_blank("desktop");')
|
||||
self.current_media_players[controller.controller_type].set_visible(display, True)
|
||||
# Flash needs to be played and will not AutoPlay
|
||||
@ -517,7 +518,7 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
|
||||
controller.mediabar.actions['playbackPause'].setVisible(True)
|
||||
controller.mediabar.actions['playbackStop'].setVisible(True)
|
||||
if controller.is_live:
|
||||
if controller.hide_menu.defaultAction().isChecked():
|
||||
if controller.hide_menu.defaultAction().isChecked() and not controller.media_info.is_background:
|
||||
controller.hide_menu.defaultAction().trigger()
|
||||
# Start Timer for ui updates
|
||||
if not self.timer.isActive():
|
||||
|
@ -82,6 +82,38 @@ class TestUi(TestCase):
|
||||
self.assertEqual(1, len(btnbox.buttons()))
|
||||
self.assertEqual(QtGui.QDialogButtonBox.HelpRole, btnbox.buttonRole(btnbox.buttons()[0]))
|
||||
|
||||
def test_create_button(self):
|
||||
"""
|
||||
Test creating a button
|
||||
"""
|
||||
# GIVEN: A dialog
|
||||
dialog = QtGui.QDialog()
|
||||
|
||||
# WHEN: We create the button
|
||||
btn = create_button(dialog, 'my_btn')
|
||||
|
||||
# THEN: We should get a button with a name
|
||||
self.assertIsInstance(btn, QtGui.QPushButton)
|
||||
self.assertEqual('my_btn', btn.objectName())
|
||||
self.assertTrue(btn.isEnabled())
|
||||
|
||||
# WHEN: We create a button with some attributes
|
||||
btn = create_button(dialog, 'my_btn', text='Hello', tooltip='How are you?', enabled=False)
|
||||
|
||||
# THEN: We should get a button with those attributes
|
||||
self.assertIsInstance(btn, QtGui.QPushButton)
|
||||
self.assertEqual('Hello', btn.text())
|
||||
self.assertEqual('How are you?', btn.toolTip())
|
||||
self.assertFalse(btn.isEnabled())
|
||||
|
||||
# WHEN: We create a toolbutton
|
||||
btn = create_button(dialog, 'my_btn', btn_class='toolbutton')
|
||||
|
||||
# THEN: We should get a toolbutton
|
||||
self.assertIsInstance(btn, QtGui.QToolButton)
|
||||
self.assertEqual('my_btn', btn.objectName())
|
||||
self.assertTrue(btn.isEnabled())
|
||||
|
||||
def test_create_valign_selection_widgets(self):
|
||||
"""
|
||||
Test creating a combo box for valign selection
|
||||
|
Loading…
Reference in New Issue
Block a user