From 69364be0ee6e2755d4859a33a04b2976e9236256 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 16 Jan 2019 19:22:18 +0200 Subject: [PATCH] When user doesn't change current pattern piece name he must be able to close the dialog by clicking on OK. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index ab82d0aa7..cf36eaf9a 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4432,7 +4432,7 @@ void MainWindow::InitAutoSave() //--------------------------------------------------------------------------------------------------------------------- QString MainWindow::PatternPieceName(const QString &text) { - QInputDialog *dlg = new QInputDialog(this); + QScopedPointer dlg(new QInputDialog(this)); dlg->setInputMode( QInputDialog::TextInput ); dlg->setLabelText(tr("Pattern piece:")); dlg->setTextEchoMode(QLineEdit::Normal); @@ -4444,17 +4444,16 @@ QString MainWindow::PatternPieceName(const QString &text) { const bool bOk = dlg->exec(); nameDraw = dlg->textValue(); - if (bOk == false || nameDraw.isEmpty()) + if (bOk == false || nameDraw.isEmpty() || text == nameDraw) { - delete dlg; return QString(); } + if (comboBoxDraws->findText(nameDraw) == -1) { break;//repeate show dialog } } - delete dlg; return nameDraw; }