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

Method SettingsEditor

src/settingseditor.cpp:29–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27} // namespace
28
29SettingsEditor::SettingsEditor(Manager &manager, update::Updater &updater)
30 : ui(new Ui::SettingsEditor)
31 , manager_(manager)
32 , updater_(updater)
33 , pageModel_(new QStandardItemModel(this))
34{
35 ui->setupUi(this);
36
37 connect(ui->buttonBox, &QDialogButtonBox::clicked, //
38 this, &SettingsEditor::handleButtonBoxClicked);
39
40 connect(ui->portable, &QCheckBox::toggled, //
41 this, &SettingsEditor::updateState);
42
43 ui->runAtSystemStart->setEnabled(service::RunAtSystemStart::isAvailable());
44
45 {
46 struct Info {
47 QString title;
48 QString description;
49 };
50
51 QMap<Page, Info> names{
52 {Page::General,
53 {tr("General"), tr("This page contains general program settings")}},
54
55 {Page::Recognition,
56 {tr("Recognition"),
57 tr("This page contains text recognition settings. "
58 "It shows the available languages that program can convert from "
59 "image to text")}},
60
61 {Page::Correction,
62 {tr("Correction"),
63 tr("This page contains recognized text correction settings. "
64 "It allows to fix some errors after recognition.\n"
65 "Hunspell searches for words that are similar to recognized ones "
66 "in its dictionary.\n"
67 "User correction allows to manually fix some frequently "
68 "happening mistakes.\n"
69 "User correction occurs before hunspell correction if both "
70 "are enabled")}},
71
72 {Page::Translation,
73 {tr("Translation"),
74 tr("This page contains settings, related to translation of the "
75 "recognized text. "
76 "Translation is done via enabled (checked) translation services. "
77 "If one fails, then second one will be used and so on. "
78 "If translator hangs it will be treated as failed after "
79 "given timeout")}},
80
81 {Page::Representation,
82 {tr("Representation"),
83 tr("This page contains result representation settings")}},
84
85 {Page::Update,
86 {tr("Update"),

Callers

nothing calls this directly

Calls 7

setEnabledMethod · 0.80
sourceLanguageModelMethod · 0.80
targetLanguageModelMethod · 0.80
initViewMethod · 0.80
QStringClass · 0.70
indexMethod · 0.45

Tested by

no test coverage detected