From 4890ef8141ab67e54ea762b234e097e30edc7ff6 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 30 Jan 2018 13:11:49 +0500 Subject: [PATCH] UI: Log errors always. --- src/ui/conf/firewallconf.cpp | 10 ------- src/ui/conf/firewallconf.h | 6 ---- src/ui/fortmanager.cpp | 2 +- src/ui/fortsettings.cpp | 11 +++---- src/ui/i18n/i18n_ru.qm | Bin 10199 -> 10137 bytes src/ui/i18n/i18n_ru.ts | 49 ++++++++++++++----------------- src/ui/qml/pages/OptionsPage.qml | 16 +--------- 7 files changed, 30 insertions(+), 64 deletions(-) diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index ec63abc6..47e9faa4 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -14,7 +14,6 @@ FirewallConf::FirewallConf(QObject *parent) : m_stopInetTraffic(false), m_ignoreTcpRst(false), m_resolveAddress(false), - m_logErrors(true), m_logBlocked(false), m_logStat(false), m_appBlockAll(true), @@ -77,14 +76,6 @@ void FirewallConf::setResolveAddress(bool resolveAddress) } } -void FirewallConf::setLogErrors(bool logErrors) -{ - if (m_logErrors != logErrors) { - m_logErrors = logErrors; - emit logErrorsChanged(); - } -} - void FirewallConf::setLogBlocked(bool logBlocked) { if (m_logBlocked != logBlocked) { @@ -240,7 +231,6 @@ void FirewallConf::copyFlags(const FirewallConf &o) setStopTraffic(o.stopTraffic()); setStopInetTraffic(o.stopInetTraffic()); setIgnoreTcpRst(o.ignoreTcpRst()); - setLogErrors(o.logErrors()); setAppBlockAll(o.appBlockAll()); setAppAllowAll(o.appAllowAll()); setPasswordHash(o.passwordHash()); diff --git a/src/ui/conf/firewallconf.h b/src/ui/conf/firewallconf.h index 9b289002..bdb8d663 100644 --- a/src/ui/conf/firewallconf.h +++ b/src/ui/conf/firewallconf.h @@ -23,7 +23,6 @@ class FirewallConf : public QObject Q_PROPERTY(bool stopInetTraffic READ stopInetTraffic WRITE setStopInetTraffic NOTIFY stopInetTrafficChanged) Q_PROPERTY(bool ignoreTcpRst READ ignoreTcpRst WRITE setIgnoreTcpRst NOTIFY ignoreTcpRstChanged) Q_PROPERTY(bool resolveAddress READ resolveAddress WRITE setResolveAddress NOTIFY resolveAddressChanged) - Q_PROPERTY(bool logErrors READ logErrors WRITE setLogErrors NOTIFY logErrorsChanged) Q_PROPERTY(bool logBlocked READ logBlocked WRITE setLogBlocked NOTIFY logBlockedChanged) Q_PROPERTY(bool logStat READ logStat WRITE setLogStat NOTIFY logStatChanged) Q_PROPERTY(bool appBlockAll READ appBlockAll WRITE setAppBlockAll NOTIFY appBlockAllChanged) @@ -71,9 +70,6 @@ public: bool resolveAddress() const { return m_resolveAddress; } void setResolveAddress(bool resolveAddress); - bool logErrors() const { return m_logErrors; } - void setLogErrors(bool logErrors); - bool logBlocked() const { return m_logBlocked; } void setLogBlocked(bool logBlocked); @@ -132,7 +128,6 @@ signals: void stopInetTrafficChanged(); void ignoreTcpRstChanged(); void resolveAddressChanged(); - void logErrorsChanged(); void logBlockedChanged(); void logStatChanged(); void appBlockAllChanged(); @@ -161,7 +156,6 @@ private: uint m_resolveAddress : 1; - uint m_logErrors : 1; uint m_logBlocked : 1; uint m_logStat : 1; diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index 6945f334..72018344 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -456,7 +456,7 @@ void FortManager::updateLogger() { Logger *logger = Logger::instance(); - logger->setActive(m_firewallConf->logErrors()); + logger->setActive(true); logger->setDebug(m_fortSettings->debug()); logger->setConsole(m_fortSettings->console()); } diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index 5b3f862a..e0295688 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -195,8 +195,6 @@ bool FortSettings::writeConf(const FirewallConf &conf) return false; } - removeMigratedKeys(); - return true; } @@ -224,7 +222,6 @@ bool FortSettings::readConfIni(FirewallConf &conf) const conf.setStopInetTraffic(iniBool("stopInetTraffic")); conf.setIgnoreTcpRst(iniBool("ignoreTcpRst")); conf.setResolveAddress(iniBool("resolveAddress")); - conf.setLogErrors(iniBool("logErrors", true)); conf.setLogBlocked(iniBool("logBlocked")); conf.setLogStat(iniBool("logStat")); conf.setAppBlockAll(iniBool("appBlockAll", true)); @@ -252,7 +249,6 @@ bool FortSettings::writeConfIni(const FirewallConf &conf) setIniValue("stopInetTraffic", conf.stopInetTraffic()); setIniValue("ignoreTcpRst", conf.ignoreTcpRst()); setIniValue("resolveAddress", conf.resolveAddress()); - setIniValue("logErrors", conf.logErrors()); setIniValue("logBlocked", conf.logBlocked()); setIniValue("logStat", conf.logStat()); setIniValue("appBlockAll", conf.appBlockAll()); @@ -268,6 +264,8 @@ bool FortSettings::writeConfIni(const FirewallConf &conf) setIniValue("trafUnit", conf.trafUnit()); m_ini->endGroup(); + removeMigratedKeys(); + return iniSync(); } @@ -315,7 +313,10 @@ void FortSettings::removeMigratedKeys() removeIniKey("confFlags/ipExcludeAll"); } - iniSync(); + // v1.10.0: Log Errors + if (version < 0x011000) { + removeIniKey("confFlags/logErrors"); + } } bool FortSettings::iniBool(const QString &key, bool defaultValue) const diff --git a/src/ui/i18n/i18n_ru.qm b/src/ui/i18n/i18n_ru.qm index 90f8b94316218a62fdb712915eb0c7bf444ddb8b..90b6a606201e5a06e9eadcaa42c65b27d972ab97 100644 GIT binary patch delta 433 zcmccaKhs~i3DpRjQ6T_*+x<{u0Utkw(+GV3PFsyRvBW?+cg%fO%r z6pgyXz@Q|{z_P58fk8-)fn~)~1_oh223FI@3=C4+8CX3`fx4_2SbJC)7+5|-XxS|j zTkQp-7^1UkfSTToh3j>45Ri5(tEkO6};;9W%0fy#r2rXK~vv_J2 z(3J-#$1i3DpRjQ6T_*+x76t|eR%-?ZnI{uv)tsaS85pAWGB7CV z0qILXI+%fFStSF5kQ@Wcilqz;!hQ^_rjHpIq~0>HdYA%r6*92)0F7Yz454LTO>DIn zoWKyBRRh#q!jM=i#=sz}J@Kl#U^`=D%O(Z}Zd1m+lFAGW3Z|2J8O=3!G99}2fq_Bp zC$sphQw$8!M$G2Fn-~~)jxlEn$S^SQ*|DUq&jgA$OwMIgWIuD58EE(R$-Ru`jh zo0b4AImvqakR=0yaxv@kTZi$pd0s2wq=rMESnt5B+j{rV{gw1prZsP*D|Ry9-q9F$zC#% zo1YcvY{fwC7Cs&Z20?G`#dm{fp xjx0S=8X_#xEOso$3<^NfgT;cy5J+2b0M#(C0Wp_Pe!7BdQBi);=KXTFH~Блокировать - + Allow Разрешить - + Options Опции - + IPv4 Addresses Адреса IPv4 - + Applications Приложения - + Schedule Расписание - + Blocked Блокировано - + Statistics Статистика - + Password: Пароль: - + OK OK - + Apply Применить - + Cancel Отмена - + Quit Выйти @@ -407,37 +407,32 @@ Игнорировать TCP RST-пакеты - - Log Errors - Лог ошибок - - - + Installed Установлен - + Not Installed Не установлен - + Language: Язык: - + Logs Логи - + Profile Профиль - + Releases Релизы @@ -447,7 +442,7 @@ Ограничение скорости: - + @@ -455,17 +450,17 @@ Нестандартный - + Disabled Отключено - + Download speed limit, KiB/s: Ограничение скорости загрузки, KiB/s: - + Upload speed limit, KiB/s: Ограничение скорости выгрузки, KiB/s: diff --git a/src/ui/qml/pages/OptionsPage.qml b/src/ui/qml/pages/OptionsPage.qml index aa1d2073..b4f55dcd 100644 --- a/src/ui/qml/pages/OptionsPage.qml +++ b/src/ui/qml/pages/OptionsPage.qml @@ -95,17 +95,6 @@ BasePage { } } - CheckBox { - text: translationManager.dummyBool - && qsTranslate("qml", "Log Errors") - checked: firewallConf.logErrors - onToggled: { - firewallConf.logErrors = checked; - - setConfFlagsEdited(); - } - } - Row { spacing: 4 @@ -161,7 +150,6 @@ BasePage { RowLayout { LinkButton { - visible: firewallConf.logErrors text: translationManager.dummyBool && qsTranslate("qml", "Logs") tipText: path @@ -169,9 +157,7 @@ BasePage { readonly property string path: fortSettings.logsPath } - VSeparator { - visible: firewallConf.logErrors - } + VSeparator {} LinkButton { text: translationManager.dummyBool