UI: Add day & month traffic quota alerts.

This commit is contained in:
Nodir Temirkhodjaev 2018-02-19 20:01:35 +05:00
parent 4fb8219685
commit 2b127ee549
15 changed files with 411 additions and 25 deletions

View File

@ -16,6 +16,7 @@ SOURCES += \
conf/firewallconf.cpp \
db/databasemanager.cpp \
db/databasesql.cpp \
db/quotamanager.cpp \
driver/drivermanager.cpp \
driver/driverworker.cpp \
fortcommon.cpp \
@ -54,8 +55,8 @@ SOURCES += \
util/net/ip4range.cpp \
util/net/netdownloader.cpp \
util/net/netutil.cpp \
util/processinfo.cpp \
util/osutil.cpp \
util/processinfo.cpp \
util/stringutil.cpp \
util/windowstatewatcher.cpp
@ -65,6 +66,7 @@ HEADERS += \
conf/firewallconf.h \
db/databasemanager.h \
db/databasesql.h \
db/quotamanager.h \
driver/drivermanager.h \
driver/driverworker.h \
fortcommon.h \
@ -103,8 +105,8 @@ HEADERS += \
util/net/ip4range.h \
util/net/netdownloader.h \
util/net/netutil.h \
util/processinfo.h \
util/osutil.h \
util/processinfo.h \
util/stringutil.h \
util/windowstatewatcher.h

View File

