1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-17 18:07:02 +00:00

Feed back results of batch process to user in Studio

This commit is contained in:
Robin Stuart
2017-08-11 22:36:40 +01:00
parent 1ca01e9322
commit 670242a3fe
3 changed files with 46 additions and 13 deletions

View File

@@ -80,6 +80,7 @@ void ExportWindow::process()
QString fileName;
QString dataString;
QString suffix;
QString Feedback;
int lines, i, j, inputpos, datalen;
lines = output_data.count(QChar('\n'), Qt::CaseInsensitive);
@@ -105,7 +106,9 @@ void ExportWindow::process()
case 7: suffix = ".tif"; break;
#endif
}
txtFeedback->clear();
Feedback = "";
for(i = 0; i < lines; i++) {
datalen = 0;
for(j = inputpos; ((j < output_data.length()) && (output_data[j] != '\n') ); j++) {
@@ -160,8 +163,17 @@ void ExportWindow::process()
break;
}
barcode->bc.setText(dataString.toLatin1().data());
barcode->bc.save_to_file(fileName.toLatin1().data());
barcode->bc.save_to_file(fileName.toLatin1().data());
Feedback += "Line ";
Feedback += QString::number(i + 1);
Feedback += ": ";
if (barcode->bc.hasErrors()) {
Feedback += barcode->bc.error_message();
Feedback += "\n";
} else {
Feedback += "Success\n";
}
txtFeedback->document()->setPlainText(Feedback);
inputpos += datalen + 1;
}
close();
}