diff --git a/openlp/core/ui/icons.py b/openlp/core/ui/icons.py index ecfbd9c5a..203bfe705 100644 --- a/openlp/core/ui/icons.py +++ b/openlp/core/ui/icons.py @@ -49,9 +49,9 @@ class UiIcons(metaclass=Singleton): qta.load_font('op', font_path, charmap_path) palette = QtWidgets.QApplication.palette() qta.set_defaults(color=palette.color(QtGui.QPalette.Active, - QtGui.QPalette.ButtonText), + QtGui.QPalette.WindowText), color_disabled=palette.color(QtGui.QPalette.Disabled, - QtGui.QPalette.ButtonText)) + QtGui.QPalette.WindowText)) icon_list = { 'active': {'icon': 'fa.child'}, 'add': {'icon': 'fa.plus-circle'}, diff --git a/tests/functional/openlp_core/lib/test_ui.py b/tests/functional/openlp_core/lib/test_ui.py index cbcc1b7a0..4312f2b26 100644 --- a/tests/functional/openlp_core/lib/test_ui.py +++ b/tests/functional/openlp_core/lib/test_ui.py @@ -88,6 +88,22 @@ def test_critical_error_message_box(MockRegistry): MockRegistry.return_value.get.return_value.error_message.assert_called_once_with('Error', 'This is an error') +@patch('openlp.core.lib.ui.Registry') +@patch('openlp.core.lib.ui.QtWidgets.QMessageBox.critical') +def test_critical_error_message_box_without_mainwindow(mocked_critical, MockRegistry): + """ + Test the critical_error_message_box() function + """ + # GIVEN: A mocked Registry with no MainWindow + MockRegistry.return_value.get.return_value = None + + # WHEN: critical_error_message_box() is called + critical_error_message_box('Error', 'This is an error') + + # THEN: The error_message() method on the main window should be called + mocked_critical.assert_called_once_with(None, 'Error', 'This is an error') + + @patch('openlp.core.lib.ui.QtWidgets.QMessageBox.critical') def test_critical_error_question(mocked_critical): """ diff --git a/tests/openlp_core/projectors/test_projector_commands_01.py b/tests/openlp_core/projectors/test_projector_commands_01.py index b0bb93952..08d036b80 100644 --- a/tests/openlp_core/projectors/test_projector_commands_01.py +++ b/tests/openlp_core/projectors/test_projector_commands_01.py @@ -28,6 +28,22 @@ from openlp.core.projectors.pjlinkcommands import process_command from openlp.core.projectors.constants import E_ERROR, E_WARN, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, S_OK +@patch.object(openlp.core.projectors.pjlinkcommands, 'log') +def test_projector_ackn(mock_log, pjlink): + """ + Test ackn command (empty test) + """ + # GIVEN: Test setup + log_debug_text = [call('({ip}) Processing command "ACKN" with data "0"'.format(ip=pjlink.name)), + call('({ip}) Calling function for ACKN'.format(ip=pjlink.name))] + + # WHEN: Called with setting shutter closed and mute on + process_command(projector=pjlink, cmd='ACKN', data='0') + + # THEN: Shutter should be closed and mute should be True + mock_log.debug.assert_has_calls(log_debug_text) + + @patch.object(openlp.core.projectors.pjlink.PJLink, 'projectorUpdateIcons') @patch.object(openlp.core.projectors.pjlinkcommands, 'log') def test_projector_avmt_audio_muted(mock_log, mock_UpdateIcons, pjlink):