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_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());

View File

@ -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;

View File

@ -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());
}

View File

@ -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

Binary file not shown.

View File

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