| 305 | } |
| 306 | |
| 307 | void OptionsDialog::saveOptions() |
| 308 | { |
| 309 | settings->setValue(GO_TO_FLOW_SIZE, QSize(static_cast<int>(slideSize->sliderPosition() / SLIDE_ASPECT_RATIO), slideSize->sliderPosition())); |
| 310 | |
| 311 | settings->setValue(PATH, pathEdit->text()); |
| 312 | |
| 313 | Configuration::getConfiguration().setShowTimeInInformation(showTimeInInformationLabel->isChecked()); |
| 314 | |
| 315 | if (!backgroundColorFollowsTheme) { |
| 316 | settings->setValue(BACKGROUND_COLOR, currentColor); |
| 317 | } else { |
| 318 | settings->remove(BACKGROUND_COLOR); |
| 319 | } |
| 320 | // settings->setValue(FIT_TO_WIDTH_RATIO,fitToWidthRatioS->sliderPosition()/100.0); |
| 321 | settings->setValue(QUICK_NAVI_MODE, quickNavi->isChecked()); |
| 322 | settings->setValue(DISABLE_MOUSE_OVER_GOTO_FLOW, disableShowOnMouseOver->isChecked()); |
| 323 | |
| 324 | settings->setValue(DO_NOT_TURN_PAGE_ON_SCROLL, doNotTurnPageOnScroll->isChecked()); |
| 325 | settings->setValue(USE_SINGLE_SCROLL_STEP_TO_TURN_PAGE, useSingleScrollStepToTurnPage->isChecked()); |
| 326 | settings->setValue(DISABLE_SCROLL_ANIMATION, disableScrollAnimations->isChecked()); |
| 327 | |
| 328 | // get checked radio button to get the mouse mode |
| 329 | YACReader::MouseMode mouseMode = Normal; |
| 330 | if (normalMouseModeRadioButton->isChecked()) { |
| 331 | mouseMode = Normal; |
| 332 | ; |
| 333 | } else if (leftRightNavigationMouseModeRadioButton->isChecked()) { |
| 334 | mouseMode = LeftRightNavigation; |
| 335 | } else if (hotAreasMouseModeRadioButton->isChecked()) { |
| 336 | mouseMode = HotAreas; |
| 337 | } |
| 338 | Configuration::getConfiguration().setMouseMode(mouseMode); |
| 339 | |
| 340 | Configuration::getConfiguration().setScalingMethod(static_cast<ScaleMethod>(scalingMethodCombo->currentIndex())); |
| 341 | emit changedImageOptions(); |
| 342 | |
| 343 | const auto selectedLanguage = languageCombo->currentData().toString().trimmed(); |
| 344 | if (selectedLanguage.isEmpty()) |
| 345 | settings->remove(UI_LANGUAGE); |
| 346 | else |
| 347 | settings->setValue(UI_LANGUAGE, selectedLanguage); |
| 348 | |
| 349 | YACReaderOptionsDialog::saveOptions(); |
| 350 | } |
| 351 | |
| 352 | void OptionsDialog::restoreOptions(QSettings *settings) |
| 353 | { |
nothing calls this directly
no test coverage detected