Skip to content

Commit

Permalink
Sketcher Elements widget - New feature -
Browse files Browse the repository at this point in the history
- Remembers how the user left the "Auto switch to Edge" and the "Extended Name" checkboxes
and restores the values on next use of the Sketcher WB.
  • Loading branch information
abdullahtahiriyo authored and wwmayer committed Aug 8, 2014
1 parent b64f283 commit 37d5012
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Mod/Sketcher/Gui/TaskSketcherElements.cpp
Expand Up @@ -263,14 +263,22 @@ TaskSketcherElements::TaskSketcherElements(ViewProviderSketch *sketchView)

ui->comboBoxElementFilter->setCurrentIndex(0);

ui->namingBox->setCheckState(Qt::Unchecked);
ui->autoSwitchBox->setCheckState(Qt::Checked);

ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/Elements");

ui->autoSwitchBox->setChecked(hGrp->GetBool("Auto-switch to edge", true));
ui->namingBox->setChecked(hGrp->GetBool("Extended Naming", false));

ui->comboBoxElementFilter->setEnabled(!isautoSwitchBoxChecked);

slotElementsChanged();
}

TaskSketcherElements::~TaskSketcherElements()
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher/Elements");
hGrp->SetBool("Auto-switch to edge", ui->autoSwitchBox->isChecked());
hGrp->SetBool("Extended Naming", ui->namingBox->isChecked());

connectionElementsChanged.disconnect();
delete ui;
}
Expand Down

0 comments on commit 37d5012

Please sign in to comment.