--- as_dataop.cpp 2003/02/03 21:14:58 1.41
+++ as_dataop.cpp 2003/02/04 19:30:31 1.42
@@ -38,6 +38,7 @@
#include "as_gui.h" // Main classes
#include "as_tableitem.h" // For class RtTableItem
#include "as_crc.h" // For quality strings
+#include "as_uuid.h" // UUID classes
// Icon pixel maps
#include "as_gfx/statok.xpm" // static const char *s_kpcStatokay_xpm[]
@@ -157,7 +158,7 @@
// Ensure that the right data version pattern precedes the data
QString Datapattern = QString(TITRAQ_DATAPATTERN);
if (!Line.startsWith(Datapattern)) { // Incompatible data format
- QMessageBox Problema(TITRAQ_APPTITLE,
+ QMessageBox Problema(QString(TITRAQ_APPTITLE) + ' ' + asgui_version.v_short,
TITRAQ_NOPATTERNFOUND + QString(TITRAQ_DATAPATTERN) + TITRAQ_WASNOTFOUNDIN,
QMessageBox::Critical, QMessageBox::Ok | QMessageBox::Escape,
QMessageBox::NoButton, QMessageBox::NoButton);
@@ -165,15 +166,15 @@
throw Genexcept(TITRAQ_INVALIDDATA);
}
else if (Line.section(Datapattern, 1).section('.', 0, 0).toInt() != TITRAQ_DATAVERSIONMAJ) {
- QMessageBox Problema(TITRAQ_APPTITLE, TITRAQ_BADVERSIONMAJ,
- QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Escape,
+ QMessageBox Problema(QString(TITRAQ_APPTITLE) + ' ' + asgui_version.v_short,
+ TITRAQ_BADVERSIONMAJ, QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Escape,
QMessageBox::NoButton, QMessageBox::NoButton);
Problema.exec(); // Give the user the bad news
throw Genexcept(TITRAQ_INCOMPATDATA);
}
else if (Line.section(Datapattern, 1).section('.', 1, 1).toInt() > TITRAQ_DATAVERSIONMIN) {
- QMessageBox Problema(TITRAQ_APPTITLE, TITRAQ_BADVERSIONMIN,
- QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Escape,
+ QMessageBox Problema(QString(TITRAQ_APPTITLE) + ' ' + asgui_version.v_short,
+ TITRAQ_BADVERSIONMIN, QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Escape,
QMessageBox::NoButton, QMessageBox::NoButton);
Problema.exec(); // Give the user the bad news
throw Genexcept(TITRAQ_INCOMPATDATA);
@@ -215,10 +216,7 @@
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Guid; // Copy the GUID field
- if (!Guid.isEmpty())
- m_pMaintable->setText(nIter, TITRAQ_IDXGUID, Guid);
- else
- bValid = false;
+ // Postpone actual text delivery, to autoinsert GUIDs!
Asline.skipWhiteSpace(); // Remove whitespaces
Asline >> Crc; // Copy the CRC field
@@ -289,6 +287,19 @@
m_pMaintable->setPixmap(nIter, TITRAQ_IDXSTATUS, Staterror);
}
+ // Set the GUID text here, in case we need to generate a fresh value
+ if (!Guid.isEmpty()) {
+ if (Guid != ".") // This means, generate a fresh GUID value
+ m_pMaintable->setText(nIter, TITRAQ_IDXGUID, Guid);
+ else {
+ AS::Uuid Guidi; // For GUID production
+ Guidi.genId();
+ m_pMaintable->setText(nIter, TITRAQ_IDXGUID, Guidi.getString());
+ }
+ }
+ else // if isEmpty()
+ bValid = false;
+
// Set the CRC text here, in case we need to generate a fresh value
if (!Crc.isEmpty()) {
if (Crc != ".") // This means, generate a fresh CRC value
|