UI: Log errors always.

This commit is contained in:
Nodir Temirkhodjaev 2018-01-30 13:11:49 +05:00
parent 810a61a2eb
commit 4890ef8141
7 changed files with 30 additions and 64 deletions

View File

@ -14,7 +14,6 @@ FirewallConf::FirewallConf(QObject *parent) :
m_stopInetTraffic(false), m_stopInetTraffic(false),
m_ignoreTcpRst(false), m_ignoreTcpRst(false),
m_resolveAddress(false), m_resolveAddress(false),
m_logErrors(true),
m_logBlocked(false), m_logBlocked(false),
m_logStat(false), m_logStat(false),
m_appBlockAll(true), 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) void FirewallConf::setLogBlocked(bool logBlocked)
{ {
if (m_logBlocked != logBlocked) { if (m_logBlocked != logBlocked) {
@ -240,7 +231,6 @@ void FirewallConf::copyFlags(const FirewallConf &o)
setStopTraffic(o.stopTraffic()); setStopTraffic(o.stopTraffic());
setStopInetTraffic(o.stopInetTraffic()); setStopInetTraffic(o.stopInetTraffic());
setIgnoreTcpRst(o.ignoreTcpRst()); setIgnoreTcpRst(o.ignoreTcpRst());
setLogErrors(o.logErrors());
setAppBlockAll(o.appBlockAll()); setAppBlockAll(o.appBlockAll());
setAppAllowAll(o.appAllowAll()); setAppAllowAll(o.appAllowAll());
setPasswordHash(o.passwordHash()); setPasswordHash(o.passwordHash());

View File

@ -23,7 +23,6 @@ class FirewallConf : public QObject
Q_PROPERTY(bool stopInetTraffic READ stopInetTraffic WRITE setStopInetTraffic NOTIFY stopInetTrafficChanged) Q_PROPERTY(bool stopInetTraffic READ stopInetTraffic WRITE setStopInetTraffic NOTIFY stopInetTrafficChanged)
Q_PROPERTY(bool ignoreTcpRst READ ignoreTcpRst WRITE setIgnoreTcpRst NOTIFY ignoreTcpRstChanged) Q_PROPERTY(bool ignoreTcpRst READ ignoreTcpRst WRITE setIgnoreTcpRst NOTIFY ignoreTcpRstChanged)
Q_PROPERTY(bool resolveAddress READ resolveAddress WRITE setResolveAddress NOTIFY resolveAddressChanged) 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 logBlocked READ logBlocked WRITE setLogBlocked NOTIFY logBlockedChanged)
Q_PROPERTY(bool logStat READ logStat WRITE setLogStat NOTIFY logStatChanged) Q_PROPERTY(bool logStat READ logStat WRITE setLogStat NOTIFY logStatChanged)
Q_PROPERTY(bool appBlockAll READ appBlockAll WRITE setAppBlockAll NOTIFY appBlockAllChanged) Q_PROPERTY(bool appBlockAll READ appBlockAll WRITE setAppBlockAll NOTIFY appBlockAllChanged)
@ -71,9 +70,6 @@ public:
bool resolveAddress() const { return m_resolveAddress; } bool resolveAddress() const { return m_resolveAddress; }
void setResolveAddress(bool resolveAddress); void setResolveAddress(bool resolveAddress);
bool logErrors() const { return m_logErrors; }
void setLogErrors(bool logErrors);
bool logBlocked() const { return m_logBlocked; } bool logBlocked() const { return m_logBlocked; }
void setLogBlocked(bool logBlocked); void setLogBlocked(bool logBlocked);
@ -132,7 +128,6 @@ signals:
void stopInetTrafficChanged(); void stopInetTrafficChanged();
void ignoreTcpRstChanged(); void ignoreTcpRstChanged();
void resolveAddressChanged(); void resolveAddressChanged();
void logErrorsChanged();
void logBlockedChanged(); void logBlockedChanged();
void logStatChanged(); void logStatChanged();
void appBlockAllChanged(); void appBlockAllChanged();
@ -161,7 +156,6 @@ private:
uint m_resolveAddress : 1; uint m_resolveAddress : 1;
uint m_logErrors : 1;
uint m_logBlocked : 1; uint m_logBlocked : 1;
uint m_logStat : 1; uint m_logStat : 1;

View File

@ -456,7 +456,7 @@ void FortManager::updateLogger()
{ {
Logger *logger = Logger::instance(); Logger *logger = Logger::instance();
logger->setActive(m_firewallConf->logErrors()); logger->setActive(true);
logger->setDebug(m_fortSettings->debug()); logger->setDebug(m_fortSettings->debug());
logger->setConsole(m_fortSettings->console()); logger->setConsole(m_fortSettings->console());
} }

View File

@ -195,8 +195,6 @@ bool FortSettings::writeConf(const FirewallConf &conf)
return false; return false;
} }
removeMigratedKeys();
return true; return true;
} }
@ -224,7 +222,6 @@ bool FortSettings::readConfIni(FirewallConf &conf) const
conf.setStopInetTraffic(iniBool("stopInetTraffic")); conf.setStopInetTraffic(iniBool("stopInetTraffic"));
conf.setIgnoreTcpRst(iniBool("ignoreTcpRst")); conf.setIgnoreTcpRst(iniBool("ignoreTcpRst"));
conf.setResolveAddress(iniBool("resolveAddress")); conf.setResolveAddress(iniBool("resolveAddress"));
conf.setLogErrors(iniBool("logErrors", true));
conf.setLogBlocked(iniBool("logBlocked")); conf.setLogBlocked(iniBool("logBlocked"));
conf.setLogStat(iniBool("logStat")); conf.setLogStat(iniBool("logStat"));
conf.setAppBlockAll(iniBool("appBlockAll", true)); conf.setAppBlockAll(iniBool("appBlockAll", true));
@ -252,7 +249,6 @@ bool FortSettings::writeConfIni(const FirewallConf &conf)
setIniValue("stopInetTraffic", conf.stopInetTraffic()); setIniValue("stopInetTraffic", conf.stopInetTraffic());
setIniValue("ignoreTcpRst", conf.ignoreTcpRst()); setIniValue("ignoreTcpRst", conf.ignoreTcpRst());
setIniValue("resolveAddress", conf.resolveAddress()); setIniValue("resolveAddress", conf.resolveAddress());
setIniValue("logErrors", conf.logErrors());
setIniValue("logBlocked", conf.logBlocked()); setIniValue("logBlocked", conf.logBlocked());
setIniValue("logStat", conf.logStat()); setIniValue("logStat", conf.logStat());
setIniValue("appBlockAll", conf.appBlockAll()); setIniValue("appBlockAll", conf.appBlockAll());
@ -268,6 +264,8 @@ bool FortSettings::writeConfIni(const FirewallConf &conf)
setIniValue("trafUnit", conf.trafUnit()); setIniValue("trafUnit", conf.trafUnit());
m_ini->endGroup(); m_ini->endGroup();
removeMigratedKeys();
return iniSync(); return iniSync();
} }
@ -315,7 +313,10 @@ void FortSettings::removeMigratedKeys()
removeIniKey("confFlags/ipExcludeAll"); removeIniKey("confFlags/ipExcludeAll");
} }
iniSync(); // v1.10.0: Log Errors
if (version < 0x011000) {
removeIniKey("confFlags/logErrors");
}
} }
bool FortSettings::iniBool(const QString &key, bool defaultValue) const bool FortSettings::iniBool(const QString &key, bool defaultValue) const

