| 97 | } |
| 98 | |
| 99 | void SettingsWorksheetPage::loadSettings() { |
| 100 | const KConfigGroup group = Settings::group(QStringLiteral("Settings_Worksheet")); |
| 101 | m_cbThemes->setItemText(0, group.readEntry(QLatin1String("Theme"), "")); |
| 102 | ui.chkPresenterModeInteractive->setChecked(group.readEntry(QLatin1String("PresenterModeInteractive"), false)); |
| 103 | ui.chkDoubleBuffering->setChecked(group.readEntry(QLatin1String("DoubleBuffering"), true)); |
| 104 | |
| 105 | int index = ui.cbPreviewThumbnailSize->findData(group.readEntry(QLatin1String("PreviewThumbnailSize"), 3)); |
| 106 | if (index != -1) |
| 107 | ui.cbPreviewThumbnailSize->setCurrentIndex(index); |
| 108 | else |
| 109 | ui.cbPreviewThumbnailSize->setCurrentIndex(1); // medium |
| 110 | |
| 111 | QString engine = group.readEntry(QLatin1String("LaTeXEngine"), ""); |
| 112 | index = -1; |
| 113 | if (engine.isEmpty()) { |
| 114 | // empty string was found in the settings (either the settings never saved or no tex engine was available during the last save) |
| 115 | //->check whether the latex environment was installed in the meantime |
| 116 | index = ui.cbTexEngine->findData(QLatin1String("xelatex")); |
| 117 | if (index == -1) { |
| 118 | index = ui.cbTexEngine->findData(QLatin1String("lualatex")); |
| 119 | if (index == -1) { |
| 120 | index = ui.cbTexEngine->findData(QLatin1String("pdflatex")); |
| 121 | if (index == -1) |
| 122 | index = ui.cbTexEngine->findData(QLatin1String("latex")); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | if (index != -1) { |
| 127 | // one of the tex engines was found -> automatically save it in the settings without any user action |
| 128 | KConfigGroup group = Settings::group(QStringLiteral("Settings_Worksheet")); |
| 129 | group.writeEntry(QLatin1String("LaTeXEngine"), ui.cbTexEngine->itemData(index)); |
| 130 | } |
| 131 | } else |
| 132 | index = ui.cbTexEngine->findData(engine); |
| 133 | |
| 134 | ui.cbTexEngine->setCurrentIndex(index); |
| 135 | checkTeX(index); |
| 136 | |
| 137 | m_changed = false; |
| 138 | } |
| 139 | |
| 140 | void SettingsWorksheetPage::changed() { |
| 141 | m_changed = true; |
nothing calls this directly
no test coverage detected