FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
207 stars 49 forks source link

ListLayout: Another Cue is selected when pressing a Keybord Shortcut #230

Closed Stav88 closed 2 years ago

Stav88 commented 2 years ago

Describe the bug After having configured a Keyord Shortcut, a search in the list is executed when the shortcut is used.

To Reproduce Steps to reproduce the behavior:

  1. At start, select "List Layout" as Layout
  2. Add three cues
  3. Rename the second one to begin with the letter Q (for exemple)
    • Right-click > Edit Cue
    • Open "Appearance" tab
    • Edit Cue Name
    • Click "OK"
  4. Add a Keybord Shortcut on last one using the letter choosed at step 3 (Q)
    • Right-click > Edit Cue
    • Open "Cue Control" tab
    • Open "Keyboard Shortcut" subtab
    • Click Add
    • In key column, write "q" (in small case)
    • Click "OK" image
  5. Select the first cue image
  6. Press the letter choosed at step 3 (Q)

Expected behavior

I don't know what is the expected behavior if no "Keyboard Shortcut" is configured.

Linux Show Player version:

OS Version

Additional context The search in list can be disabled by overloading the method keyboardSearch in CueListView :

diff --git a/lisp/layouts/list_layout/cue_list_view.py b/lisp/layouts/list_layout/cue_list_view.py
index 8a190df8..dca8d07c 100644
--- a/lisp/layouts/list_layout/cue_list_view.py
+++ b/lisp/layouts/list_layout/cue_list_view.py
@@ -111,6 +111,10 @@ class CueListView(QTreeWidget):
         else:
             super().contextMenuEvent(event)

+    def keyboardSearch(self, search):
+        # disable scroll to letter match
+        pass
+
     def keyPressEvent(self, event):
         self.key_event.emit(event)

but you may want to keep the behavior if the shortcut is not configured.

FrancescoCeruti commented 2 years ago

Thanks! I confirm for 0.5.x versions. The "develop" branch apparently is not affected by the same issue.

IMHO it's an unwanted behavior. Feel free to open a pull request with a fix for the master branch.