From bae32f74bb986a0a1b81634d26bda69ccfe52800 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Fri, 19 Jun 2015 15:31:17 +0200 Subject: [PATCH] Sketcher: New setting: Show advanced solver taskbox =================================================== I makes the advanced solver taskbox by default disabled (not shown) and provides a setting in Preferences->Display->Sketcher to enable it. --- src/Mod/Sketcher/Gui/SketcherSettings.cpp | 2 + src/Mod/Sketcher/Gui/SketcherSettings.ui | 48 ++++++++++++++++------ src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp | 32 +++++++++------ 3 files changed, 56 insertions(+), 26 deletions(-) diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp index 7d8176d55..050555fa3 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp +++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp @@ -116,6 +116,7 @@ void SketcherSettings::saveSettings() ui->EditSketcherFontSize->onSave(); ui->dialogOnDistanceConstraint->onSave(); ui->continueMode->onSave(); + ui->checkBoxAdvancedSolverTaskBox->onSave(); form->saveSettings(); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part"); @@ -149,6 +150,7 @@ void SketcherSettings::loadSettings() ui->EditSketcherFontSize->onRestore(); ui->dialogOnDistanceConstraint->onRestore(); ui->continueMode->onRestore(); + ui->checkBoxAdvancedSolverTaskBox->onRestore(); form->loadSettings(); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Part"); diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.ui b/src/Mod/Sketcher/Gui/SketcherSettings.ui index c3967d645..5f4449973 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.ui +++ b/src/Mod/Sketcher/Gui/SketcherSettings.ui @@ -7,7 +7,7 @@ 0 0 404 - 680 + 744 @@ -40,7 +40,7 @@ The color of edges being edited - + 255 255 @@ -73,7 +73,7 @@ The color of vertices being edited - + 255 255 @@ -106,7 +106,7 @@ The color of edges being edited - + 255 255 @@ -139,7 +139,7 @@ The color of vertices being edited - + 255 38 @@ -172,7 +172,7 @@ The color of fully constrained geometry in edit mode - + 255 38 @@ -192,7 +192,7 @@ The color of construction geometry in edit mode - + 0 0 @@ -225,7 +225,7 @@ The color of external geometry in edit mode - + 204 51 @@ -271,7 +271,7 @@ The color of fully constrained geometry in edit mode - + 0 255 @@ -397,7 +397,7 @@ - + 0 0 @@ -446,7 +446,7 @@ The color of driving constraints in edit mode - + 255 38 @@ -466,7 +466,7 @@ The color of non-driving constrains or dimensions in edit mode - + 0 38 @@ -584,7 +584,29 @@ - + + + + Sketch Solver + + + + + + Show Advanced Solver Control in the Task bar + + + ShowSolverAdvancedWidget + + + Mod/Sketcher + + + + + + + Qt::Vertical diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp index dceb97d5c..d0972fbab 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.cpp @@ -49,22 +49,28 @@ TaskDlgEditSketch::TaskDlgEditSketch(ViewProviderSketch *sketchView) Messages = new TaskSketcherMessages(sketchView); SolverAdvanced = new TaskSketcherSolverAdvanced(sketchView); + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); + Content.push_back(Messages); - Content.push_back(SolverAdvanced); + + if( hGrp->GetBool("ShowSolverAdvancedWidget",false)) { + Content.push_back(SolverAdvanced); + } + Content.push_back(General); Content.push_back(Constraints); Content.push_back(Elements); - ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); - if( !hGrp->GetBool("ShowMessagesWidget",true)) + + if( !hGrp->GetBool("ExpandedMessagesWidget",true)) Messages->hideGroupBox(); - if( !hGrp->GetBool("ShowSolverAdvancedWidget",false)) - SolverAdvanced->hideGroupBox(); - if( !hGrp->GetBool("ShowEditControlWidget",false)) + if( !hGrp->GetBool("ExpandedSolverAdvancedWidget",false)) + SolverAdvanced->hideGroupBox(); + if( !hGrp->GetBool("ExpandedEditControlWidget",false)) General->hideGroupBox(); - if( !hGrp->GetBool("ShowConstraintsWidget",true)) + if( !hGrp->GetBool("ExpandedConstraintsWidget",true)) Constraints->hideGroupBox(); - if( !hGrp->GetBool("ShowElementsWidget",true)) + if( !hGrp->GetBool("ExpandedElementsWidget",true)) Elements->hideGroupBox(); App::Document* document = sketchView->getObject()->getDocument(); @@ -111,11 +117,11 @@ bool TaskDlgEditSketch::accept() bool TaskDlgEditSketch::reject() { ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); - hGrp->SetBool("ShowMessagesWidget",Messages->isGroupVisible()); - hGrp->SetBool("ShowSolverAdvancedWidget",SolverAdvanced->isGroupVisible()); - hGrp->SetBool("ShowEditControlWidget",General->isGroupVisible()); - hGrp->SetBool("ShowConstraintsWidget",Constraints->isGroupVisible()); - hGrp->SetBool("ShowElementsWidget",Elements->isGroupVisible()); + hGrp->SetBool("ExpandedMessagesWidget",Messages->isGroupVisible()); + hGrp->SetBool("ExpandedSolverAdvancedWidget",SolverAdvanced->isGroupVisible()); + hGrp->SetBool("ExpandedEditControlWidget",General->isGroupVisible()); + hGrp->SetBool("ExpandedConstraintsWidget",Constraints->isGroupVisible()); + hGrp->SetBool("ExpandedElementsWidget",Elements->isGroupVisible()); std::string document = getDocumentName(); // needed because resetEdit() deletes this instance Gui::Command::doCommand(Gui::Command::Gui,"Gui.getDocument('%s').resetEdit()", document.c_str());