ScreenTranslator/src/settings.h

63 lines
1.4 KiB
C
Raw Normal View History

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-03-15 18:10:26 +07:00
enum class AutoUpdate { Disabled, Daily, Weekly, Monthly };
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-09 15:29:51 +07:00
bool showMessageOnStart{true};
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-15 18:10:26 +07:00
AutoUpdate autoUpdateType{AutoUpdate::Disabled};
2020-02-21 00:45:53 +07:00
QString 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};
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
};