tweak importer, support importing tags

This commit is contained in:
Damien Elmes 2009-01-17 23:01:06 +09:00
parent f5b4e9f689
commit f13e3fd33d
2 changed files with 11 additions and 6 deletions

View file

@ -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)

View file

@ -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>&lt;h1>Available fields&lt;/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>&lt;h1>Select Target Field&lt;/h1></string>
</property>
<property name="wordWrap" >
<bool>true</bool>