| 1513 | } |
| 1514 | |
| 1515 | void SettingsWindow::updateUiFromSettings() |
| 1516 | { |
| 1517 | DEBUG_LOW_LEVEL << Q_FUNC_INFO; |
| 1518 | |
| 1519 | profilesLoadAll(); |
| 1520 | |
| 1521 | ui->comboBox_Profiles->setCurrentIndex(ui->comboBox_Profiles->findText(Settings::getCurrentProfileName())); |
| 1522 | |
| 1523 | Lightpack::Mode mode = Settings::getLightpackMode(); |
| 1524 | onLightpackModeChanged(mode); |
| 1525 | |
| 1526 | ui->checkBox_ExpertModeEnabled->setChecked (Settings::isExpertModeEnabled()); |
| 1527 | |
| 1528 | ui->checkBox_SendDataOnlyIfColorsChanges->setChecked (Settings::isSendDataOnlyIfColorsChanges()); |
| 1529 | ui->checkBox_KeepLightsOnAfterExit->setChecked (Settings::isKeepLightsOnAfterExit()); |
| 1530 | ui->checkBox_KeepLightsOnAfterLockComputer->setChecked (Settings::isKeepLightsOnAfterLock()); |
| 1531 | ui->checkBox_PingDeviceEverySecond->setChecked (Settings::isPingDeviceEverySecond()); |
| 1532 | |
| 1533 | ui->checkBox_GrabIsAvgColors->setChecked (Settings::isGrabAvgColorsEnabled()); |
| 1534 | ui->spinBox_GrabSlowdown->setValue (Settings::getGrabSlowdown()); |
| 1535 | ui->spinBox_LuminosityThreshold->setValue (Settings::getLuminosityThreshold()); |
| 1536 | |
| 1537 | // Check the selected moodlamp mode (setChecked(false) not working to select another) |
| 1538 | ui->radioButton_MinimumLuminosity->setChecked (Settings::isMinimumLuminosityEnabled()); |
| 1539 | ui->radioButton_LuminosityDeadZone->setChecked (!Settings::isMinimumLuminosityEnabled()); |
| 1540 | |
| 1541 | // Check the selected moodlamp mode (setChecked(false) not working to select another) |
| 1542 | ui->radioButton_ConstantColorMoodLampMode->setChecked (!Settings::isMoodLampLiquidMode()); |
| 1543 | ui->radioButton_LiquidColorMoodLampMode->setChecked (Settings::isMoodLampLiquidMode()); |
| 1544 | ui->pushButton_SelectColor->setColor (Settings::getMoodLampColor()); |
| 1545 | ui->horizontalSlider_MoodLampSpeed->setValue (Settings::getMoodLampSpeed()); |
| 1546 | |
| 1547 | ui->horizontalSlider_DeviceRefreshDelay->setValue (Settings::getDeviceRefreshDelay()); |
| 1548 | ui->horizontalSlider_DeviceBrightness->setValue (Settings::getDeviceBrightness()); |
| 1549 | ui->horizontalSlider_DeviceSmooth->setValue (Settings::getDeviceSmooth()); |
| 1550 | ui->horizontalSlider_DeviceColorDepth->setValue (Settings::getDeviceColorDepth()); |
| 1551 | ui->doubleSpinBox_DeviceGamma->setValue (Settings::getDeviceGamma()); |
| 1552 | ui->horizontalSlider_GammaCorrection->setValue (floor((Settings::getDeviceGamma() * 100 + 0.5))); |
| 1553 | |
| 1554 | ui->groupBox_Api->setChecked (Settings::isApiEnabled()); |
| 1555 | ui->lineEdit_ApiPort->setText (QString::number(Settings::getApiPort())); |
| 1556 | ui->lineEdit_ApiKey->setText (Settings::getApiAuthKey()); |
| 1557 | ui->spinBox_LoggingLevel->setValue (g_debugLevel); |
| 1558 | |
| 1559 | switch (Settings::getGrabberType()) |
| 1560 | { |
| 1561 | #ifdef WINAPI_GRAB_SUPPORT |
| 1562 | case Grab::GrabberTypeWinAPI: |
| 1563 | ui->radioButton_GrabWinAPI->setChecked(true); |
| 1564 | break; |
| 1565 | case Grab::GrabberTypeWinAPIEachWidget: |
| 1566 | ui->radioButton_GrabWinAPI_EachWidget->setChecked(true); |
| 1567 | break; |
| 1568 | #endif |
| 1569 | #ifdef D3D9_GRAB_SUPPORT |
| 1570 | case Grab::GrabberTypeD3D9: |
| 1571 | ui->radioButton_GrabD3D9->setChecked(true); |
| 1572 | break; |