← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bug-892571 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bug-892571 into lp:openlp.

Requested reviews:
  Andreas Preikschat (googol)
Related bugs:
  Bug #892571 in OpenLP: "Service Manager Keys do mad things"
  https://bugs.launchpad.net/openlp/+bug/892571

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-892571/+merge/83516

Stop keyboard floods getting the slide controller and service manager out of set.
Key presses are only accepted when the previous updates have happened.

To Test set preview next song to on.
Add 5 songs to service manager 
Select the first one.
Press the right arrow key fast.
-- 
https://code.launchpad.net/~trb143/openlp/bug-892571/+merge/83516
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2011-10-31 09:14:07 +0000
+++ openlp/core/ui/slidecontroller.py	2011-11-27 16:12:26 +0000
@@ -79,6 +79,7 @@
         self.songEdit = False
         self.selectedRow = 0
         self.serviceItem = None
+        self.keypress_count = 0
         self.panel = QtGui.QWidget(parent.controlSplitter)
         self.slideList = {}
         # Layout for holding panel
@@ -578,12 +579,19 @@
         self.display.videoStop()
 
     def servicePrevious(self):
-        time.sleep(0.1)
-        Receiver.send_message('servicemanager_previous_item')
+        self.keypress_count += 1
+        if self.keypress_count == 1:
+            while self.keypress_count != 0:
+                Receiver.send_message('servicemanager_previous_item')
+                self.keypress_count -= 1             
 
     def serviceNext(self):
-        time.sleep(0.1)
-        Receiver.send_message('servicemanager_next_item')
+        self.keypress_count += 1
+        if self.keypress_count == 1:
+            while self.keypress_count != 0:
+                Receiver.send_message('servicemanager_next_item')
+                self.keypress_count -= 1            
+     
 
     def screenSizeChanged(self):
         """
@@ -771,7 +779,7 @@
         log.debug(u'processManagerItem live = %s' % self.isLive)
         self.onStopLoop()
         old_item = self.serviceItem
-        # take a copy not a link to the servicemeanager copy.
+        # take a copy not a link to the servicemanager copy.
         self.serviceItem = copy.copy(serviceItem)
         if old_item and self.isLive and old_item.is_capable(
             ItemCapabilities.ProvidesOwnDisplay):


Follow ups