mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
tweak importer, support importing tags
This commit is contained in:
parent
f5b4e9f689
commit
f13e3fd33d
2 changed files with 11 additions and 6 deletions
|
@ -24,6 +24,7 @@ class ChangeMap(QDialog):
|
|||
if current == field.name:
|
||||
self.dialog.fields.setCurrentRow(n)
|
||||
n += 1
|
||||
self.dialog.fields.addItem(QListWidgetItem(_("Map to Tags")))
|
||||
self.dialog.fields.addItem(QListWidgetItem(_("Discard field")))
|
||||
if current is None:
|
||||
self.dialog.fields.setCurrentRow(n)
|
||||
|
@ -37,8 +38,10 @@ class ChangeMap(QDialog):
|
|||
row = self.dialog.fields.currentRow()
|
||||
if row < len(self.model.fieldModels):
|
||||
self.field = self.model.fieldModels[row]
|
||||
else:
|
||||
elif row == self.dialog.fields.count() - 1:
|
||||
self.field = None
|
||||
else:
|
||||
self.field = 0
|
||||
QDialog.accept(self)
|
||||
|
||||
class ImportDialog(QDialog):
|
||||
|
@ -185,6 +188,8 @@ class ImportDialog(QDialog):
|
|||
self.grid.addWidget(QLabel(text), num, 0)
|
||||
if self.mapping[num]:
|
||||
text = _("mapped to <b>%s</b>") % self.mapping[num].name
|
||||
elif self.mapping[num] is 0:
|
||||
text = _("mapped to <b>Tags</b>")
|
||||
else:
|
||||
text = _("<ignored>")
|
||||
self.grid.addWidget(QLabel(text), num, 1)
|
||||
|
|
|
@ -10,19 +10,19 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Change field mapping</string>
|
||||
<string>Import</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string><h1>Available fields</h1>Please choose which field you would like to import into. If you select "Discard field", all data from this field will be lost.</string>
|
||||
<string><h1>Select Target Field</h1></string>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
|
|
Loading…
Reference in a new issue