2020-02-21 00:45:53 +07:00
|
|
|
#pragma once
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
#include "stfwd.h"
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
#include <QStringList>
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
#include <chrono>
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
enum class ResultMode { Widget, Tooltip };
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
struct Substitution {
|
|
|
|
|
QString source;
|
|
|
|
|
QString target;
|
|
|
|
|
};
|
|
|
|
|
using Substitutions = std::unordered_multimap<LanguageId, Substitution>;
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-03-07 00:53:53 +07:00
|
|
|
enum class ProxyType { Disabled, System, Socks5, Http };
|
|
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
class Settings
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void save();
|
|
|
|
|
void load();
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
QString captureHotkey{"Ctrl+Alt+Z"};
|
|
|
|
|
QString repeatCaptureHotkey{"Ctrl+Alt+S"};
|
|
|
|
|
QString showLastHotkey{"Ctrl+Alt+X"};
|
|
|
|
|
QString clipboardHotkey{"Ctrl+Alt+C"};
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-03-07 00:53:53 +07:00
|
|
|
ProxyType proxyType{ProxyType::System};
|
|
|
|
|
QString proxyHostName;
|
2020-02-21 00:45:53 +07:00
|
|
|
int proxyPort{8080};
|
2020-03-07 00:53:53 +07:00
|
|
|
QString proxyUser;
|
|
|
|
|
QString proxyPassword;
|
2020-02-21 00:45:53 +07:00
|
|
|
bool proxySavePassword{false};
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
int autoUpdateType{0}; // Never
|
|
|
|
|
QString lastUpdateCheck{""};
|
|
|
|
|
Substitutions userSubstitutions;
|
|
|
|
|
|
|
|
|
|
bool debugMode{false};
|
|
|
|
|
|
|
|
|
|
QString tessdataPath{"tessdata"};
|
|
|
|
|
QString sourceLanguage{"eng"};
|
|
|
|
|
LanguageIds availableOcrLanguages_;
|
|
|
|
|
|
|
|
|
|
bool doTranslation{true};
|
|
|
|
|
bool ignoreSslErrors{false};
|
|
|
|
|
bool forceRotateTranslators{false};
|
|
|
|
|
LanguageId targetLanguage{"rus"};
|
|
|
|
|
std::chrono::seconds translationTimeout{15};
|
|
|
|
|
QString translatorsDir{"translators"};
|
|
|
|
|
QStringList translators{"google.js"};
|
|
|
|
|
|
|
|
|
|
ResultMode resultShowType{ResultMode::Widget}; // dialog
|
|
|
|
|
};
|