From 5bfd93842cb3126a31a223bb671089ab60ac493c Mon Sep 17 00:00:00 2001 From: Dmitry Mikheev Date: Sat, 15 Jul 2017 18:39:01 +0500 Subject: [PATCH] Let users extend their bottom buttons functions Like this: ``` aqt.deckbrowser.DeckBrowser.drawLinks.extend([ ["", "rebuildAll", _("Rebuild All")], ["", "emptyAll", _("Empty All")], ]) ``` --- aqt/deckbrowser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aqt/deckbrowser.py b/aqt/deckbrowser.py index 9f2dc2c5e..7eeb7517c 100644 --- a/aqt/deckbrowser.py +++ b/aqt/deckbrowser.py @@ -333,14 +333,15 @@ where id > ?""", (self.mw.col.sched.dayCutoff-86400)*1000) # Top buttons ###################################################################### - def _drawButtons(self): - links = [ + drawLinks = [ ["", "shared", _("Get Shared")], ["", "create", _("Create Deck")], - ["Ctrl+I", "import", _("Import File")], - ] + ["Ctrl+I", "import", _("Import File")], # Ctrl+I works from menu + ] + + def _drawButtons(self): buf = "" - for b in links: + for b in drawLinks: if b[0]: b[0] = _("Shortcut key: %s") % shortcut(b[0]) buf += """