@ -22,7 +22,9 @@ FirewallConf::FirewallConf(QObject *parent) :
m_trafHourKeepDays(DEFAULT_TRAF_HOUR_KEEP_DAYS),
m_trafDayKeepDays(DEFAULT_TRAF_DAY_KEEP_DAYS),
m_trafMonthKeepMonths(DEFAULT_TRAF_MONTH_KEEP_MONTHS),
m_trafUnit(UnitAdaptive)
m_trafUnit(UnitAdaptive),
m_quotaDayMb(0),
m_quotaMonthMb(0)
{
m_addressGroups.append(new AddressGroup(this));
m_addressGroups.append(new AddressGroup(this));
@ -111,7 +113,7 @@ void FirewallConf::setAppAllowAll(bool appAllowAll)
void FirewallConf::setMonthStart(int monthStart)
{
if (m_monthStart != monthStart) {
m_monthStart = monthStart;
m_monthStart = uint(monthStart);
emit monthStartChanged();
}
}
@ -148,6 +150,22 @@ void FirewallConf::setTrafUnit(int trafUnit)
}
}
void FirewallConf::setQuotaDayMb(quint32 quotaDayMb)
{
if (m_quotaDayMb != quotaDayMb) {
m_quotaDayMb = quotaDayMb;
emit quotaDayMbChanged();
}
}
void FirewallConf::setQuotaMonthMb(quint32 quotaMonthMb)
{
if (m_quotaMonthMb != quotaMonthMb) {
m_quotaMonthMb = quotaMonthMb;
emit quotaMonthMbChanged();
}
}
void FirewallConf::setPasswordHash(const QString &passwordHash)
{
if (m_passwordHash != passwordHash) {
@ -241,6 +259,9 @@ void FirewallConf::copyFlags(const FirewallConf &o)
setTrafDayKeepDays(o.trafDayKeepDays());
setTrafMonthKeepMonths(o.trafMonthKeepMonths());
setQuotaDayMb(o.quotaDayMb());
setQuotaMonthMb(o.quotaMonthMb());
copyImmediateFlags(o);
}

View File

@ -32,6 +32,8 @@ class FirewallConf : public QObject
Q_PROPERTY(int trafDayKeepDays READ trafDayKeepDays WRITE setTrafDayKeepDays NOTIFY trafDayKeepDaysChanged)
Q_PROPERTY(int trafMonthKeepMonths READ trafMonthKeepMonths WRITE setTrafMonthKeepMonths NOTIFY trafMonthKeepMonthsChanged)
Q_PROPERTY(int trafUnit READ trafUnit WRITE setTrafUnit NOTIFY trafUnitChanged)
Q_PROPERTY(quint32 quotaDayMb READ quotaDayMb WRITE setQuotaDayMb NOTIFY quotaDayMbChanged)
Q_PROPERTY(quint32 quotaMonthMb READ quotaMonthMb WRITE setQuotaMonthMb NOTIFY quotaMonthMbChanged)
Q_PROPERTY(bool hasPassword READ hasPassword NOTIFY passwordHashChanged)
Q_PROPERTY(QString passwordHash READ passwordHash WRITE setPasswordHash NOTIFY passwordHashChanged)
Q_PROPERTY(AddressGroup *inetAddressGroup READ inetAddressGroup NOTIFY addressGroupsChanged)
@ -97,6 +99,12 @@ public:
int trafUnit() const { return m_trafUnit; }
void setTrafUnit(int trafUnit);
quint32 quotaDayMb() const { return m_quotaDayMb; }
void setQuotaDayMb(quint32 quotaDayMb);
quint32 quotaMonthMb() const { return m_quotaMonthMb; }
void setQuotaMonthMb(quint32 quotaMonthMb);
bool hasPassword() const { return !m_passwordHash.isEmpty(); }
QString passwordHash() const { return m_passwordHash; }
@ -137,6 +145,8 @@ signals:
void trafDayKeepDaysChanged();
void trafMonthKeepMonthsChanged();
void trafUnitChanged();
void quotaDayMbChanged();
void quotaMonthMbChanged();
void passwordHashChanged();
void addressGroupsChanged();
void appGroupsChanged();
@ -170,6 +180,9 @@ private:
TrafUnit m_trafUnit;
quint32 m_quotaDayMb;
quint32 m_quotaMonthMb;
QString m_passwordHash;
QList<AddressGroup *> m_addressGroups;

View File

@ -4,6 +4,7 @@
#include "../util/dateutil.h"
#include "../util/fileutil.h"
#include "databasesql.h"
#include "quotamanager.h"
#include "sqlite/sqlitedb.h"
#include "sqlite/sqliteengine.h"
#include "sqlite/sqlitestmt.h"
@ -11,9 +12,14 @@
#define INVALID_APP_ID qint64(-1)
DatabaseManager::DatabaseManager(const QString &filePath,
QuotaManager *quotaManager,
QObject *parent) :
QObject(parent),
m_lastTrafHour(0),
m_lastTrafDay(0),
m_lastTrafMonth(0),
m_filePath(filePath),
m_quotaManager(quotaManager),
m_conf(nullptr),
m_sqliteDb(new SqliteDb())
{
@ -36,6 +42,8 @@ void DatabaseManager::setFirewallConf(const FirewallConf *conf)
if (m_conf && !m_conf->logStat()) {
logClear();
}
initializeQuota();
}
bool DatabaseManager::initialize()
@ -52,10 +60,30 @@ bool DatabaseManager::initialize()
return fileExists || createTables();
}
void DatabaseManager::initializeQuota()
{
m_quotaManager->setQuotaDayBytes(
m_conf ? qint64(m_conf->quotaDayMb()) * 1024 * 1024 : 0);
m_quotaManager->setQuotaMonthBytes(
m_conf ? qint64(m_conf->quotaMonthMb()) * 1024 * 1024 : 0);
const qint64 unixTime = DateUtil::getUnixTime();
const qint32 trafDay = DateUtil::getUnixDay(unixTime);
const qint32 trafMonth = DateUtil::getUnixMonth(
unixTime, m_conf ? m_conf->monthStart() : 1);
qint64 inBytes, outBytes;
getTraffic(DatabaseSql::sqlSelectTrafDay, trafDay, inBytes, outBytes);
m_quotaManager->setTrafDayBytes(inBytes);
getTraffic(DatabaseSql::sqlSelectTrafMonth, trafMonth, inBytes, outBytes);
m_quotaManager->setTrafMonthBytes(inBytes);
}
void DatabaseManager::clear()
{
clearAppIds();
clearStmts();
m_sqliteDb->close();
@ -63,6 +91,8 @@ void DatabaseManager::clear()
FileUtil::removeFile(m_filePath);
initialize();
m_quotaManager->clear();
}
void DatabaseManager::clearStmts()
@ -134,11 +164,15 @@ void DatabaseManager::logStatTraf(quint16 procCount, const quint8 *procBits,
const qint32 trafMonth = isNewDay
? DateUtil::getUnixMonth(unixTime, m_conf ? m_conf->monthStart() : 1)
: m_lastTrafMonth;
const bool isNewMonth = (trafMonth != m_lastTrafMonth);
m_lastTrafHour = trafHour;
m_lastTrafDay = trafDay;
m_lastTrafMonth = trafMonth;
// Initialize quotas traffic bytes
m_quotaManager->clear(isNewDay, isNewMonth);
m_sqliteDb->beginTransaction();
// Insert Statemets
@ -191,6 +225,9 @@ void DatabaseManager::logStatTraf(quint16 procCount, const quint8 *procBits,
// Update or insert total bytes
updateTrafficList(insertTrafStmts, updateTrafStmts,
inBytes, outBytes);
// Update quota traffic bytes
m_quotaManager->addTraf(inBytes);
}
}
@ -247,6 +284,10 @@ void DatabaseManager::logStatTraf(quint16 procCount, const quint8 *procBits,
m_appIds.removeAt(procIndex);
}
}
// Check quotas
m_quotaManager->checkQuotaDay(trafDay);
m_quotaManager->checkQuotaMonth(trafMonth);
}
void DatabaseManager::logClear()

