Merged dismine/valentina into develop
--HG-- branch : develop
This commit is contained in:
commit
1f0027fd22
|
@ -529,7 +529,6 @@ GCC_DEBUG_CXXFLAGS += \
|
|||
-O0 \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-pedantic \
|
||||
-fno-omit-frame-pointer # Need for exchndl.dll
|
||||
|
||||
CLANG_DEBUG_CXXFLAGS += \
|
||||
|
|
|
@ -37,4 +37,5 @@ TRANSLATIONS += translations/valentina.ts \
|
|||
translations/valentina_fr_FR.ts \
|
||||
translations/valentina_it_IT.ts \
|
||||
translations/valentina_nl_NL.ts \
|
||||
translations/valentina_id_ID.ts
|
||||
translations/valentina_id_ID.ts \
|
||||
translations/valentina_es_ES.ts
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
6639
share/translations/valentina_es_ES.ts
Normal file
6639
share/translations/valentina_es_ES.ts
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -181,7 +181,8 @@ INSTALL_TRANSLATIONS += \
|
|||
$${TRANSLATIONS_PATH}/valentina_fr_FR.qm \
|
||||
$${TRANSLATIONS_PATH}/valentina_it_IT.qm \
|
||||
$${TRANSLATIONS_PATH}/valentina_nl_NL.qm \
|
||||
$${TRANSLATIONS_PATH}/valentina_id_ID.qm
|
||||
$${TRANSLATIONS_PATH}/valentina_id_ID.qm \
|
||||
$${TRANSLATIONS_PATH}/valentina_es_ES.qm
|
||||
|
||||
# Set "make install" command for Unix-like systems.
|
||||
unix{
|
||||
|
@ -306,6 +307,14 @@ unix{
|
|||
QMAKE_BUNDLE_DATA += TRANSLATION_id_ID
|
||||
}
|
||||
|
||||
exists($${TRANSLATIONS_PATH}/valentina_es_ES.qm){
|
||||
TRANSLATION_es_ES.files += \
|
||||
$${TRANSLATIONS_PATH}/valentina_es_ES.qm \
|
||||
$${TRANSLATIONS_PATH}/Localizable.strings
|
||||
TRANSLATION_es_ES.path = "$$RESOURCES_DIR/translations/es_ES.lproj"
|
||||
QMAKE_BUNDLE_DATA += TRANSLATION_es_ES
|
||||
}
|
||||
|
||||
# Symlinks also good names for copying. Make will take origin file and copy them with using symlink name.
|
||||
# For bundle this names more then enough. We don't need care much about libraries versions.
|
||||
libraries.path = $$FRAMEWORKS_DIR
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>583</width>
|
||||
<height>480</height>
|
||||
<height>524</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -22,13 +22,13 @@
|
|||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>573</width>
|
||||
<height>480</height>
|
||||
<height>524</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>583</width>
|
||||
<height>480</height>
|
||||
<height>524</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
|
|
|
@ -100,6 +100,30 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
ui->toolBoxMeasurements->setItemEnabled(0, false);
|
||||
|
||||
const QString filePath = doc->MPath();
|
||||
VStandardMeasurements *mSt = nullptr;
|
||||
try
|
||||
{
|
||||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath);
|
||||
mSt = new VStandardMeasurements(data);
|
||||
mSt->setXMLContent(filePath);
|
||||
|
||||
ui->labelBaseValues->setText(tr("Base size: %1 %3; Base height: %2 %3").arg(mSt->Size())
|
||||
.arg(mSt->Height()).arg(VDomDocument::UnitsToStr(qApp->patternUnit())));
|
||||
ui->labelDescription->setText(tr("Description: \"%1\"").arg(mSt->TrDescription()));
|
||||
delete mSt;
|
||||
}
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
if (mSt != nullptr)
|
||||
{
|
||||
delete mSt;
|
||||
}
|
||||
emit DialogClosed(QDialog::Rejected);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -133,6 +157,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
connect(ui->comboBoxSex, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
&DialogIncrements::SaveSex);
|
||||
connect(ui->dateEditBirthDate, &QDateEdit::dateChanged, this, &DialogIncrements::SaveBirthDate);
|
||||
|
||||
// hide fileds that don't exist in individual measurements
|
||||
ui->labelBaseValues->setVisible(false);
|
||||
ui->labelDescription->setVisible(false);
|
||||
}
|
||||
|
||||
ui->toolBoxMeasurements->setCurrentIndex(1);
|
||||
|
|
|
@ -118,8 +118,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>559</width>
|
||||
<height>82</height>
|
||||
<width>939</width>
|
||||
<height>411</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="icon">
|
||||
|
@ -290,6 +290,23 @@
|
|||
<string>Measurements</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelBaseValues">
|
||||
<property name="text">
|
||||
<string notr="true">Base size: ; base height: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelDescription">
|
||||
<property name="text">
|
||||
<string notr="true">Description:</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxHideEmpty">
|
||||
<property name="text">
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="labelSizeDescription">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
<string notr="true">TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -144,7 +144,7 @@
|
|||
<item>
|
||||
<widget class="QToolButton" name="toolButtonPortrate">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../share/resources/icon.qrc">
|
||||
|
@ -167,7 +167,7 @@
|
|||
<item>
|
||||
<widget class="QToolButton" name="toolButtonLandscape">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string notr="true">...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../share/resources/icon.qrc">
|
||||
|
@ -511,7 +511,7 @@
|
|||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroupPrinciple"/>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
<buttongroup name="buttonGroupPrinciple"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
|
@ -183,16 +183,11 @@ void DialogStandardMeasurements::LoadStandardTables()
|
|||
}
|
||||
else
|
||||
{
|
||||
const QString trDesc = qApp->STDescription(m.Id());
|
||||
if (trDesc.isEmpty() == false)
|
||||
const QString desc = m.TrDescription();
|
||||
if (desc.isEmpty() == false)
|
||||
{
|
||||
qCDebug(vStMeasur)<<"Adding user table from"<<fi.absoluteFilePath();
|
||||
ui->comboBoxTables->addItem(trDesc, QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
else if (m.Description().isEmpty() == false)
|
||||
{
|
||||
qCDebug(vStMeasur)<<"Adding table with id"<<m.Id()<<"from"<<fi.absoluteFilePath();
|
||||
ui->comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath()));
|
||||
qCDebug(vStMeasur)<<"Adding table from"<<fi.absoluteFilePath();
|
||||
ui->comboBoxTables->addItem(desc, QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -340,11 +340,12 @@ void DialogDetail::ClickedReverse(bool checked)
|
|||
*/
|
||||
void DialogDetail::ObjectChanged(int row)
|
||||
{
|
||||
if (ui.listWidget->count() == 0 || row == -1)
|
||||
if (ui.listWidget->count() == 0 || row == -1 || row >= ui.listWidget->count())
|
||||
{
|
||||
return;
|
||||
}
|
||||
const QListWidgetItem *item = ui.listWidget->item( row );
|
||||
SCASSERT(item != nullptr);
|
||||
const VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
||||
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||
|
|
|
@ -861,12 +861,12 @@ void MainWindow::ToolBarOption()
|
|||
const QStringList listSizes = VMeasurement::ListSizes(doc->GetGradationSizes());
|
||||
|
||||
gradationHeights = SetGradationList(tr("Height: "), listHeights);
|
||||
SetDefaultHeight(static_cast<int>(GHeights::H176));
|
||||
SetDefaultHeight(static_cast<int>(pattern->height()));
|
||||
connect(gradationHeights, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||
this, &MainWindow::ChangedHeight);
|
||||
|
||||
gradationSizes = SetGradationList(tr("Size: "), listSizes);
|
||||
SetDefaultSize(static_cast<int>(GSizes::S50));
|
||||
SetDefaultSize(static_cast<int>(pattern->size()));
|
||||
connect(gradationSizes, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
||||
this, &MainWindow::ChangedSize);
|
||||
|
||||
|
@ -890,12 +890,13 @@ QComboBox *MainWindow::SetGradationList(const QString &label, const QStringList
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief SetDefaultHeight set base height in combobox.
|
||||
* @param value [in] height value in pattern units.
|
||||
*/
|
||||
void MainWindow::SetDefaultHeight(int value)
|
||||
{
|
||||
qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit());
|
||||
QString strVal = QString("%1").arg(val);
|
||||
|
||||
qint32 index = gradationHeights->findText(strVal);
|
||||
const qint32 index = gradationHeights->findText(QString("%1").arg(value));
|
||||
if (index != -1)
|
||||
{
|
||||
gradationHeights->setCurrentIndex(index);
|
||||
|
@ -907,12 +908,13 @@ void MainWindow::SetDefaultHeight(int value)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief SetDefaultSize set base size in combobox.
|
||||
* @param value [in] size value in pattern units.
|
||||
*/
|
||||
void MainWindow::SetDefaultSize(int value)
|
||||
{
|
||||
qreal val = VAbstractMeasurements::UnitConvertor(value, Unit::Cm, qApp->patternUnit());
|
||||
QString strVal = QString("%1").arg(val);
|
||||
|
||||
qint32 index = gradationSizes->findText(strVal);
|
||||
const qint32 index = gradationSizes->findText(QString("%1").arg(value));
|
||||
if (index != -1)
|
||||
{
|
||||
gradationSizes->setCurrentIndex(index);
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>105</width>
|
||||
<height>262</height>
|
||||
<height>272</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -335,7 +335,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>105</width>
|
||||
<height>56</height>
|
||||
<height>58</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -411,7 +411,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>105</width>
|
||||
<height>150</height>
|
||||
<height>156</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -565,7 +565,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>105</width>
|
||||
<height>100</height>
|
||||
<height>104</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -667,7 +667,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>105</width>
|
||||
<height>56</height>
|
||||
<height>58</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -763,7 +763,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1100</width>
|
||||
<height>21</height>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
|
|
@ -10,5 +10,6 @@
|
|||
<file>flags/Russia.png</file>
|
||||
<file>flags/Ukraine.png</file>
|
||||
<file>flags/UnitedStates.png</file>
|
||||
<file>flags/Spain.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
src/app/share/resources/flags/Spain.png
Normal file
BIN
src/app/share/resources/flags/Spain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 312 B |
|
@ -119,6 +119,9 @@ VAbstractTool::~VAbstractTool()
|
|||
*/
|
||||
void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view)
|
||||
{
|
||||
SCASSERT(sc != nullptr);
|
||||
SCASSERT(view != nullptr);
|
||||
|
||||
QRectF rect = sc->itemsBoundingRect();
|
||||
|
||||
QRect rec0 = view->rect();
|
||||
|
|
|
@ -34,8 +34,10 @@ const QString VStandardMeasurements::TagDescription = QStringLiteral("descr
|
|||
const QString VStandardMeasurements::TagId = QStringLiteral("id");
|
||||
const QString VStandardMeasurements::TagSize = QStringLiteral("size");
|
||||
const QString VStandardMeasurements::TagHeight = QStringLiteral("height");
|
||||
|
||||
const QString VStandardMeasurements::AttrSize_increase = QStringLiteral("size_increase");
|
||||
const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("height_increase");
|
||||
const QString VStandardMeasurements::AttrBase = QStringLiteral("base");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VStandardMeasurements::VStandardMeasurements(VContainer *data)
|
||||
|
@ -49,7 +51,7 @@ VStandardMeasurements::~VStandardMeasurements()
|
|||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VStandardMeasurements::Description()
|
||||
QString VStandardMeasurements::OrigDescription ()
|
||||
{
|
||||
const QString desc = UniqueTagText(TagDescription, "");
|
||||
if (desc.isEmpty())
|
||||
|
@ -59,6 +61,20 @@ QString VStandardMeasurements::Description()
|
|||
return desc;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VStandardMeasurements::TrDescription()
|
||||
{
|
||||
const QString trDesc = qApp->STDescription(Id());
|
||||
if (trDesc.isEmpty() == false)
|
||||
{
|
||||
return trDesc;
|
||||
}
|
||||
else
|
||||
{
|
||||
return OrigDescription ();
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VStandardMeasurements::Id()
|
||||
{
|
||||
|
@ -70,6 +86,18 @@ QString VStandardMeasurements::Id()
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VStandardMeasurements::Size() const
|
||||
{
|
||||
return TakeParametr(TagSize, AttrBase, 50);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VStandardMeasurements::Height() const
|
||||
{
|
||||
return TakeParametr(TagHeight, AttrBase, 176);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag)
|
||||
{
|
||||
|
@ -93,7 +121,7 @@ void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const
|
|||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) const
|
||||
qreal VStandardMeasurements::TakeParametr(const QString &tag, const QString &attr, qreal defValue) const
|
||||
{
|
||||
const qreal defVal = UnitConvertor(defValue, Unit::Cm, qApp->patternUnit());
|
||||
|
||||
|
@ -110,7 +138,7 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co
|
|||
const QDomElement domElement = domNode.toElement();
|
||||
if (domElement.isNull() == false)
|
||||
{
|
||||
qreal value = GetParametrDouble(domElement, AttrValue, QString("%1").arg(defVal));
|
||||
qreal value = GetParametrDouble(domElement, attr, QString("%1").arg(defVal));
|
||||
value = UnitConvertor(value, MUnit(), qApp->patternUnit());
|
||||
return value;
|
||||
}
|
||||
|
@ -122,15 +150,13 @@ qreal VStandardMeasurements::TakeParametr(const QString &tag, qreal defValue) co
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::SetSize()
|
||||
{
|
||||
const qreal value = TakeParametr(TagSize, 50);
|
||||
data->SetSize(value);
|
||||
data->SetSize(Size());
|
||||
data->SetSizeName(size_M);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::SetHeight()
|
||||
{
|
||||
const qreal value = TakeParametr(TagHeight, 176);
|
||||
data->SetHeight(value);
|
||||
data->SetHeight(Height());
|
||||
data->SetHeightName(height_M);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,13 @@ class VStandardMeasurements:public VAbstractMeasurements
|
|||
public:
|
||||
VStandardMeasurements(VContainer *data);
|
||||
virtual ~VStandardMeasurements();
|
||||
QString Description();
|
||||
QString OrigDescription ();
|
||||
QString TrDescription ();
|
||||
QString Id();
|
||||
|
||||
qreal Size() const;
|
||||
qreal Height() const;
|
||||
|
||||
void SetSize();
|
||||
void SetHeight();
|
||||
static const QString TagMeasurement;
|
||||
|
@ -53,13 +58,15 @@ public:
|
|||
static const QString TagId;
|
||||
static const QString TagSize;
|
||||
static const QString TagHeight;
|
||||
|
||||
static const QString AttrSize_increase;
|
||||
static const QString AttrHeight_increase;
|
||||
static const QString AttrBase;
|
||||
protected:
|
||||
virtual void ReadMeasurement(const QDomElement &domElement, const QString &tag);
|
||||
private:
|
||||
Q_DISABLE_COPY(VStandardMeasurements)
|
||||
qreal TakeParametr(const QString &tag, qreal defValue) const;
|
||||
qreal TakeParametr(const QString &tag, const QString &attr, qreal defValue) const;
|
||||
};
|
||||
|
||||
#endif // VSTANDARDMEASUREMENTS_H
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<xs:element name="height">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="base" type="xs:double"></xs:attribute>
|
||||
<xs:attribute name="name" type="xs:string"></xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="body-measurements">
|
||||
|
|
Loading…
Reference in New Issue
Block a user