← Back to team overview

openlp-core team mailing list archive

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

 

Tomas Groth has proposed merging lp:~tomasgroth/openlp/refix-win-display into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/refix-win-display/+merge/287521

Another attempt to fully fix bug 1531319.
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~tomasgroth/openlp/refix-win-display into lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2016-02-09 21:01:20 +0000
+++ openlp/core/ui/maindisplay.py	2016-02-29 20:00:13 +0000
@@ -408,10 +408,7 @@
                     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 @@
                         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=''):

=== modified file 'tests/functional/openlp_plugins/songusage/test_songusage.py'
--- tests/functional/openlp_plugins/songusage/test_songusage.py	2016-02-12 20:23:18 +0000
+++ tests/functional/openlp_plugins/songusage/test_songusage.py	2016-02-29 20:00:13 +0000
@@ -81,3 +81,19 @@
 
         # 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)


References