Sketcher Elements widget - New feature -

- 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.
This commit is contained in:
Abdullah Tahiri 2014-08-08 16:03:03 +02:00 committed by wmayer
parent b64f283ce8
commit 37d5012647

View File

@ -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;
}