MCPcopy Create free account
hub / github.com/OneMoreGres/ScreenTranslator / setSettings

Method setSettings

src/settingseditor.cpp:291–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void SettingsEditor::setSettings(const Settings &settings)
292{
293 wasPortable_ = settings.isPortable();
294 ui->portable->blockSignals(true);
295 ui->portable->setChecked(settings.isPortable());
296 ui->portable->blockSignals(false);
297
298 ui->runAtSystemStart->setChecked(settings.runAtSystemStart);
299
300 ui->captureEdit->setKeySequence(settings.captureHotkey);
301 ui->repeatCaptureEdit->setKeySequence(settings.repeatCaptureHotkey);
302 ui->repeatEdit->setKeySequence(settings.showLastHotkey);
303 ui->clipboardEdit->setKeySequence(settings.clipboardHotkey);
304 ui->captureLockedEdit->setKeySequence(settings.captureLockedHotkey);
305
306 ui->showOnStart->setChecked(settings.showMessageOnStart);
307 ui->writeTrace->setChecked(settings.writeTrace);
308
309 ui->proxyTypeCombo->setCurrentIndex(int(settings.proxyType));
310 ui->proxyHostEdit->setText(settings.proxyHostName);
311 ui->proxyPortSpin->setValue(settings.proxyPort);
312 ui->proxyUserEdit->setText(settings.proxyUser);
313 ui->proxyPassEdit->setText(settings.proxyPassword);
314 ui->proxySaveCheck->setChecked(settings.proxySavePassword);
315
316 ui->tessdataPath->setText(settings.tessdataPath);
317 ui->translatorsPath->setText(settings.translatorsPath);
318 updateModels();
319
320 ui->tesseractLangCombo->setCurrentText(
321 LanguageCodes::name(settings.sourceLanguage));
322
323 ui->useHunspell->setChecked(settings.useHunspell);
324 ui->hunspellDir->setText(settings.hunspellPath);
325 ui->useUserSubstitutions->setChecked(settings.useUserSubstitutions);
326 ui->userSubstitutionsTable->setSubstitutions(settings.userSubstitutions);
327
328 ui->doTranslationCheck->setChecked(settings.doTranslation);
329 ui->ignoreSslCheck->setChecked(settings.ignoreSslErrors);
330 ui->translateTimeoutSpin->setValue(settings.translationTimeout.count());
331 ui->translateLangCombo->setCurrentText(
332 LanguageCodes::name(settings.targetLanguage));
333 updateTranslators(settings.translators);
334
335 ui->trayRadio->setChecked(settings.resultShowType == ResultMode::Tooltip);
336 ui->dialogRadio->setChecked(settings.resultShowType == ResultMode::Widget);
337 ui->resultFont->setCurrentFont(QFont(settings.fontFamily));
338 ui->resultFontSize->setValue(settings.fontSize);
339 {
340 QPalette palette(this->palette());
341 palette.setColor(QPalette::Button, settings.fontColor);
342 ui->fontColor->setPalette(palette);
343 palette.setColor(QPalette::ButtonText, settings.fontColor);
344 palette.setColor(QPalette::Button, settings.backgroundColor);
345 ui->backgroundColor->setPalette(palette);
346 }
347 ui->showRecognized->setChecked(settings.showRecognized);
348 ui->showCaptured->setChecked(settings.showCaptured);

Callers 1

settingsMethod · 0.80

Calls 4

nameFunction · 0.85
isPortableMethod · 0.80
setKeySequenceMethod · 0.80
setSubstitutionsMethod · 0.80

Tested by

no test coverage detected