[PD] fix thread UI bugs

- initialization: if a threaded, the fit must not be enabled
- when changing the profile type setReadOnly for the fit and class according to if threaded or not
- when changing if threaded or not, setReadOnly accordingly for the fit and class
This commit is contained in:
donovaly
2020-10-20 03:07:20 +02:00
committed by wwmayer
parent 2bf4448e09
commit 783f8dc784
2 changed files with 28 additions and 10 deletions

View File

@@ -99,7 +99,11 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole *HoleView, QWidget *pare
++cursor;
}
ui->ThreadClass->setCurrentIndex(pcHole->ThreadClass.getValue());
// Class is only enabled (sensible) if threaded
ui->ThreadClass->setEnabled(pcHole->Threaded.getValue());
ui->ThreadFit->setCurrentIndex(pcHole->ThreadFit.getValue());
// Fit is only enabled (sensible) if not threaded
ui->ThreadFit->setEnabled(!pcHole->Threaded.getValue());
ui->Diameter->setValue(pcHole->Diameter.getValue());
if (pcHole->ThreadDirection.getValue() == 0L)
ui->directionRightHand->setChecked(true);