View File

@ -7,6 +7,7 @@
#include <QVector>
QT_FORWARD_DECLARE_CLASS(FirewallConf)
QT_FORWARD_DECLARE_CLASS(QuotaManager)
QT_FORWARD_DECLARE_CLASS(SqliteDb)
QT_FORWARD_DECLARE_CLASS(SqliteStmt)
@ -16,6 +17,7 @@ class DatabaseManager : public QObject
public:
explicit DatabaseManager(const QString &filePath,
QuotaManager *quotaManager,
QObject *parent = nullptr);
virtual ~DatabaseManager();
@ -54,6 +56,8 @@ public slots:
private:
typedef QList<SqliteStmt *> QStmtList;
void initializeQuota();
bool createTables();
void clearStmts();
@ -86,6 +90,7 @@ private:
QString m_filePath;
QuotaManager *m_quotaManager;
const FirewallConf *m_conf;
SqliteDb *m_sqliteDb;

119
src/ui/db/quotamanager.cpp Normal file
View File

@ -0,0 +1,119 @@
#include "quotamanager.h"
#include "../fortsettings.h"
QuotaManager::QuotaManager(FortSettings *fortSettings,
QObject *parent) :
QObject(parent),
m_quotaDayAlerted(0),
m_quotaMonthAlerted(0),
m_quotaDayBytes(0),
m_quotaMonthBytes(0),
m_trafDayBytes(0),
m_trafMonthBytes(0),
m_fortSettings(fortSettings)
{
}
void QuotaManager::setQuotaDayBytes(qint64 bytes)
{
m_quotaDayBytes = bytes;
}
void QuotaManager::setQuotaMonthBytes(qint64 bytes)
{
m_quotaMonthBytes = bytes;
}
void QuotaManager::setTrafDayBytes(qint64 bytes)
{
m_trafDayBytes = bytes;
}
void QuotaManager::setTrafMonthBytes(qint64 bytes)
{
m_trafMonthBytes = bytes;
}
void QuotaManager::clear(bool clearDay, bool clearMonth)
{
if (clearDay) {
m_trafDayBytes = 0;
setQuotaDayAlerted(0);
}
if (clearMonth) {
m_trafMonthBytes = 0;
setQuotaMonthAlerted(0);
}
}
void QuotaManager::addTraf(qint64 bytes)
{
m_trafDayBytes += bytes;
m_trafMonthBytes += bytes;
}
void QuotaManager::checkQuotaDay(qint32 trafDay)
{
if (m_quotaDayBytes == 0)
return;
if (m_quotaDayAlerted == 0) {
m_quotaDayAlerted = quotaDayAlerted();
}
if (m_quotaDayAlerted == trafDay)
return;
if (m_trafDayBytes > m_quotaDayBytes) {
setQuotaDayAlerted(trafDay);
emit alert(tr("Day traffic quota exceeded!"));
}
}
void QuotaManager::checkQuotaMonth(qint32 trafMonth)
{
if (m_quotaMonthBytes == 0)
return;
if (m_quotaMonthAlerted == 0) {
m_quotaMonthAlerted = quotaMonthAlerted();
}
if (m_quotaMonthAlerted == trafMonth)
return;
if (m_trafMonthBytes > m_quotaMonthBytes) {
setQuotaMonthAlerted(trafMonth);
emit alert(tr("Month traffic quota exceeded!"));
}
}
qint32 QuotaManager::quotaDayAlerted() const
{
return m_fortSettings->quotaDayAlerted();
}
void QuotaManager::setQuotaDayAlerted(qint32 v)
{
m_quotaDayAlerted = v;
m_fortSettings->setQuotaDayAlerted(v);
}
qint32 QuotaManager::quotaMonthAlerted() const
{
return m_fortSettings->quotaMonthAlerted();
}
void QuotaManager::setQuotaMonthAlerted(qint32 v)
{
m_quotaMonthAlerted = v;
m_fortSettings->setQuotaMonthAlerted(v);
}