Binary file not shown.

View File

@ -317,62 +317,62 @@
<translation>Блокировать</translation> <translation>Блокировать</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/apps/AppsColumn.qml" line="87"/> <location filename="../qml/pages/apps/AppsColumn.qml" line="84"/>
<source>Allow</source> <source>Allow</source>
<translation>Разрешить</translation> <translation>Разрешить</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="49"/> <location filename="../qml/pages/MainPage.qml" line="50"/>
<source>Options</source> <source>Options</source>
<translation>Опции</translation> <translation>Опции</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="54"/> <location filename="../qml/pages/MainPage.qml" line="55"/>
<source>IPv4 Addresses</source> <source>IPv4 Addresses</source>
<translation>Адреса IPv4</translation> <translation>Адреса IPv4</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="59"/> <location filename="../qml/pages/MainPage.qml" line="60"/>
<source>Applications</source> <source>Applications</source>
<translation>Приложения</translation> <translation>Приложения</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="74"/> <location filename="../qml/pages/MainPage.qml" line="75"/>
<source>Schedule</source> <source>Schedule</source>
<translation>Расписание</translation> <translation>Расписание</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="64"/> <location filename="../qml/pages/MainPage.qml" line="65"/>
<source>Blocked</source> <source>Blocked</source>
<translation>Блокировано</translation> <translation>Блокировано</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="69"/> <location filename="../qml/pages/MainPage.qml" line="70"/>
<source>Statistics</source> <source>Statistics</source>
<translation>Статистика</translation> <translation>Статистика</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="115"/> <location filename="../qml/pages/OptionsPage.qml" line="104"/>
<source>Password:</source> <source>Password:</source>
<translation>Пароль:</translation> <translation>Пароль:</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="99"/> <location filename="../qml/pages/MainPage.qml" line="102"/>
<source>OK</source> <source>OK</source>
<translation>OK</translation> <translation>OK</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="116"/> <location filename="../qml/pages/MainPage.qml" line="119"/>
<source>Apply</source> <source>Apply</source>
<translation>Применить</translation> <translation>Применить</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="132"/> <location filename="../qml/pages/MainPage.qml" line="135"/>
<source>Cancel</source> <source>Cancel</source>
<translation>Отмена</translation> <translation>Отмена</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/MainPage.qml" line="138"/> <location filename="../qml/pages/MainPage.qml" line="141"/>
<source>Quit</source> <source>Quit</source>
<translation>Выйти</translation> <translation>Выйти</translation>
</message> </message>
@ -407,37 +407,32 @@
<translation>Игнорировать TCP RST-пакеты</translation> <translation>Игнорировать TCP RST-пакеты</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="100"/> <location filename="../qml/pages/OptionsPage.qml" line="125"/>
<source>Log Errors</source>
<translation>Лог ошибок</translation>
</message>
<message>
<location filename="../qml/pages/OptionsPage.qml" line="136"/>
<source>Installed</source> <source>Installed</source>
<translation>Установлен</translation> <translation>Установлен</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="137"/> <location filename="../qml/pages/OptionsPage.qml" line="126"/>
<source>Not Installed</source> <source>Not Installed</source>
<translation>Не установлен</translation> <translation>Не установлен</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="147"/> <location filename="../qml/pages/OptionsPage.qml" line="136"/>
<source>Language:</source> <source>Language:</source>
<translation>Язык:</translation> <translation>Язык:</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="166"/> <location filename="../qml/pages/OptionsPage.qml" line="154"/>
<source>Logs</source> <source>Logs</source>
<translation>Логи</translation> <translation>Логи</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="178"/> <location filename="../qml/pages/OptionsPage.qml" line="164"/>
<source>Profile</source> <source>Profile</source>
<translation>Профиль</translation> <translation>Профиль</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/OptionsPage.qml" line="188"/> <location filename="../qml/pages/OptionsPage.qml" line="174"/>
<source>Releases</source> <source>Releases</source>
<translation>Релизы</translation> <translation>Релизы</translation>
</message> </message>
@ -447,7 +442,7 @@
<translation>Ограничение скорости: </translation> <translation>Ограничение скорости: </translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/apps/SpeedLimitButton.qml" line="24"/> <location filename="../qml/pages/apps/SpeedLimitButton.qml" line="25"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="20"/> <location filename="../qml/pages/log/TrafOptionsButton.qml" line="20"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="35"/> <location filename="../qml/pages/log/TrafOptionsButton.qml" line="35"/>
<location filename="../qml/pages/SchedulePage.qml" line="31"/> <location filename="../qml/pages/SchedulePage.qml" line="31"/>
@ -455,17 +450,17 @@
<translation>Нестандартный</translation> <translation>Нестандартный</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/apps/SpeedLimitButton.qml" line="25"/> <location filename="../qml/pages/apps/SpeedLimitButton.qml" line="26"/>
<source>Disabled</source> <source>Disabled</source>
<translation>Отключено</translation> <translation>Отключено</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/apps/SpeedLimitButton.qml" line="63"/> <location filename="../qml/pages/apps/SpeedLimitButton.qml" line="68"/>
<source>Download speed limit, KiB/s:</source> <source>Download speed limit, KiB/s:</source>
<translation>Ограничение скорости загрузки, KiB/s:</translation> <translation>Ограничение скорости загрузки, KiB/s:</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/apps/SpeedLimitButton.qml" line="95"/> <location filename="../qml/pages/apps/SpeedLimitButton.qml" line="101"/>
<source>Upload speed limit, KiB/s:</source> <source>Upload speed limit, KiB/s:</source>
<translation>Ограничение скорости выгрузки, KiB/s:</translation> <translation>Ограничение скорости выгрузки, KiB/s:</translation>
</message> </message>

View File

@ -95,17 +95,6 @@ BasePage {
} }
} }
CheckBox {
text: translationManager.dummyBool
&& qsTranslate("qml", "Log Errors")
checked: firewallConf.logErrors
onToggled: {
firewallConf.logErrors = checked;
setConfFlagsEdited();
}
}
Row { Row {
spacing: 4 spacing: 4
@ -161,7 +150,6 @@ BasePage {
RowLayout { RowLayout {
LinkButton { LinkButton {
visible: firewallConf.logErrors
text: translationManager.dummyBool text: translationManager.dummyBool
&& qsTranslate("qml", "Logs") && qsTranslate("qml", "Logs")
tipText: path tipText: path
@ -169,9 +157,7 @@ BasePage {
readonly property string path: fortSettings.logsPath readonly property string path: fortSettings.logsPath
} }
VSeparator { VSeparator {}
visible: firewallConf.logErrors
}
LinkButton { LinkButton {
text: translationManager.dummyBool text: translationManager.dummyBool