Refactoring.
--HG-- branch : develop
This commit is contained in:
parent
88b8a00a2e
commit
280b7c9584
|
@ -188,13 +188,7 @@ void VToolSinglePoint::DeleteTool(bool ask)
|
|||
{
|
||||
if (ask)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Confirm the deletion."));
|
||||
msgBox.setInformativeText(tr("Do you really want delete?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
if (msgBox.exec() == QMessageBox::Cancel)
|
||||
if (ConfirmDeletion() == QMessageBox::Cancel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -246,13 +246,7 @@ void VAbstractTool::DeleteTool(bool ask)
|
|||
{
|
||||
if (ask)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Confirm the deletion."));
|
||||
msgBox.setInformativeText(tr("Do you really want delete?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
if (msgBox.exec() == QMessageBox::Cancel)
|
||||
if (ConfirmDeletion() == QMessageBox::Cancel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -296,6 +290,18 @@ Qt::PenStyle VAbstractTool::LineStyle()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
int VAbstractTool::ConfirmDeletion()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Confirm the deletion."));
|
||||
msgBox.setInformativeText(tr("Do you really want delete?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
return msgBox.exec();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief LineCoefficients coefficient for equation of segment. Segment equestion ax+by+c=0.
|
||||
|
|
|
@ -148,6 +148,7 @@ protected:
|
|||
virtual void RemoveReferens(){}
|
||||
virtual void DeleteTool(bool ask = true);
|
||||
Qt::PenStyle LineStyle();
|
||||
static int ConfirmDeletion();
|
||||
private:
|
||||
Q_DISABLE_COPY(VAbstractTool)
|
||||
};
|
||||
|
|
|
@ -496,17 +496,11 @@ void VToolDetail::DeleteTool(bool ask)
|
|||
DeleteDetail *delDet = new DeleteDetail(doc, id);
|
||||
if (ask)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Confirm the deletion."));
|
||||
msgBox.setInformativeText(tr("Do you really want delete?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
if (msgBox.exec() == QMessageBox::Cancel)
|
||||
if (ConfirmDeletion() == QMessageBox::Cancel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*Ugly hack. If UnionDetails delete detail no need emit FullParsing */
|
||||
/* If UnionDetails tool delete detail no need emit FullParsing.*/
|
||||
connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VPattern::NeedFullParsing);
|
||||
}
|
||||
qApp->getUndoStack()->push(delDet);
|
||||
|
|
Loading…
Reference in New Issue
Block a user