54
src/ui/db/quotamanager.h Normal file
View File

@ -0,0 +1,54 @@
#ifndef QUOTAMANAGER_H
#define QUOTAMANAGER_H
#include <QObject>
QT_FORWARD_DECLARE_CLASS(FortSettings)
class QuotaManager : public QObject
{
Q_OBJECT
public:
explicit QuotaManager(FortSettings *fortSettings,
QObject *parent = nullptr);
void setQuotaDayBytes(qint64 bytes);
void setQuotaMonthBytes(qint64 bytes);
void setTrafDayBytes(qint64 bytes);
void setTrafMonthBytes(qint64 bytes);
void clear(bool clearDay = true, bool clearMonth = true);
void addTraf(qint64 bytes);
void checkQuotaDay(qint32 trafDay);
void checkQuotaMonth(qint32 trafMonth);
signals:
void alert(const QString &text,
const QString &title = tr("Quota Alert"));
public slots:
private:
qint32 quotaDayAlerted() const;
void setQuotaDayAlerted(qint32 v);
qint32 quotaMonthAlerted() const;
void setQuotaMonthAlerted(qint32 v);
private:
qint32 m_quotaDayAlerted;
qint32 m_quotaMonthAlerted;
qint64 m_quotaDayBytes;
qint64 m_quotaMonthBytes;
qint64 m_trafDayBytes;
qint64 m_trafMonthBytes;
FortSettings *m_fortSettings;
};
#endif // QUOTAMANAGER_H

View File

