From 37428a4d82e19ede5e6d2085a6f77ebe4adbc3e3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 12 Aug 2018 10:03:39 +0300 Subject: [PATCH] Warn users about empty piece list when they use one of the tools those require a piece to continue work. --HG-- branch : release --- src/libs/vtools/dialogs/tools/piece/dialoginsertnode.cpp | 6 ++++++ src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp | 6 ++++++ src/libs/vtools/dialogs/tools/piece/dialogpin.cpp | 6 ++++++ src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/libs/vtools/dialogs/tools/piece/dialoginsertnode.cpp b/src/libs/vtools/dialogs/tools/piece/dialoginsertnode.cpp index 35e4f8ad5..ca5328cd2 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialoginsertnode.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialoginsertnode.cpp @@ -59,6 +59,12 @@ DialogInsertNode::~DialogInsertNode() void DialogInsertNode::SetPiecesList(const QVector &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."); + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index 34c52a033..88d882ebf 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -1329,6 +1329,12 @@ QString DialogPiecePath::GetFormulaSAWidth() const void DialogPiecePath::SetPiecesList(const QVector &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."); + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp index 35c445ce5..f5f3ca625 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp @@ -116,6 +116,12 @@ void DialogPin::SetPointId(quint32 id) void DialogPin::SetPiecesList(const QVector &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."); + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp index f0bd3308c..318931283 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp @@ -234,6 +234,12 @@ void DialogPlaceLabel::SetPieceId(quint32 id) void DialogPlaceLabel::SetPiecesList(const QVector &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."); + } } //---------------------------------------------------------------------------------------------------------------------