From f82364e53b850b6c53604e8b111463fdf7fa7934 Mon Sep 17 00:00:00 2001 From: dismine Date: Fri, 4 Jul 2014 14:55:36 +0300 Subject: [PATCH] Make tool's dialog modal. --HG-- branch : develop --- src/app/dialogs/app/dialogaboutapp.ui | 3 +++ src/app/dialogs/app/dialogindividualmeasurements.ui | 6 ++++++ src/app/dialogs/app/dialogmeasurements.ui | 6 ++++++ src/app/dialogs/app/dialogstandardmeasurements.ui | 6 ++++++ src/app/dialogs/tools/dialogalongline.cpp | 1 + src/app/dialogs/tools/dialogarc.cpp | 1 + src/app/dialogs/tools/dialogbisector.cpp | 1 + src/app/dialogs/tools/dialogcutarc.cpp | 1 + src/app/dialogs/tools/dialogcutspline.cpp | 1 + src/app/dialogs/tools/dialogcutsplinepath.cpp | 1 + src/app/dialogs/tools/dialogeditwrongformula.ui | 6 ++++++ src/app/dialogs/tools/dialogendline.cpp | 1 + src/app/dialogs/tools/dialogheight.cpp | 1 + src/app/dialogs/tools/dialogline.cpp | 2 ++ src/app/dialogs/tools/dialogline.ui | 8 +++++++- src/app/dialogs/tools/dialoglineintersect.cpp | 1 + src/app/dialogs/tools/dialognormal.cpp | 1 + src/app/dialogs/tools/dialogpointofcontact.cpp | 1 + src/app/dialogs/tools/dialogpointofintersection.cpp | 1 + src/app/dialogs/tools/dialogshoulderpoint.cpp | 1 + src/app/dialogs/tools/dialogsinglepoint.ui | 4 ++-- src/app/dialogs/tools/dialogspline.cpp | 1 + src/app/dialogs/tools/dialogtool.cpp | 2 -- src/app/dialogs/tools/dialogtriangle.cpp | 1 + src/app/dialogs/tools/dialoguniondetails.cpp | 1 + src/app/dialogs/tools/dialoguniondetails.ui | 6 ++++++ src/app/tools/drawTools/vdrawtool.h | 1 + src/app/tools/drawTools/vtoolendline.cpp | 1 + src/app/tools/vtooldetail.cpp | 1 + 29 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/app/dialogs/app/dialogaboutapp.ui b/src/app/dialogs/app/dialogaboutapp.ui index 6b9a60126..bf16a0058 100644 --- a/src/app/dialogs/app/dialogaboutapp.ui +++ b/src/app/dialogs/app/dialogaboutapp.ui @@ -2,6 +2,9 @@ DialogAboutApp + + Qt::ApplicationModal + 0 diff --git a/src/app/dialogs/app/dialogindividualmeasurements.ui b/src/app/dialogs/app/dialogindividualmeasurements.ui index d46387a6e..eb5ee557b 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.ui +++ b/src/app/dialogs/app/dialogindividualmeasurements.ui @@ -2,6 +2,9 @@ DialogIndividualMeasurements + + Qt::ApplicationModal + 0 @@ -17,6 +20,9 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + true + diff --git a/src/app/dialogs/app/dialogmeasurements.ui b/src/app/dialogs/app/dialogmeasurements.ui index 8afc1e345..18c069065 100644 --- a/src/app/dialogs/app/dialogmeasurements.ui +++ b/src/app/dialogs/app/dialogmeasurements.ui @@ -2,6 +2,9 @@ DialogMeasurements + + Qt::ApplicationModal + 0 @@ -29,6 +32,9 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + true + diff --git a/src/app/dialogs/app/dialogstandardmeasurements.ui b/src/app/dialogs/app/dialogstandardmeasurements.ui index 5f3166dcc..208adf019 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.ui +++ b/src/app/dialogs/app/dialogstandardmeasurements.ui @@ -2,6 +2,9 @@ DialogStandardMeasurements + + Qt::ApplicationModal + 0 @@ -17,6 +20,9 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + true + diff --git a/src/app/dialogs/tools/dialogalongline.cpp b/src/app/dialogs/tools/dialogalongline.cpp index b7dad8c54..07f174f09 100644 --- a/src/app/dialogs/tools/dialogalongline.cpp +++ b/src/app/dialogs/tools/dialogalongline.cpp @@ -108,6 +108,7 @@ void DialogAlongLine::ChoosedObject(quint32 id, const SceneObject &type) number = 0; if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 77cc8b597..6a0ad3d27 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -184,6 +184,7 @@ void DialogArc::ChoosedObject(quint32 id, const SceneObject &type) ChangeCurrentText(ui->comboBoxBasePoint, point->name()); emit ToolTip(""); + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogbisector.cpp b/src/app/dialogs/tools/dialogbisector.cpp index 3610409fd..8096f54e2 100644 --- a/src/app/dialogs/tools/dialogbisector.cpp +++ b/src/app/dialogs/tools/dialogbisector.cpp @@ -130,6 +130,7 @@ void DialogBisector::ChoosedObject(quint32 id, const SceneObject &type) } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogcutarc.cpp b/src/app/dialogs/tools/dialogcutarc.cpp index b80da3206..fd9075b8f 100644 --- a/src/app/dialogs/tools/dialogcutarc.cpp +++ b/src/app/dialogs/tools/dialogcutarc.cpp @@ -95,6 +95,7 @@ void DialogCutArc::ChoosedObject(quint32 id, const SceneObject &type) const VArc *arc = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxArc, arc->name()); emit ToolTip(""); + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogcutspline.cpp b/src/app/dialogs/tools/dialogcutspline.cpp index bfb5e1fb7..89f02a4d5 100644 --- a/src/app/dialogs/tools/dialogcutspline.cpp +++ b/src/app/dialogs/tools/dialogcutspline.cpp @@ -121,6 +121,7 @@ void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type) const VSpline *spl = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxSpline, spl->name()); emit ToolTip(""); + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogcutsplinepath.cpp b/src/app/dialogs/tools/dialogcutsplinepath.cpp index 769fffe8b..a338a6e9d 100644 --- a/src/app/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/app/dialogs/tools/dialogcutsplinepath.cpp @@ -121,6 +121,7 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type) const VSplinePath *splPath = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxSplinePath, splPath->name()); emit ToolTip(""); + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogeditwrongformula.ui b/src/app/dialogs/tools/dialogeditwrongformula.ui index a66ef8a11..0632e6a36 100644 --- a/src/app/dialogs/tools/dialogeditwrongformula.ui +++ b/src/app/dialogs/tools/dialogeditwrongformula.ui @@ -2,6 +2,9 @@ DialogEditWrongFormula + + Qt::ApplicationModal + 0 @@ -17,6 +20,9 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + true + diff --git a/src/app/dialogs/tools/dialogendline.cpp b/src/app/dialogs/tools/dialogendline.cpp index 5b7770a1c..78cffba34 100644 --- a/src/app/dialogs/tools/dialogendline.cpp +++ b/src/app/dialogs/tools/dialogendline.cpp @@ -91,6 +91,7 @@ void DialogEndLine::ChoosedObject(quint32 id, const SceneObject &type) const VPointF *point = data->GeometricObject(id); ChangeCurrentText(ui->comboBoxBasePoint, point->name()); emit ToolTip(""); + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogheight.cpp b/src/app/dialogs/tools/dialogheight.cpp index 6703d2a25..a7d11d655 100644 --- a/src/app/dialogs/tools/dialogheight.cpp +++ b/src/app/dialogs/tools/dialogheight.cpp @@ -148,6 +148,7 @@ void DialogHeight::ChoosedObject(quint32 id, const SceneObject &type) emit ToolTip(tr("")); if (isInitialized == false) { + this->setModal(true); this->show(); } break; diff --git a/src/app/dialogs/tools/dialogline.cpp b/src/app/dialogs/tools/dialogline.cpp index d62167e77..e21037b07 100644 --- a/src/app/dialogs/tools/dialogline.cpp +++ b/src/app/dialogs/tools/dialogline.cpp @@ -106,6 +106,7 @@ void DialogLine::setFirstPoint(const quint32 &value) */ void DialogLine::DialogAccepted() { + //TODO check if points different qint32 index = ui->comboBoxFirstPoint->currentIndex(); firstPoint = qvariant_cast(ui->comboBoxFirstPoint->itemData(index)); index = ui->comboBoxSecondPoint->currentIndex(); @@ -147,6 +148,7 @@ void DialogLine::ChoosedObject(quint32 id, const SceneObject &type) } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogline.ui b/src/app/dialogs/tools/dialogline.ui index 70511e663..594335056 100644 --- a/src/app/dialogs/tools/dialogline.ui +++ b/src/app/dialogs/tools/dialogline.ui @@ -2,6 +2,9 @@ DialogLine + + Qt::ApplicationModal + 0 @@ -20,7 +23,10 @@ - + + true + + 9 diff --git a/src/app/dialogs/tools/dialoglineintersect.cpp b/src/app/dialogs/tools/dialoglineintersect.cpp index c460e0610..82fe6f5b9 100644 --- a/src/app/dialogs/tools/dialoglineintersect.cpp +++ b/src/app/dialogs/tools/dialoglineintersect.cpp @@ -123,6 +123,7 @@ void DialogLineIntersect::ChoosedObject(quint32 id, const SceneObject &type) { flagPoint = CheckIntersecion(); CheckState(); + this->setModal(true); this->show(); connect(ui->comboBoxP1Line1, static_cast(&QComboBox::currentIndexChanged), this, diff --git a/src/app/dialogs/tools/dialognormal.cpp b/src/app/dialogs/tools/dialognormal.cpp index b306c45a1..8b19d366e 100644 --- a/src/app/dialogs/tools/dialognormal.cpp +++ b/src/app/dialogs/tools/dialognormal.cpp @@ -107,6 +107,7 @@ void DialogNormal::ChoosedObject(quint32 id, const SceneObject &type) number = 0; if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogpointofcontact.cpp b/src/app/dialogs/tools/dialogpointofcontact.cpp index 322471c8f..c232474f9 100644 --- a/src/app/dialogs/tools/dialogpointofcontact.cpp +++ b/src/app/dialogs/tools/dialogpointofcontact.cpp @@ -137,6 +137,7 @@ void DialogPointOfContact::ChoosedObject(quint32 id, const SceneObject &type) } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogpointofintersection.cpp b/src/app/dialogs/tools/dialogpointofintersection.cpp index 9a998063c..a43edc02f 100644 --- a/src/app/dialogs/tools/dialogpointofintersection.cpp +++ b/src/app/dialogs/tools/dialogpointofintersection.cpp @@ -106,6 +106,7 @@ void DialogPointOfIntersection::ChoosedObject(quint32 id, const SceneObject &typ } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogshoulderpoint.cpp b/src/app/dialogs/tools/dialogshoulderpoint.cpp index d88e15e1a..2008fcfa1 100644 --- a/src/app/dialogs/tools/dialogshoulderpoint.cpp +++ b/src/app/dialogs/tools/dialogshoulderpoint.cpp @@ -128,6 +128,7 @@ void DialogShoulderPoint::ChoosedObject(quint32 id, const SceneObject &type) } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogsinglepoint.ui b/src/app/dialogs/tools/dialogsinglepoint.ui index 0b59b2c72..24aa830f2 100644 --- a/src/app/dialogs/tools/dialogsinglepoint.ui +++ b/src/app/dialogs/tools/dialogsinglepoint.ui @@ -3,7 +3,7 @@ DialogSinglePoint - Qt::WindowModal + Qt::ApplicationModal @@ -24,7 +24,7 @@ - false + true diff --git a/src/app/dialogs/tools/dialogspline.cpp b/src/app/dialogs/tools/dialogspline.cpp index 4640380cb..2f4c3d0cc 100644 --- a/src/app/dialogs/tools/dialogspline.cpp +++ b/src/app/dialogs/tools/dialogspline.cpp @@ -106,6 +106,7 @@ void DialogSpline::ChoosedObject(quint32 id, const SceneObject &type) } if (isInitialized == false) { + this->setModal(true); this->show(); } } diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index e6698ea66..0c553aec4 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -72,8 +72,6 @@ DialogTool::DialogTool(const VContainer *data, QWidget *parent) //Keep synchronize with VAbstractTool styles list!!! lineStyles<setModal(true); this->show(); } break; diff --git a/src/app/dialogs/tools/dialoguniondetails.cpp b/src/app/dialogs/tools/dialoguniondetails.cpp index c0f7cfd6d..ed58d8b80 100644 --- a/src/app/dialogs/tools/dialoguniondetails.cpp +++ b/src/app/dialogs/tools/dialoguniondetails.cpp @@ -145,6 +145,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const SceneObject &typ { ++numberP; emit ToolTip(""); + this->setModal(true); this->show(); return; } diff --git a/src/app/dialogs/tools/dialoguniondetails.ui b/src/app/dialogs/tools/dialoguniondetails.ui index b74324eac..b403236b2 100644 --- a/src/app/dialogs/tools/dialoguniondetails.ui +++ b/src/app/dialogs/tools/dialoguniondetails.ui @@ -2,6 +2,9 @@ DialogUnionDetails + + Qt::NonModal + 0 @@ -29,6 +32,9 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png + + false + diff --git a/src/app/tools/drawTools/vdrawtool.h b/src/app/tools/drawTools/vdrawtool.h index 07ef881cb..80afda756 100644 --- a/src/app/tools/drawTools/vdrawtool.h +++ b/src/app/tools/drawTools/vdrawtool.h @@ -121,6 +121,7 @@ protected: QGraphicsScene *scene = tool->scene(); QList list = scene->views(); dialog = new Dialog(getData(), list.first()); + dialog->setModal(true); connect(qobject_cast< VMainGraphicsScene * >(tool->scene()), &VMainGraphicsScene::ChoosedObject, dialog, &DialogTool::ChoosedObject); diff --git a/src/app/tools/drawTools/vtoolendline.cpp b/src/app/tools/drawTools/vtoolendline.cpp index 41867cce0..7d5e060ea 100644 --- a/src/app/tools/drawTools/vtoolendline.cpp +++ b/src/app/tools/drawTools/vtoolendline.cpp @@ -71,6 +71,7 @@ VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, void VToolEndLine::setDialog() { SCASSERT(dialog != nullptr); + dialog->setModal(true); DialogEndLine *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const VPointF *p = VAbstractTool::data.GeometricObject(id); diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index c89b12212..dc0845c97 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -408,6 +408,7 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) QGraphicsScene *scene = this->scene(); QList list = scene->views(); dialog = new DialogDetail(getData(), list.first()); + dialog->setModal(true); connect(qobject_cast< VMainGraphicsScene * >(this->scene()), &VMainGraphicsScene::ChoosedObject, dialog, &DialogTool::ChoosedObject); connect(dialog, &DialogTool::DialogClosed, this, &VToolDetail::FullUpdateFromGuiOk);