From 80a89769ac6ad017fa66f60e2826abe048934ebb Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 16 Dec 2014 14:06:18 +0300 Subject: [PATCH] Issue #252: Disable Ok button while mouse cursor in viewer --- src/PartSet/PartSet_WidgetPoint2d.cpp | 1 + src/PartSet/PartSet_WidgetPoint2dDistance.cpp | 1 + src/XGUI/XGUI_PropertyPanel.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 5f0fc5750..51c3289a5 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -201,6 +201,7 @@ void PartSet_WidgetPoint2D::deactivate() disconnect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*))); myWorkshop->moduleConnector()->deactivateSubShapesSelection(); + myWorkshop->operationMgr()->setLockValidating(false); } bool PartSet_WidgetPoint2D::getPoint2d(const Handle(V3d_View)& theView, diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 9e4826780..b67ca1413 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -76,6 +76,7 @@ void PartSet_WidgetPoint2dDistance::deactivate() this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*))); disconnect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)), this, SLOT(onMouseRelease(ModuleBase_IViewWindow*, QMouseEvent*))); + myWorkshop->operationMgr()->setLockValidating(false); } void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 864dad1fe..c3d200d41 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -199,7 +199,7 @@ void XGUI_PropertyPanel::activateNextWidget() void XGUI_PropertyPanel::setAcceptEnabled(bool isEnabled) { QPushButton* anOkBtn = findChild(PROP_PANEL_OK); - anOkBtn->setEnabled(true);//isEnabled); + anOkBtn->setEnabled(isEnabled); } void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget) @@ -225,7 +225,7 @@ void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget) void XGUI_PropertyPanel::setOkEnabled(bool theEnabled) { QPushButton* anOkBtn = findChild(PROP_PANEL_OK); - anOkBtn->setEnabled(true);//theEnabled); + anOkBtn->setEnabled(theEnabled); } bool XGUI_PropertyPanel::isOkEnabled() const -- 2.39.2