From 3407fb7b2b5a125408d8816e55c174bf98b01796 Mon Sep 17 00:00:00 2001 From: sandersantema Date: Wed, 27 May 2020 12:04:00 +0200 Subject: [PATCH 1/3] add saveGeom and restoreGeom to htmlEditor --- qt/aqt/editor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 912b80295..120a31cf9 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -32,6 +32,8 @@ from aqt.utils import ( getFile, openHelp, qtMenuShortcutWorkaround, + restoreGeom, + saveGeom, shortcut, showInfo, showWarning, @@ -523,6 +525,7 @@ class Editor: d = QDialog(self.widget) form = aqt.forms.edithtml.Ui_Dialog() form.setupUi(d) + restoreGeom(d, "htmlEditor") qconnect(form.buttonBox.helpRequested, lambda: openHelp("editor")) form.textEdit.setPlainText(self.note.fields[field]) d.show() @@ -540,6 +543,7 @@ class Editor: if not self.addMode: self.note.flush() self.loadNote(focusTo=field) + saveGeom(d, "htmlEditor") # Tag handling ###################################################################### From 8f993c8e31e3650caa05978669ef70e68a39f393 Mon Sep 17 00:00:00 2001 From: sandersantema Date: Wed, 27 May 2020 12:04:49 +0200 Subject: [PATCH 2/3] remove unused variable 'w' from '_onHtmlEdit' --- qt/aqt/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 120a31cf9..618140a42 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -536,7 +536,7 @@ class Editor: if html.find(">") > -1: # filter html through beautifulsoup so we can strip out things like a # leading - with warnings.catch_warnings() as w: + with warnings.catch_warnings(): warnings.simplefilter("ignore", UserWarning) html = str(BeautifulSoup(html, "html.parser")) self.note.fields[field] = html From 6a48add11ff66ae8a6a28596afc6c000691ea1b2 Mon Sep 17 00:00:00 2001 From: sandersantema Date: Wed, 27 May 2020 12:05:42 +0200 Subject: [PATCH 3/3] Add to contributors --- CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 01aeb7544..525a2ff87 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -35,6 +35,7 @@ Rai (Michal Pokorny) Zeno Gantner Henrik Giesel MichaƂ Bartoszkiewicz +Sander Santema ********************