Merged develop into feature

--HG--
branch : feature
This commit is contained in:
Ronan Le Tiec 2016-10-22 10:42:27 +02:00
commit 8da35622d1
22 changed files with 55 additions and 52 deletions

View File

@ -33,7 +33,7 @@ CDEPEND="
dev-qt/qtprintsupport:5 dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5 dev-qt/qtnetwork:5
app-text/poppler" app-text/poppler"
RDEPEND="${CDEPEND} RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND} DEPEND="${CDEPEND}
app-arch/unzip" app-arch/unzip"

View File

@ -35,7 +35,7 @@ CDEPEND="
dev-qt/qtprintsupport:5 dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5 dev-qt/qtnetwork:5
app-text/poppler" app-text/poppler"
RDEPEND="${CDEPEND} RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND} DEPEND="${CDEPEND}
dev-util/ccache" dev-util/ccache"

View File

@ -168,7 +168,7 @@ void DialogMDataBase::RetranslateGroups()
QString DialogMDataBase::ImgTag(const QString &number) QString DialogMDataBase::ImgTag(const QString &number)
{ {
QString imgUrl("<img src=\"wrong.png\" align=\"center\"/>"); // In case of error QString imgUrl("<img src=\"wrong.png\" align=\"center\"/>"); // In case of error
const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(number)); const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(qApp->TrVars(), number));
if (QFileInfo(filePath).exists()) if (QFileInfo(filePath).exists())
{ {
// Load your SVG // Load your SVG

View File

@ -1147,20 +1147,22 @@ QStringList ListPMSystems()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QStringList ListNumbers(const QStringList &listMeasurements) QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements)
{ {
SCASSERT(trM != nullptr);
QStringList numbers; QStringList numbers;
for (int i=0; i < listMeasurements.size(); ++i) for (int i=0; i < listMeasurements.size(); ++i)
{ {
numbers.append(qApp->TrVars()->MNumber(listMeasurements.at(i))); numbers.append(trM->MNumber(listMeasurements.at(i)));
} }
return numbers; return numbers;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString MapDiagrams(const QString &number) QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number)
{ {
switch (ListNumbers(ListGroupA()).indexOf(number)) switch (ListNumbers(trM, ListGroupA()).indexOf(number))
{ {
// A // A
case 0: // A01 case 0: // A01
@ -1213,7 +1215,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupB()).indexOf(number)) switch (ListNumbers(trM, ListGroupB()).indexOf(number))
{ {
// B // B
case 0: // B01 case 0: // B01
@ -1230,7 +1232,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupC()).indexOf(number)) switch (ListNumbers(trM, ListGroupC()).indexOf(number))
{ {
// C // C
case 0: // C01 case 0: // C01
@ -1243,7 +1245,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupD()).indexOf(number)) switch (ListNumbers(trM, ListGroupD()).indexOf(number))
{ {
// D // D
case 0: // D01 case 0: // D01
@ -1260,7 +1262,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupE()).indexOf(number)) switch (ListNumbers(trM, ListGroupE()).indexOf(number))
{ {
// E // E
case 0: // E01 case 0: // E01
@ -1275,7 +1277,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupF()).indexOf(number)) switch (ListNumbers(trM, ListGroupF()).indexOf(number))
{ {
// F // F
case 0: // F01 case 0: // F01
@ -1294,7 +1296,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupG()).indexOf(number)) switch (ListNumbers(trM, ListGroupG()).indexOf(number))
{ {
// G // G
case 0: // G01 case 0: // G01
@ -1393,7 +1395,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupH()).indexOf(number)) switch (ListNumbers(trM, ListGroupH()).indexOf(number))
{ {
// H // H
case 0: // H01 case 0: // H01
@ -1484,7 +1486,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupI()).indexOf(number)) switch (ListNumbers(trM, ListGroupI()).indexOf(number))
{ {
// I // I
case 0: // I01 case 0: // I01
@ -1519,7 +1521,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupJ()).indexOf(number)) switch (ListNumbers(trM, ListGroupJ()).indexOf(number))
{ {
// J // J
case 0: // J01 case 0: // J01
@ -1546,7 +1548,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupK()).indexOf(number)) switch (ListNumbers(trM, ListGroupK()).indexOf(number))
{ {
// K // K
case 0: // K01 case 0: // K01
@ -1579,7 +1581,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupL()).indexOf(number)) switch (ListNumbers(trM, ListGroupL()).indexOf(number))
{ {
// L // L
case 0: // L01 case 0: // L01
@ -1630,7 +1632,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupM()).indexOf(number)) switch (ListNumbers(trM, ListGroupM()).indexOf(number))
{ {
// M // M
case 0: // M01 case 0: // M01
@ -1665,7 +1667,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupN()).indexOf(number)) switch (ListNumbers(trM, ListGroupN()).indexOf(number))
{ {
// N // N
case 0: // N01 case 0: // N01
@ -1688,7 +1690,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupO()).indexOf(number)) switch (ListNumbers(trM, ListGroupO()).indexOf(number))
{ {
// O // O
case 0: // O01 case 0: // O01
@ -1723,7 +1725,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupP()).indexOf(number)) switch (ListNumbers(trM, ListGroupP()).indexOf(number))
{ {
// P // P
case 0: // P01 case 0: // P01
@ -1754,7 +1756,7 @@ QString MapDiagrams(const QString &number)
break; break;
} }
switch (ListNumbers(ListGroupQ()).indexOf(number)) switch (ListNumbers(trM, ListGroupQ()).indexOf(number))
{ {
// Q // Q
case 0: // Q01 case 0: // Q01

View File

@ -51,6 +51,7 @@ template <class T> class QSharedPointer;
class QComboBox; class QComboBox;
class QMarginsF; class QMarginsF;
class VTranslateMeasurements;
#define SceneSize 50000 #define SceneSize 50000
#define DefPointRadius 1.5//mm #define DefPointRadius 1.5//mm
@ -499,8 +500,8 @@ QStringList ListGroupO();
QStringList ListGroupP(); QStringList ListGroupP();
QStringList ListGroupQ(); QStringList ListGroupQ();
QStringList ListNumbers(const QStringList & listMeasurements); QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList & listMeasurements);
QString MapDiagrams(const QString &number); QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number);
// pattern making systems codes // pattern making systems codes
extern const QString p0_S; extern const QString p0_S;

View File

@ -332,7 +332,7 @@ void DialogAlongLine::SetTypeLine(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogAlongLine::GetLineColor() const QString DialogAlongLine::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -359,7 +359,7 @@ void DialogAlongLine::SetPointName(const QString &value)
*/ */
QString DialogAlongLine::GetTypeLine() const QString DialogAlongLine::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogArc::SetF2(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogArc::GetColor() const QString DialogArc::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -192,7 +192,7 @@ void DialogArcWithLength::SetLength(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetColor() const QString DialogArcWithLength::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -313,7 +313,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogBisector::GetLineColor() const QString DialogBisector::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -355,7 +355,7 @@ void DialogBisector::closeEvent(QCloseEvent *event)
*/ */
QString DialogBisector::GetTypeLine() const QString DialogBisector::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezier::GetColor() const QString DialogCubicBezier::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -117,7 +117,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezierPath::GetColor() const QString DialogCubicBezierPath::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -108,7 +108,7 @@ void DialogCurveIntersectAxis::SetPointName(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetTypeLine() const QString DialogCurveIntersectAxis::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -178,7 +178,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetLineColor() const QString DialogCurveIntersectAxis::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -281,7 +281,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogEndLine::GetLineColor() const QString DialogEndLine::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -375,7 +375,7 @@ DialogEndLine::~DialogEndLine()
*/ */
QString DialogEndLine::GetTypeLine() const QString DialogEndLine::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogHeight::GetLineColor() const QString DialogHeight::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -295,7 +295,7 @@ void DialogHeight::ShowVisualization()
*/ */
QString DialogHeight::GetTypeLine() const QString DialogHeight::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogLine::SetTypeLine(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogLine::GetLineColor() const QString DialogLine::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -247,5 +247,5 @@ quint32 DialogLine::GetSecondPoint() const
*/ */
QString DialogLine::GetTypeLine() const QString DialogLine::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }

View File

@ -121,7 +121,7 @@ void DialogLineIntersectAxis::SetPointName(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetTypeLine() const QString DialogLineIntersectAxis::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -207,7 +207,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetLineColor() const QString DialogLineIntersectAxis::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -242,7 +242,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogNormal::GetLineColor() const QString DialogNormal::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -331,7 +331,7 @@ void DialogNormal::SetPointName(const QString &value)
*/ */
QString DialogNormal::GetTypeLine() const QString DialogNormal::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -267,7 +267,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogShoulderPoint::GetLineColor() const QString DialogShoulderPoint::GetLineColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineColor); return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -354,7 +354,7 @@ void DialogShoulderPoint::SetPointName(const QString &value)
*/ */
QString DialogShoulderPoint::GetTypeLine() const QString DialogShoulderPoint::GetTypeLine() const
{ {
return GetComboBoxCurrentData(ui->comboBoxLineType); return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -614,7 +614,7 @@ void DialogSpline::SetSpline(const VSpline &spline)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogSpline::GetColor() const QString DialogSpline::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -172,7 +172,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogSplinePath::GetColor() const QString DialogSplinePath::GetColor() const
{ {
return GetComboBoxCurrentData(ui->comboBoxColor); return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -302,7 +302,7 @@ void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const QString DialogTool::GetComboBoxCurrentData(const QComboBox *box, const QString &def) const
{ {
SCASSERT(box != nullptr) SCASSERT(box != nullptr)
QString value; QString value;
@ -313,7 +313,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
#endif #endif
if (value.isEmpty()) if (value.isEmpty())
{ {
value = TypeLineLine; value = def;
} }
return value; return value;
} }

View File

@ -224,7 +224,7 @@ protected:
void FillComboBoxHCrossCurvesPoint(QComboBox *box) const; void FillComboBoxHCrossCurvesPoint(QComboBox *box) const;
virtual void CheckState(); virtual void CheckState();
QString GetComboBoxCurrentData(const QComboBox *box)const; QString GetComboBoxCurrentData(const QComboBox *box, const QString &def)const;
void ChangeCurrentData(QComboBox *box, const QVariant &value) const; void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString()); void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString());
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer, void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer,