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-03-29 15:55:03 +07:00
|
|
|
#include <QColor>
|
2020-03-18 01:32:36 +07:00
|
|
|
#include <QDateTime>
|
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:
|
2020-03-15 19:20:28 +07:00
|
|
|
void save() const;
|
2020-02-21 00:45:53 +07:00
|
|
|
void load();
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2020-03-21 17:03:58 +07:00
|
|
|
void saveLastUpdateCheck();
|
2020-03-19 00:24:11 +07:00
|
|
|
|
2020-03-15 19:30:24 +07:00
|
|
|
bool isPortable() const;
|
|
|
|
|
void setPortable(bool isPortable);
|
|
|
|
|
|
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-09 15:29:51 +07:00
|
|
|
bool showMessageOnStart{true};
|
2020-03-20 02:35:42 +07:00
|
|
|
bool runAtSystemStart{false};
|
2020-03-09 15:29:51 +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-03-18 01:32:36 +07:00
|
|
|
int autoUpdateIntervalDays{0};
|
|
|
|
|
QDateTime lastUpdateCheck;
|
2020-03-08 17:49:15 +07:00
|
|
|
|
2020-02-21 00:45:53 +07:00
|
|
|
Substitutions userSubstitutions;
|
2020-03-08 17:49:15 +07:00
|
|
|
bool useUserSubstitutions{true};
|
2020-02-21 00:45:53 +07:00
|
|
|
|
|
|
|
|
bool debugMode{false};
|
|
|
|
|
|
2020-03-15 18:25:27 +07:00
|
|
|
QString tessdataPath;
|
2020-02-21 00:45:53 +07:00
|
|
|
QString sourceLanguage{"eng"};
|
|
|
|
|
LanguageIds availableOcrLanguages_;
|
|
|
|
|
|
|
|
|
|
bool doTranslation{true};
|
|
|
|
|
bool ignoreSslErrors{false};
|
|
|
|
|
bool forceRotateTranslators{false};
|
|
|
|
|
LanguageId targetLanguage{"rus"};
|
|
|
|
|
std::chrono::seconds translationTimeout{15};
|
2020-03-15 18:25:27 +07:00
|
|
|
QString translatorsDir;
|
2020-02-21 00:45:53 +07:00
|
|
|
QStringList translators{"google.js"};
|
|
|
|
|
|
|
|
|
|
ResultMode resultShowType{ResultMode::Widget}; // dialog
|
2020-03-20 01:47:46 +07:00
|
|
|
QString fontFamily;
|
|
|
|
|
int fontSize{11};
|
2020-03-29 15:55:03 +07:00
|
|
|
QColor fontColor{Qt::black};
|
|
|
|
|
QColor backgroundColor{Qt::lightGray};
|
2020-03-20 01:55:32 +07:00
|
|
|
bool showRecognized{true};
|
|
|
|
|
bool showCaptured{true};
|
2020-03-15 19:30:24 +07:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool isPortable_{false};
|
2020-02-21 00:45:53 +07:00
|
|
|
};
|