Warn users about empty piece list when they use one of the tools those require

a piece to continue work.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2018-08-12 10:03:39 +03:00
parent e9afe63c7b
commit 37428a4d82
4 changed files with 24 additions and 0 deletions

View File

@ -59,6 +59,12 @@ DialogInsertNode::~DialogInsertNode()
void DialogInsertNode::SetPiecesList(const QVector<quint32> &list) void DialogInsertNode::SetPiecesList(const QVector<quint32> &list)
{ {
FillComboBoxPiecesList(ui->comboBoxPiece, list); FillComboBoxPiecesList(ui->comboBoxPiece, list);
if (list.isEmpty())
{
qWarning() << tr("The list of pieces is empty. Please, first create at least one piece for current pattern "
"piece.");
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -1329,6 +1329,12 @@ QString DialogPiecePath::GetFormulaSAWidth() const
void DialogPiecePath::SetPiecesList(const QVector<quint32> &list) void DialogPiecePath::SetPiecesList(const QVector<quint32> &list)
{ {
FillComboBoxPiecesList(ui->comboBoxPiece, list); FillComboBoxPiecesList(ui->comboBoxPiece, list);
if (list.isEmpty())
{
qWarning() << tr("The list of pieces is empty. Please, first create at least one piece for current pattern "
"piece.");
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -116,6 +116,12 @@ void DialogPin::SetPointId(quint32 id)
void DialogPin::SetPiecesList(const QVector<quint32> &list) void DialogPin::SetPiecesList(const QVector<quint32> &list)
{ {
FillComboBoxPiecesList(ui->comboBoxPiece, list); FillComboBoxPiecesList(ui->comboBoxPiece, list);
if (list.isEmpty())
{
qWarning() << tr("The list of pieces is empty. Please, first create at least one piece for current pattern "
"piece.");
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -234,6 +234,12 @@ void DialogPlaceLabel::SetPieceId(quint32 id)
void DialogPlaceLabel::SetPiecesList(const QVector<quint32> &list) void DialogPlaceLabel::SetPiecesList(const QVector<quint32> &list)
{ {
FillComboBoxPiecesList(ui->comboBoxPiece, list); FillComboBoxPiecesList(ui->comboBoxPiece, list);
if (list.isEmpty())
{
qWarning() << tr("The list of pieces is empty. Please, first create at least one piece for current pattern "
"piece.");
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------