mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CVS import UI: better message if some columns were matched
If we automatically matched the columns this might already be correct. So the standard text is confusing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
810840ddb1
commit
2f5d4720e9
2 changed files with 5 additions and 1 deletions
|
@ -352,6 +352,7 @@ void DiveLogImportDialog::loadFileContents() {
|
||||||
QList<QStringList> fileColumns;
|
QList<QStringList> fileColumns;
|
||||||
QStringList currColumns;
|
QStringList currColumns;
|
||||||
QStringList headers;
|
QStringList headers;
|
||||||
|
bool matchedSome = false;
|
||||||
|
|
||||||
f.open(QFile::ReadOnly);
|
f.open(QFile::ReadOnly);
|
||||||
// guess the separator
|
// guess the separator
|
||||||
|
@ -382,10 +383,13 @@ void DiveLogImportDialog::loadFileContents() {
|
||||||
QString foundHeading = model->data(model->index(idx, 0), Qt::DisplayRole).toString();
|
QString foundHeading = model->data(model->index(idx, 0), Qt::DisplayRole).toString();
|
||||||
model->removeRow(idx);
|
model->removeRow(idx);
|
||||||
headers.append(foundHeading);
|
headers.append(foundHeading);
|
||||||
|
matchedSome = true;
|
||||||
} else {
|
} else {
|
||||||
headers.append("");
|
headers.append("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (matchedSome)
|
||||||
|
ui->dragInstructions->setText(tr("Some column headers were pre-populated; please drag and drop the headers so they match the column they are in."));
|
||||||
f.reset();
|
f.reset();
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
while (rows < 10 || !f.atEnd()) {
|
while (rows < 10 || !f.atEnd()) {
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="dragInstructions">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Drag the tags above to each corresponding column below</string>
|
<string>Drag the tags above to each corresponding column below</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Reference in a new issue