mirror of
https://github.com/tnodir/fort
synced 2024-11-15 12:26:26 +00:00
UI: IniUser: Rename conn*() to stat*().
This commit is contained in:
parent
774aae6cdc
commit
887320e662
@ -71,9 +71,6 @@ public:
|
||||
}
|
||||
void setTrafMonthKeepMonths(int v) { setValue("stat/trafMonthKeepMonths", v); }
|
||||
|
||||
int trafUnit() const { return valueInt("stat/trafUnit"); }
|
||||
void setTrafUnit(int v) { setValue("stat/trafUnit", v); }
|
||||
|
||||
int allowedIpKeepCount() const
|
||||
{
|
||||
return valueInt("stat/allowedIpKeepCount", DEFAULT_LOG_IP_KEEP_COUNT);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "../../../appinfo/appinfocache.h"
|
||||
#include "../../../conf/confmanager.h"
|
||||
#include "../../../conf/firewallconf.h"
|
||||
#include "../../../fortmanager.h"
|
||||
#include "../../../fortsettings.h"
|
||||
@ -313,13 +314,13 @@ void StatisticsPage::setupTrafUnits()
|
||||
m_traphUnits = ControlUtil::createLabel();
|
||||
|
||||
m_comboTrafUnit = ControlUtil::createComboBox(QStringList(), [&](int index) {
|
||||
if (ini()->trafUnit() == index)
|
||||
if (iniUser()->statTrafUnit() == index)
|
||||
return;
|
||||
|
||||
ini()->setTrafUnit(index);
|
||||
iniUser()->setStatTrafUnit(index);
|
||||
updateTableTrafUnit();
|
||||
|
||||
setIniEdited();
|
||||
confManager()->saveIniUser();
|
||||
});
|
||||
}
|
||||
|
||||
@ -809,12 +810,12 @@ void StatisticsPage::updatePage()
|
||||
|
||||
void StatisticsPage::updateTrafUnit()
|
||||
{
|
||||
m_comboTrafUnit->setCurrentIndex(ini()->trafUnit());
|
||||
m_comboTrafUnit->setCurrentIndex(iniUser()->statTrafUnit());
|
||||
}
|
||||
|
||||
void StatisticsPage::updateTableTrafUnit()
|
||||
{
|
||||
const auto trafUnit = static_cast<TrafListModel::TrafUnit>(ini()->trafUnit());
|
||||
const auto trafUnit = static_cast<TrafListModel::TrafUnit>(iniUser()->statTrafUnit());
|
||||
|
||||
if (trafListModel()->unit() != trafUnit) {
|
||||
trafListModel()->setUnit(trafUnit);
|
||||
|
@ -268,11 +268,11 @@ void StatisticsWindow::setupLogBlockedIp()
|
||||
|
||||
void StatisticsWindow::setupAutoScroll()
|
||||
{
|
||||
m_cbAutoScroll = ControlUtil::createCheckBox(iniUser()->connAutoScroll(), [&](bool checked) {
|
||||
if (iniUser()->connAutoScroll() == checked)
|
||||
m_cbAutoScroll = ControlUtil::createCheckBox(iniUser()->statAutoScroll(), [&](bool checked) {
|
||||
if (iniUser()->statAutoScroll() == checked)
|
||||
return;
|
||||
|
||||
iniUser()->setConnAutoScroll(checked);
|
||||
iniUser()->setStatAutoScroll(checked);
|
||||
confManager()->saveIniUser();
|
||||
|
||||
syncAutoScroll();
|
||||
@ -282,11 +282,11 @@ void StatisticsWindow::setupAutoScroll()
|
||||
void StatisticsWindow::setupShowHostNames()
|
||||
{
|
||||
m_cbShowHostNames =
|
||||
ControlUtil::createCheckBox(iniUser()->connShowHostNames(), [&](bool checked) {
|
||||
if (iniUser()->connShowHostNames() == checked)
|
||||
ControlUtil::createCheckBox(iniUser()->statShowHostNames(), [&](bool checked) {
|
||||
if (iniUser()->statShowHostNames() == checked)
|
||||
return;
|
||||
|
||||
iniUser()->setConnShowHostNames(checked);
|
||||
iniUser()->setStatShowHostNames(checked);
|
||||
confManager()->saveIniUser();
|
||||
|
||||
syncShowHostNames();
|
||||
@ -364,7 +364,7 @@ void StatisticsWindow::setupTableConnsChanged()
|
||||
|
||||
void StatisticsWindow::syncAutoScroll()
|
||||
{
|
||||
if (iniUser()->connAutoScroll()) {
|
||||
if (iniUser()->statAutoScroll()) {
|
||||
connect(connListModel(), &QAbstractItemModel::rowsInserted, m_connListView,
|
||||
&QAbstractItemView::scrollToBottom);
|
||||
|
||||
@ -377,7 +377,7 @@ void StatisticsWindow::syncAutoScroll()
|
||||
|
||||
void StatisticsWindow::syncShowHostNames()
|
||||
{
|
||||
connListModel()->setResolveAddress(iniUser()->connShowHostNames());
|
||||
connListModel()->setResolveAddress(iniUser()->statShowHostNames());
|
||||
}
|
||||
|
||||
void StatisticsWindow::deleteConn(int row)
|
||||
|
@ -19,9 +19,9 @@ public:
|
||||
|
||||
QString hotKeyPrograms() const { return valueText("hotKey/programs"); }
|
||||
QString hotKeyOptions() const { return valueText("hotKey/options"); }
|
||||
QString hotKeyZones() const { return valueText("hotKey/zones"); }
|
||||
QString hotKeyStatistics() const { return valueText("hotKey/statistics"); }
|
||||
QString hotKeyGraph() const { return valueText("hotKey/graph"); }
|
||||
QString hotKeyConnections() const { return valueText("hotKey/connections"); }
|
||||
QString hotKeyZones() const { return valueText("hotKey/zones"); }
|
||||
QString hotKeyFilter() const { return valueText("hotKey/filter", "Ctrl+Alt+Shift+F"); }
|
||||
QString hotKeyStopTraffic() const { return valueText("hotKey/stopTraffic"); }
|
||||
QString hotKeyStopInetTraffic() const { return valueText("hotKey/stopInetTraffic"); }
|
||||
@ -86,23 +86,26 @@ public:
|
||||
bool graphWindowMaximized() const { return valueBool("graphWindow/maximized"); }
|
||||
void setGraphWindowMaximized(bool on) { setValue("graphWindow/maximized", on); }
|
||||
|
||||
QRect connWindowGeometry() const { return value("connWindow/geometry").toRect(); }
|
||||
void setConnWindowGeometry(const QRect &v) { setValue("connWindow/geometry", v); }
|
||||
QRect statWindowGeometry() const { return value("statWindow/geometry").toRect(); }
|
||||
void setStatWindowGeometry(const QRect &v) { setValue("statWindow/geometry", v); }
|
||||
|
||||
bool connWindowMaximized() const { return valueBool("connWindow/maximized"); }
|
||||
void setConnWindowMaximized(bool on) { setValue("connWindow/maximized", on); }
|
||||
bool statWindowMaximized() const { return valueBool("statWindow/maximized"); }
|
||||
void setStatWindowMaximized(bool on) { setValue("statWindow/maximized", on); }
|
||||
|
||||
int connListHeaderVersion() const { return valueInt("connWindow/connListHeaderVersion"); }
|
||||
void setConnListHeaderVersion(int v) { setValue("connWindow/connListHeaderVersion", v); }
|
||||
int statTrafUnit() const { return valueInt("statWindow/trafUnit"); }
|
||||
void setStatTrafUnit(int v) { setValue("statWindow/trafUnit", v); }
|
||||
|
||||
QByteArray connListHeader() const { return valueByteArray("connWindow/connListHeader"); }
|
||||
void setConnListHeader(const QByteArray &v) { setValue("connWindow/connListHeader", v); }
|
||||
int connListHeaderVersion() const { return valueInt("statWindow/connListHeaderVersion"); }
|
||||
void setConnListHeaderVersion(int v) { setValue("statWindow/connListHeaderVersion", v); }
|
||||
|
||||
bool connAutoScroll() const { return valueBool("connWindow/autoScroll"); }
|
||||
void setConnAutoScroll(bool on) { setValue("connWindow/autoScroll", on); }
|
||||
QByteArray connListHeader() const { return valueByteArray("statWindow/connListHeader"); }
|
||||
void setConnListHeader(const QByteArray &v) { setValue("statWindow/connListHeader", v); }
|
||||
|
||||
bool connShowHostNames() const { return valueBool("connWindow/showHostNames"); }
|
||||
void setConnShowHostNames(bool on) { setValue("connWindow/showHostNames", on); }
|
||||
bool statAutoScroll() const { return valueBool("statWindow/autoScroll"); }
|
||||
void setStatAutoScroll(bool on) { setValue("statWindow/autoScroll", on); }
|
||||
|
||||
bool statShowHostNames() const { return valueBool("statWindow/showHostNames"); }
|
||||
void setStatShowHostNames(bool on) { setValue("statWindow/showHostNames", on); }
|
||||
|
||||
private:
|
||||
QString m_defaultLanguage;
|
||||
|
Loading…
Reference in New Issue
Block a user