SETTINGS
| 388 | //******************** SETTINGS **************************** |
| 389 | //********************************************************** |
| 390 | void BackgroundWidget::load() { |
| 391 | ui.cbType->setCurrentIndex((int)m_background->type()); |
| 392 | ui.cbColorStyle->setCurrentIndex((int)m_background->colorStyle()); |
| 393 | ui.cbImageStyle->setCurrentIndex((int)m_background->imageStyle()); |
| 394 | ui.cbBrushStyle->setCurrentIndex((int)m_background->brushStyle()); |
| 395 | ui.leFileName->setText(m_background->fileName()); |
| 396 | ui.kcbFirstColor->setColor(m_background->firstColor()); |
| 397 | ui.kcbSecondColor->setColor(m_background->secondColor()); |
| 398 | ui.sbOpacity->setValue(std::round(m_background->opacity() * 100)); |
| 399 | |
| 400 | // optional parameters |
| 401 | bool visible = m_background->enabledAvailable(); |
| 402 | ui.lEnabled->setVisible(visible); |
| 403 | ui.chkEnabled->setVisible(visible); |
| 404 | |
| 405 | visible = m_background->positionAvailable(); |
| 406 | ui.lPosition->setVisible(visible); |
| 407 | ui.cbPosition->setVisible(visible); |
| 408 | |
| 409 | if (m_background->enabledAvailable()) |
| 410 | ui.chkEnabled->setChecked(m_background->enabled()); |
| 411 | |
| 412 | if (m_background->enabledAvailable()) |
| 413 | ui.cbPosition->setCurrentIndex((int)m_background->position()); |
| 414 | |
| 415 | // highlight the text field for the background image red if an image is used and cannot be found |
| 416 | const QString& fileName = m_background->fileName(); |
| 417 | bool invalid = (!fileName.isEmpty() && !QFile::exists(fileName)); |
| 418 | GuiTools::highlight(ui.leFileName, invalid); |
| 419 | } |
| 420 | |
| 421 | void BackgroundWidget::loadConfig(const KConfigGroup& group) { |
| 422 | ui.cbType->setCurrentIndex(group.readEntry(m_prefix + QStringLiteral("Type"), (int)m_background->type())); |
nothing calls this directly
no test coverage detected