Merge lp:~tomasgroth/openlp/refix-win-display into lp:openlp

Proposed by Tomas Groth
Status: Merged
Merged at revision: 2625
Proposed branch: lp:~tomasgroth/openlp/refix-win-display
Merge into: lp:openlp
Diff against target: 48 lines (+19/-3)
2 files modified
openlp/core/ui/maindisplay.py (+3/-3)
tests/functional/openlp_plugins/songusage/test_songusage.py (+16/-0)
To merge this branch: bzr merge lp:~tomasgroth/openlp/refix-win-display
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+287521@code.launchpad.net

Description of the change

Another attempt to fully fix bug 1531319.

To post a comment you must log in.
Revision history for this message
Tomas Groth (tomasgroth) wrote :
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/maindisplay.py'
2--- openlp/core/ui/maindisplay.py 2016-02-09 21:01:20 +0000
3+++ openlp/core/ui/maindisplay.py 2016-02-29 20:00:13 +0000
4@@ -408,10 +408,7 @@
5 self.application.process_events()
6 # Workaround for bug #1531319, should not be needed with PyQt 5.6.
7 if is_win():
8- # Workaround for bug #1531319, should not be needed with PyQt 5.6.
9 fade_shake_timer.stop()
10- elif is_win():
11- self.shake_web_view()
12 # Wait for the webview to update before getting the preview.
13 # Important otherwise first preview will miss the background !
14 while not self.web_loaded:
15@@ -429,6 +426,9 @@
16 self.setVisible(True)
17 else:
18 self.setVisible(True)
19+ # Workaround for bug #1531319, should not be needed with PyQt 5.6.
20+ if is_win():
21+ self.shake_web_view()
22 return self.grab()
23
24 def build_html(self, service_item, image_path=''):
25
26=== modified file 'tests/functional/openlp_plugins/songusage/test_songusage.py'
27--- tests/functional/openlp_plugins/songusage/test_songusage.py 2016-02-12 20:23:18 +0000
28+++ tests/functional/openlp_plugins/songusage/test_songusage.py 2016-02-29 20:00:13 +0000
29@@ -81,3 +81,19 @@
30
31 # THEN: It should return True
32 self.assertTrue(ret)
33+
34+ @patch('openlp.plugins.songusage.songusageplugin.Manager')
35+ def toggle_song_usage_state_test(self, MockedManager):
36+ """
37+ Test that toggle_song_usage_state does toggle song_usage_state
38+ """
39+ # GIVEN: A SongUsagePlugin
40+ song_usage = SongUsagePlugin()
41+ song_usage.set_button_state = MagicMock()
42+ song_usage.song_usage_active = True
43+
44+ # WHEN: calling toggle_song_usage_state
45+ song_usage.toggle_song_usage_state()
46+
47+ # THEN: song_usage_state should have been toogled
48+ self.assertFalse(song_usage.song_usage_active)