Fixed issue #841. Variables Table won't open again when closed with Esc.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-23 10:13:19 +03:00
parent 58a2f42703
commit fd446a7c1f
10 changed files with 14 additions and 38 deletions

View File

@ -86,7 +86,7 @@ void DialogHistory::DialogAccepted()
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, false);
emit DialogClosed(QDialog::Accepted);
accept();
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -1321,7 +1321,7 @@ void DialogIncrements::closeEvent(QCloseEvent *event)
ui->plainTextEditDescription->blockSignals(true);
emit UpdateProperties();
emit DialogClosed(QDialog::Accepted);
accept();
event->accept();
}

View File

@ -661,7 +661,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject);
connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject);
connect(dialogTool.data(), &DialogTool::DialogClosed, this, closeDialogSlot);
connect(dialogTool.data(), &DialogTool::finished, this, closeDialogSlot);
connect(dialogTool.data(), &DialogTool::ToolTip, this, &MainWindow::ShowToolTip);
emit ui->view->itemClicked(nullptr);
}
@ -4205,7 +4205,7 @@ void MainWindow::CreateActions()
dialogHistory = new DialogHistory(pattern, doc, this);
dialogHistory->setWindowFlags(Qt::Window);
connect(this, &MainWindow::RefreshHistory, dialogHistory.data(), &DialogHistory::UpdateHistory);
connect(dialogHistory.data(), &DialogHistory::DialogClosed, this, [this]()
connect(dialogHistory.data(), &DialogHistory::finished, this, [this]()
{
ui->actionHistory->setChecked(false);
delete dialogHistory;
@ -4253,7 +4253,7 @@ void MainWindow::CreateActions()
dialogTable = new DialogIncrements(pattern, doc, this);
connect(dialogTable.data(), &DialogIncrements::UpdateProperties, toolOptions,
&VToolOptionsPropertyBrowser::RefreshOptions);
connect(dialogTable.data(), &DialogIncrements::DialogClosed, this, [this]()
connect(dialogTable.data(), &DialogIncrements::finished, this, [this]()
{
ui->actionTable->setChecked(false);
delete dialogTable;

View File

@ -133,15 +133,7 @@ DialogEditWrongFormula::~DialogEditWrongFormula()
void DialogEditWrongFormula::DialogAccepted()
{
formula = ui->plainTextEditFormula->toPlainText();
emit DialogClosed(QDialog::Accepted);
emit accepted();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::DialogRejected()
{
emit DialogClosed(QDialog::Rejected);
emit rejected();
accept();
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -72,7 +72,6 @@ public:
void SetPreviewCalculationsMode();
public slots:
virtual void DialogAccepted() Q_DECL_OVERRIDE;
virtual void DialogRejected() Q_DECL_OVERRIDE;
virtual void EvalFormula() Q_DECL_OVERRIDE;
void ValChanged(int row);
void PutHere();

View File

@ -183,7 +183,7 @@ DialogTool::~DialogTool()
*/
void DialogTool::closeEvent(QCloseEvent *event)
{
DialogRejected();
reject();
event->accept();
}
@ -1181,7 +1181,7 @@ void DialogTool::ChangeColor(QWidget *widget, const QColor &color)
void DialogTool::DialogAccepted()
{
SaveData();
emit DialogClosed(QDialog::Accepted);
accept();
}
//---------------------------------------------------------------------------------------------------------------------
@ -1191,15 +1191,6 @@ void DialogTool::DialogApply()
emit DialogApplied();
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief DialogRejected emit signal dialog rejected
*/
void DialogTool::DialogRejected()
{
emit DialogClosed(QDialog::Rejected);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief formula check formula

View File

@ -97,11 +97,6 @@ public:
static void MoveListRowDown(QListWidget *list);
static void MoveListRowBottom(QListWidget *list);
signals:
/**
* @brief DialogClosed signal dialog closed
* @param result keep result
*/
void DialogClosed(int result);
/**
* @brief DialogApplied emit signal dialog apply changes
*/
@ -120,7 +115,6 @@ public slots:
* @brief DialogApply save data and emit signal DialogApplied.
*/
virtual void DialogApply();
virtual void DialogRejected();
void FormulaChanged();
/**
* @brief FormulaChangedPlainText check formula (plain text editor editor)
@ -367,7 +361,7 @@ inline void DialogTool::InitOkCancel(T *ui)
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
connect(bCancel, &QPushButton::clicked, this, &DialogTool::reject);
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());
}

View File

@ -713,7 +713,7 @@ void DialogSeamAllowance::ShowCustomSAContextMenu(const QPoint &pos)
dialog->EnbleShowMode(true);
m_dialog = dialog;
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PathDialogClosed);
connect(m_dialog.data(), &DialogTool::finished, this, &DialogSeamAllowance::PathDialogClosed);
m_dialog->show();
}
}
@ -749,7 +749,7 @@ void DialogSeamAllowance::ShowInternalPathsContextMenu(const QPoint &pos)
dialog->EnbleShowMode(true);
m_dialog = dialog;
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PathDialogClosed);
connect(m_dialog.data(), &DialogTool::finished, this, &DialogSeamAllowance::PathDialogClosed);
m_dialog->show();
}
}
@ -846,7 +846,7 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
dialog->EnbleShowMode(true);
m_dialog = dialog;
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &DialogSeamAllowance::PlaceLabelDialogClosed);
connect(m_dialog.data(), &DialogTool::finished, this, &DialogSeamAllowance::PlaceLabelDialogClosed);
m_dialog->show();
}
else if (selectedAction == actionSegment)

View File

@ -263,7 +263,7 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
m_dialog = QSharedPointer<Dialog>(new Dialog(getData(), m_id, qApp->getMainWindow()));
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &VDrawTool::FullUpdateFromGuiOk);
connect(m_dialog.data(), &DialogTool::finished, this, &VDrawTool::FullUpdateFromGuiOk);
connect(m_dialog.data(), &DialogTool::DialogApplied, this, &VDrawTool::FullUpdateFromGuiApply);
this->setDialog();

View File

@ -1470,7 +1470,7 @@ void VToolSeamAllowance::ShowOptions()
dialog->EnableApply(true);
m_dialog = dialog;
m_dialog->setModal(true);
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &VToolSeamAllowance::FullUpdateFromGuiOk);
connect(m_dialog.data(), &DialogTool::finished, this, &VToolSeamAllowance::FullUpdateFromGuiOk);
connect(m_dialog.data(), &DialogTool::DialogApplied, this, &VToolSeamAllowance::FullUpdateFromGuiApply);
SetDialog();
m_dialog->show();