Added hiding Show measurement option and showing just a filename without path in detail and layout mode. Also fixed a wrong comment

--HG--
branch : feature
This commit is contained in:
BojanKverh 2016-07-24 19:07:38 +02:00
parent a6e38b54d0
commit 85db8f84e6
5 changed files with 15 additions and 5 deletions

View File

@ -173,7 +173,16 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
ui->labelCreationDate->setText(QDate::currentDate().toString(Qt::SystemLocaleLongDate)); ui->labelCreationDate->setText(QDate::currentDate().toString(Qt::SystemLocaleLongDate));
ui->lineEditSize->setText(doc->GetPatternSize()); ui->lineEditSize->setText(doc->GetPatternSize());
ui->checkBoxShowDate->setChecked(doc->IsDateVisible()); ui->checkBoxShowDate->setChecked(doc->IsDateVisible());
ui->checkBoxShowMeasurements->setChecked(doc->IsMeasurementsVisible()); if (doc->MPath().isEmpty() == true)
{
ui->checkBoxShowMeasurements->setChecked(false);
ui->checkBoxShowMeasurements->hide();
}
else
{
ui->checkBoxShowMeasurements->setChecked(doc->IsMeasurementsVisible());
}
connect(ui->lineEditPatternName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged); connect(ui->lineEditPatternName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->lineEditPatternNumber, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged); connect(ui->lineEditPatternNumber, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);

View File

@ -213,7 +213,7 @@ void VPattern::Parse(const Document &parse)
qCDebug(vXML, "Show creation date"); qCDebug(vXML, "Show creation date");
break; break;
case 16: case 16:
qCDebug(vXML, "Show creation measurements"); qCDebug(vXML, "Show measurements");
break; break;
default: default:
qCDebug(vXML, "Wrong tag name %s", qUtf8Printable(domElement.tagName())); qCDebug(vXML, "Wrong tag name %s", qUtf8Printable(domElement.tagName()));

View File

@ -390,7 +390,7 @@
<xs:attribute name="my" type="xs:double"></xs:attribute> <xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="width" type="xs:double"></xs:attribute> <xs:attribute name="width" type="xs:double"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute> <xs:attribute name="name" type="xs:string"></xs:attribute>
<xs:attribute name="closed" type="xs:unsignedInt"></xs:attribute> <xs:attribute name="closed" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inLayout" type="xs:boolean"></xs:attribute> <xs:attribute name="inLayout" type="xs:boolean"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>

View File

@ -1,5 +1,6 @@
#include <QRegularExpression> #include <QRegularExpression>
#include <QFontMetrics> #include <QFontMetrics>
#include <QDir>
#include "vtextmanager.h" #include "vtextmanager.h"
@ -281,7 +282,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc)
AddLine(tl); AddLine(tl);
} }
// Measurements // Measurements
tl.m_qsText = pDoc->MPath(); tl.m_qsText = QDir::toNativeSeparators(pDoc->MPath()).split(QDir::separator()).last();
if (tl.m_qsText.isEmpty() == false && pDoc->IsMeasurementsVisible() == true) if (tl.m_qsText.isEmpty() == false && pDoc->IsMeasurementsVisible() == true)
{ {
tl.m_eFontWeight = QFont::Normal; tl.m_eFontWeight = QFont::Normal;

View File

@ -34,7 +34,7 @@ class VTextManager
{ {
public: public:
VTextManager(); VTextManager();
~VTextManager(); virtual ~VTextManager();
virtual int GetSpacing() const; virtual int GetSpacing() const;
void SetFont(const QFont& font); void SetFont(const QFont& font);