From 44952ff727f7aba2deaf5adbd853e4e56d36a760 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 11 Mar 2019 13:43:25 +1000 Subject: [PATCH] revert undo shortcut change in browser when ctrl+z pressed in focused field and no undo history left, qt triggers the menu item instead, causing data loss I tried capturing the shortcut in JS and manually executing the undo, and that seems to work on macOS, but not on Windows. fixes https://anki.tenderapp.com/discussions/ankidesktop/33064-how-to-undo-reverted-to-state-deleting-my-cards --- aqt/browser.py | 2 -- designer/browser.ui | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/aqt/browser.py b/aqt/browser.py index ec3240f59..c93ce2b4f 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -421,8 +421,6 @@ class Browser(QMainWindow): f.filter.clicked.connect(self.onFilterButton) # edit f.actionUndo.triggered.connect(self.mw.onUndo) - if qtminor < 11: - f.actionUndo.setShortcut(QKeySequence(_("Ctrl+Alt+Z"))) f.actionInvertSelection.triggered.connect(self.invertSelection) f.actionSelectNotes.triggered.connect(self.selectNotes) if not isMac: diff --git a/designer/browser.ui b/designer/browser.ui index e4f82c91d..79a4736ca 100644 --- a/designer/browser.ui +++ b/designer/browser.ui @@ -339,7 +339,7 @@ &Undo - Ctrl+Z + Ctrl+Alt+Z