Merge pull request #1330 from Arthur-Milchior/underline_history

Add Card history: keep & instead of replacing them by underline
This commit is contained in:
Damien Elmes 2021-08-15 19:16:22 +10:00 committed by GitHub
commit 2265bfe71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,6 +191,9 @@ class AddCards(QDialog):
txt = f"{txt[:30]}..." txt = f"{txt[:30]}..."
line = tr.adding_edit(val=txt) line = tr.adding_edit(val=txt)
line = gui_hooks.addcards_will_add_history_entry(line, note) line = gui_hooks.addcards_will_add_history_entry(line, note)
line = line.replace("&", "&&")
# In qt action "&i" means "underline i, trigger this line when i is pressed".
# except for "&&" which is replaced by a single "&"
a = m.addAction(line) a = m.addAction(line)
qconnect(a.triggered, lambda b, nid=nid: self.editHistory(nid)) qconnect(a.triggered, lambda b, nid=nid: self.editHistory(nid))
else: else: