From d5f354077023b4996ac1a1ae038324a2e11a1c42 Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 24 Nov 2014 16:51:27 +0200 Subject: [PATCH] Continue creation logging system. --HG-- branch : develop --- src/app/dialogs/app/dialogincrements.cpp | 26 ++++++++++++++++++++---- src/app/dialogs/tools/dialogtool.cpp | 2 ++ src/app/dialogs/tools/dialogtool.h | 3 +++ src/app/xml/vpattern.cpp | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 6cd58cc02..c95860b6b 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -55,8 +55,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par { ui->setupUi(this); + qCDebug(vDialog)<<"Showing variables."; if (qApp->patternType() == MeasurementsType::Individual) { + qCDebug(vDialog)<<"Pattern with individual measurements."; const QString filePath = doc->MPath(); try { @@ -599,6 +601,7 @@ void DialogIncrements::OpenTable() */ void DialogIncrements::clickedToolButtonAdd() { + qCDebug(vDialog)<<"Add new increment"; ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason); ui->tableWidgetIncrement->blockSignals(true); qint32 currentRow = ui->tableWidgetIncrement->rowCount(); @@ -667,6 +670,7 @@ void DialogIncrements::clickedToolButtonRemove() qint32 row = item->row(); QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); + qCDebug(vDialog)<<"Remove increment"<text(); data->RemoveIncrement(itemName->text()); quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); @@ -676,6 +680,10 @@ void DialogIncrements::clickedToolButtonRemove() QDomNodeList list = doc->elementsByTagName(VPattern::TagIncrements); list.at(0).removeChild(domElement); } + else + { + qCDebug(vDialog)<<"Could not find object with id"<tableWidgetIncrement->removeRow(row); if (ui->tableWidgetIncrement->rowCount() == 0) @@ -700,6 +708,9 @@ void DialogIncrements::clickedToolButtonRemove() void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize, const qreal &kheight, const QString &description) { + qCDebug(vDialog)<<"Saving new increment to file."; + qCDebug(vDialog)<createElement(VPattern::TagIncrement); doc->SetAttribute(element, VDomDocument::AttrId, id); @@ -731,42 +742,47 @@ void DialogIncrements::HideColumns(QTableWidget *table) */ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) { - + qCDebug(vDialog)<<"Increment changed."; const QTableWidgetItem *itemName = ui->tableWidgetIncrement->item(row, 0); const QTableWidgetItem *item = ui->tableWidgetIncrement->item(row, column); const quint32 id = qvariant_cast(itemName->data(Qt::UserRole)); QDomElement domElement = doc->elementById(QString().setNum(id)); if (domElement.isElement() == false) { - qDebug()<<"Cant't find increment with id = "<text(); doc->SetAttribute(domElement, VPattern::IncrementName, item->text()); data->ClearVariables(VarType::Increment); this->column = 2; emit FullUpdateTree(Document::LiteParse); break; case 2: // VPattern::IncrementBase + qCDebug(vDialog)<<"Changed base to"<text(); doc->SetAttribute(domElement, VPattern::IncrementBase, item->text()); this->column = 3; emit FullUpdateTree(Document::LiteParse); break; case 3: // VPattern::IncrementKsize + qCDebug(vDialog)<<"Changed ksize to"<text(); doc->SetAttribute(domElement, VPattern::IncrementKsize, item->text()); this->column = 4; emit FullUpdateTree(Document::LiteParse); break; case 4: // VPattern::IncrementKgrowth + qCDebug(vDialog)<<"Changed kheight to"<text(); doc->SetAttribute(domElement, VPattern::IncrementKgrowth, item->text()); this->column = 5; emit FullUpdateTree(Document::LiteParse); break; case 5: // VPattern::IncrementDescription { + qCDebug(vDialog)<<"Changed description to"<text(); doc->SetAttribute(domElement, VPattern::IncrementDescription, item->text()); QSharedPointer incr = data->GetVariable(itemName->text()); incr->SetDescription(item->text()); @@ -786,6 +802,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column ) //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) { + qCDebug(vDialog)<<"Measurement changed."; switch (column) { case 2:// value column @@ -799,7 +816,7 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column) QDomElement domElement = list.at(0).toElement(); if (domElement.isElement() == false) { - qDebug()<<"Can't find measurement "<SetBase(0); item->setText("0"); - qDebug()<<"Can't convert toDouble measurement value"<SetBase(base); } + qCDebug(vDialog)<<"Changed value to"<patternUnit(), m->MUnit()); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index ef3d57c4a..ce3216f85 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -49,6 +49,8 @@ #include #include +Q_LOGGING_CATEGORY(vDialog, "v.dialog") + #define DIALOG_MAX_FORMULA_HEIGHT 64 //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 32e76d892..7bb48c2e3 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -37,6 +37,9 @@ #include "../../core/vapplication.h" #include #include +#include + +Q_DECLARE_LOGGING_CATEGORY(vDialog) class QDoubleSpinBox; class QLabel; diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 239b2709f..1d7f20c0b 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -752,7 +752,7 @@ void VPattern::LiteParseTree(const Document &parse) Parse(parse); break; case Document::FullParse: - qWarning()<<"Lite parsing doesn't support full parsing"; + qCWarning(vXML)<<"Lite parsing doesn't support full parsing"; break; default: break;