| 640 | } |
| 641 | |
| 642 | void ProcessBehaviorChartDock::loadConfig(KConfig& config) { |
| 643 | KConfigGroup group = config.group(QStringLiteral("ProcessBehaviorChart")); |
| 644 | |
| 645 | // type |
| 646 | const auto type = group.readEntry(QStringLiteral("Type"), static_cast<int>(m_plot->type())); |
| 647 | int index = ui.cbType->findData(static_cast<int>(type)); |
| 648 | ui.cbType->setCurrentIndex(index); |
| 649 | typeChanged(index); |
| 650 | |
| 651 | // limits metric |
| 652 | const auto limitsMetric = group.readEntry(QStringLiteral("LimitsMetric"), static_cast<int>(m_plot->limitsMetric())); |
| 653 | index = ui.cbLimitsMetric->findData(static_cast<int>(limitsMetric)); |
| 654 | ui.cbLimitsMetric->setCurrentIndex(index); |
| 655 | |
| 656 | // sample size |
| 657 | const int size = group.readEntry(QStringLiteral("SampleSize"), static_cast<int>(m_plot->sampleSize())); |
| 658 | ui.sbSampleSize->setValue(size); |
| 659 | |
| 660 | // TODO: limit constraints? |
| 661 | |
| 662 | // user exact/individual limits, relevant for P and U charts only |
| 663 | ui.chbExactLimits->setChecked(group.readEntry(QStringLiteral("ExactLimitsEnabled"), false)); |
| 664 | |
| 665 | ui.chbLabelsEnabled->setChecked(group.readEntry(QStringLiteral("LabelsEnabled"), false)); |
| 666 | labelsEnabledChanged(ui.chbLabelsEnabled->isChecked()); |
| 667 | ui.chkLabelsAutoPrecision->setChecked(group.readEntry(QStringLiteral("LabelsAutoPrecision"), (int)m_plot->labelsAutoPrecision())); |
| 668 | ui.sbLabelsPrecision->setValue(group.readEntry(QStringLiteral("LabelsPrecision"), (int)m_plot->labelsPrecision())); |
| 669 | |
| 670 | // properties of the data and limit curves |
| 671 | dataLineWidget->loadConfig(group); |
| 672 | dataSymbolWidget->loadConfig(group); |
| 673 | centerLineWidget->loadConfig(group); |
| 674 | upperLimitLineWidget->loadConfig(group); |
| 675 | if (m_plot->lowerLimitAvailable()) |
| 676 | lowerLimitLineWidget->loadConfig(group); |
| 677 | } |
| 678 | |
| 679 | void ProcessBehaviorChartDock::loadConfigFromTemplate(KConfig& config) { |
| 680 | auto name = TemplateHandler::templateName(config); |
no test coverage detected