@ -14,6 +14,7 @@
#include "conf/appgroup.h"
#include "conf/firewallconf.h"
#include "db/databasemanager.h"
#include "db/quotamanager.h"
#include "driver/drivermanager.h"
#include "fortsettings.h"
#include "log/logmanager.h"
@ -43,19 +44,22 @@ FortManager::FortManager(FortSettings *fortSettings,
m_fortSettings(fortSettings),
m_firewallConf(new FirewallConf(this)),
m_firewallConfToEdit(nullConf()),
m_databaseManager(new DatabaseManager(fortSettings->statFilePath(), this)),
m_quotaManager(new QuotaManager(fortSettings, this)),
m_databaseManager(new DatabaseManager(fortSettings->statFilePath(),
m_quotaManager, this)),
m_driverManager(new DriverManager(this)),
m_logManager(new LogManager(m_databaseManager,
m_driverManager->driverWorker(), this)),
m_taskManager(new TaskManager(this, this))
{
setupDriver();
setupDatabaseManager();
setupLogger();
setupLogManager();
loadSettings(m_firewallConf);
setupLogger();
m_taskManager->loadSettings(m_fortSettings);
TranslationManager::instance()->switchLanguageByName(
@ -125,6 +129,14 @@ void FortManager::closeDriver()
m_driverManager->closeDevice();
}
void FortManager::setupDatabaseManager()
{
m_databaseManager->initialize();
connect(m_quotaManager, &QuotaManager::alert,
this, &FortManager::showInfoBox);
}
void FortManager::setupLogger()
{
Logger *logger = Logger::instance();
@ -137,8 +149,6 @@ void FortManager::setupLogger()
void FortManager::setupLogManager()
{
m_databaseManager->initialize();
m_logManager->initialize();
m_logManager->setActive(true);
}

View File

@ -10,9 +10,10 @@ QT_FORWARD_DECLARE_CLASS(QSystemTrayIcon)
QT_FORWARD_DECLARE_CLASS(DatabaseManager)
QT_FORWARD_DECLARE_CLASS(DriverManager)
QT_FORWARD_DECLARE_CLASS(FortSettings)
QT_FORWARD_DECLARE_CLASS(FirewallConf)
QT_FORWARD_DECLARE_CLASS(FortSettings)
QT_FORWARD_DECLARE_CLASS(LogManager)
QT_FORWARD_DECLARE_CLASS(QuotaManager)
QT_FORWARD_DECLARE_CLASS(TaskManager)
QT_FORWARD_DECLARE_CLASS(WindowStateWatcher)
@ -77,6 +78,8 @@ private:
bool setupDriver();
void closeDriver();
void setupDatabaseManager();
void setupLogger();
void setupLogManager();
@ -125,6 +128,7 @@ private:
QAction *m_stopInetTrafficAction;
QList<QAction *> m_appGroupActions;
QuotaManager *m_quotaManager;
DatabaseManager *m_databaseManager;
DriverManager *m_driverManager;
LogManager *m_logManager;

View File

@ -232,6 +232,11 @@ bool FortSettings::readConfIni(FirewallConf &conf) const
conf.setTrafUnit(iniInt("trafUnit"));
m_ini->endGroup();
m_ini->beginGroup("quota");
conf.setQuotaDayMb(iniUInt("quotaDayMb"));
conf.setQuotaMonthMb(iniUInt("quotaMonthMb"));
m_ini->endGroup();
return true;
}
@ -259,6 +264,11 @@ bool FortSettings::writeConfIni(const FirewallConf &conf)
setIniValue("trafUnit", conf.trafUnit());
m_ini->endGroup();
m_ini->beginGroup("quota");
setIniValue("quotaDayMb", conf.quotaDayMb());
setIniValue("quotaMonthMb", conf.quotaMonthMb());
m_ini->endGroup();
removeMigratedKeys();
return iniSync();

View File

@ -48,6 +48,12 @@ public:
bool windowMaximized() const { return iniBool("window/maximized"); }
void setWindowMaximized(bool on) { setIniValue("window/maximized", on); }
qint32 quotaDayAlerted() const { return iniInt("quota/dayAlerted"); }
void setQuotaDayAlerted(qint32 v) { setIniValue("quota/dayAlerted", v); }
qint32 quotaMonthAlerted() const { return iniInt("quota/monthAlerted"); }
void setQuotaMonthAlerted(qint32 v) { setIniValue("quota/monthAlerted", v); }
QString updatesUrl() const { return APP_UPDATES_URL; }
bool startWithWindows() const;

Binary file not shown.

View File

@ -42,37 +42,37 @@
<context>
<name>FortManager</name>
<message>
<location filename="../fortmanager.cpp" line="250"/>
<location filename="../fortmanager.cpp" line="260"/>
<source>Password input</source>
<translation>Ввод пароля</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="250"/>
<location filename="../fortmanager.cpp" line="260"/>
<source>Please enter the password</source>
<translation>Наберите пароль пожалуйста</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="477"/>
<location filename="../fortmanager.cpp" line="487"/>
<source>Options</source>
<translation>Опции</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="483"/>
<location filename="../fortmanager.cpp" line="493"/>
<source>Filter Enabled</source>
<translation>Фильтр включен</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="487"/>
<location filename="../fortmanager.cpp" line="497"/>
<source>Stop Traffic</source>
<translation>Остановить трафик</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="491"/>
<location filename="../fortmanager.cpp" line="501"/>
<source>Stop Internet Traffic</source>
<translation>Остановить Интернет трафик</translation>
</message>
<message>
<location filename="../fortmanager.cpp" line="508"/>
<location filename="../fortmanager.cpp" line="518"/>
<source>Quit</source>
<translation>Выйти</translation>
</message>
@ -134,6 +134,24 @@
<translation>Некорректная маска</translation>
</message>
</context>
<context>
<name>QuotaManager</name>
<message>
<location filename="../db/quotamanager.cpp" line="74"/>
<source>Day traffic quota exceeded!</source>
<translation>Квота трафика на день исчерпана!</translation>
</message>
<message>
<location filename="../db/quotamanager.cpp" line="93"/>
<source>Month traffic quota exceeded!</source>
<translation>Квота трафика на месяц исчерпана!</translation>
</message>
<message>
<location filename="../db/quotamanager.h" line="30"/>
<source>Quota Alert</source>
<translation>Предупреждение о квоте трафика</translation>
</message>
</context>
<context>
<name>TaskInfo</name>
<message>
@ -440,12 +458,14 @@
<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/log/TrafOptionsButton.qml" line="50"/>
<location filename="../qml/pages/SchedulePage.qml" line="31"/>
<source>Custom</source>
<translation>Нестандартный</translation>
</message>
<message>
<location filename="../qml/pages/apps/SpeedLimitButton.qml" line="26"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="51"/>
<source>Disabled</source>
<translation>Отключено</translation>
</message>
@ -495,25 +515,35 @@
<translation>3 года</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="55"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="76"/>
<source>Month starts on:</source>
<translation>Месяц начинается с:</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="81"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="102"/>
<source>Keep days for &apos;Hourly&apos;:</source>
<translation>Хранить дней для &apos;Почасовая&apos;:</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="104"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="125"/>
<source>Keep days for &apos;Daily&apos;:</source>
<translation>Хранить дней для &apos;Ежедневная&apos;:</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="127"/>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="148"/>
<source>Keep months for &apos;Monthly&apos;:</source>
<translation>Хранить месяцев для &apos;Ежемесячная&apos;:</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="173"/>
<source>Day&apos;s Quota:</source>
<translation>Квота на день</translation>
</message>
<message>
<location filename="../qml/pages/log/TrafOptionsButton.qml" line="197"/>
<source>Month&apos;s Quota:</source>
<translation>Квота на месяц</translation>
</message>
<message>
<location filename="../qml/pages/SchedulePage.qml" line="32"/>
<source>Hourly</source>

View File

@ -54,9 +54,9 @@ ButtonPopup {
return text;
}
function formatSpeed(bytes) {
const prec = (bytes < 1024) ? 0 : 1;
return netUtil.formatDataSize(bytes * 1024, prec) + "/s";
function formatSpeed(kbytes) {
const prec = (kbytes < 1024) ? 0 : 1;
return netUtil.formatDataSize(kbytes * 1024, prec) + "/s";
}
ColumnLayout {

View File

@ -40,6 +40,27 @@ ButtonPopup {
qsTranslate("qml", "3 years")
]
readonly property var quotaValues: [
10, 0, 100, 500, 1024, 8 * 1024, 10 * 1024, 30 * 1024,
50 * 1024, 100 * 1024
]
readonly property var quotaNames: {
var list = translationManager.dummyBool
&& [qsTranslate("qml", "Custom"),
qsTranslate("qml", "Disabled")];
const n = quotaValues.length;
for (var i = list.length; i < n; ++i) {
list.push(formatQuota(quotaValues[i]));
}
return list;
}
function formatQuota(mbytes) {
return netUtil.formatDataSize(mbytes * 1024 * 1024, 1);
}
ColumnLayout {
SpinComboRow {
values: {
@ -140,5 +161,55 @@ ButtonPopup {
}
}
}
HSeparator {}
SpinComboRow {
names: quotaNames
values: quotaValues
checkBox {
indicator: null
text: translationManager.dummyBool
&& qsTranslate("qml", "Day's Quota:")
}
field {
from: 0
to: 999 * 1024
value: firewallConf.quotaDayMb
onValueChanged: {
const value = field.value;
if (firewallConf.quotaDayMb == value)
return;
firewallConf.quotaDayMb = value;
setConfFlagsEdited();
}
}
}
SpinComboRow {
names: quotaNames
values: quotaValues
checkBox {
indicator: null
text: translationManager.dummyBool
&& qsTranslate("qml", "Month's Quota:")
}
field {
from: 0
to: 999 * 1024
value: firewallConf.quotaMonthMb
onValueChanged: {
const value = field.value;
if (firewallConf.quotaMonthMb == value)
return;
firewallConf.quotaMonthMb = value;
setConfFlagsEdited();
}
}
}
}
}