From 46a24812ce13d9b42b015813c55fa2ccf11d628c Mon Sep 17 00:00:00 2001 From: Erez Volk Date: Fri, 3 Jan 2020 08:32:44 +0200 Subject: [PATCH] Enable Tag Modified iff importMode is Update --- CONTRIBUTORS | 2 +- qt/aqt/importing.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 88cff1adb..f41d0d36f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -18,7 +18,7 @@ support site, it would be great if you could add your name below as well. ******************** -- Sample Name +Erez Volk ******************** diff --git a/qt/aqt/importing.py b/qt/aqt/importing.py index 046176d18..65e649c7f 100644 --- a/qt/aqt/importing.py +++ b/qt/aqt/importing.py @@ -91,6 +91,7 @@ class ImportDialog(QDialog): self.frm.autoDetect.clicked.connect(self.onDelimiter) self.updateDelimiterButtonText() self.frm.allowHTML.setChecked(self.mw.pm.profile.get("allowHTML", True)) + self.frm.importMode.currentIndexChanged.connect(self.importModeChanged) self.frm.importMode.setCurrentIndex(self.mw.pm.profile.get("importMode", 1)) # import button b = QPushButton(_("Import")) @@ -286,6 +287,14 @@ you can enter it here. Use \\t to represent tab.""" def helpRequested(self): openHelp("importing") + def importModeChanged(self, newImportMode): + if newImportMode == 0: + allowTagModified = True + else: + allowTagModified = False + self.frm.tagModifiedCheck.setEnabled(allowTagModified) + self.frm.tagModifiedTag.setEnabled(allowTagModified) + def showUnicodeWarning(): """Shorthand to show a standard warning."""