Another attempt to fully fix bug 1531319.

bzr-revno: 2625
This commit is contained in:
second@tgc.dk 2016-02-29 21:57:10 +01:00 committed by Tomas Groth
commit 0afada2129
2 changed files with 19 additions and 3 deletions

View File

@ -408,10 +408,7 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
self.application.process_events()
# Workaround for bug #1531319, should not be needed with PyQt 5.6.
if is_win():
# Workaround for bug #1531319, should not be needed with PyQt 5.6.
fade_shake_timer.stop()
elif is_win():
self.shake_web_view()
# Wait for the webview to update before getting the preview.
# Important otherwise first preview will miss the background !
while not self.web_loaded:
@ -429,6 +426,9 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
self.setVisible(True)
else:
self.setVisible(True)
# Workaround for bug #1531319, should not be needed with PyQt 5.6.
if is_win():
self.shake_web_view()
return self.grab()
def build_html(self, service_item, image_path=''):

View File

@ -81,3 +81,19 @@ class TestSongUsage(TestCase):
# THEN: It should return True
self.assertTrue(ret)
@patch('openlp.plugins.songusage.songusageplugin.Manager')
def toggle_song_usage_state_test(self, MockedManager):
"""
Test that toggle_song_usage_state does toggle song_usage_state
"""
# GIVEN: A SongUsagePlugin
song_usage = SongUsagePlugin()
song_usage.set_button_state = MagicMock()
song_usage.song_usage_active = True
# WHEN: calling toggle_song_usage_state
song_usage.toggle_song_usage_state()
# THEN: song_usage_state should have been toogled
self.assertFalse(song_usage.song_usage_active)