UI: Rename "Stop ..." to "Block ..."

This commit is contained in:
Nodir Temirkhodjaev 2023-07-23 14:26:55 +03:00
parent 49fb5cb2f9
commit fc95cd7f74
15 changed files with 82 additions and 81 deletions

View File

@ -25,8 +25,8 @@ typedef struct fort_conf_flags
UINT32 filter_enabled : 1;
UINT32 filter_locals : 1;
UINT32 stop_traffic : 1;
UINT32 stop_inet_traffic : 1;
UINT32 block_traffic : 1;
UINT32 block_inet_traffic : 1;
UINT32 allow_all_new : 1;
UINT32 ask_to_connect : 1;

View File

@ -229,7 +229,7 @@ inline static void fort_callout_ale_log(PCFORT_CALLOUT_ARG ca, PFORT_CALLOUT_ALE
inline static BOOL fort_callout_ale_check_filter_flags(PCFORT_CALLOUT_ARG ca,
PFORT_CALLOUT_ALE_EXTRA cx, PFORT_CONF_REF conf_ref, FORT_CONF_FLAGS conf_flags)
{
if (conf_flags.stop_traffic) {
if (conf_flags.block_traffic) {
cx->blocked = TRUE; /* block all */
return TRUE;
}
@ -241,7 +241,7 @@ inline static BOOL fort_callout_ale_check_filter_flags(PCFORT_CALLOUT_ARG ca,
return TRUE;
}
if (conf_flags.stop_inet_traffic) {
if (conf_flags.block_inet_traffic) {
cx->blocked = TRUE; /* block Internet */
return TRUE;
}

View File

@ -13,8 +13,8 @@ FirewallConf::FirewallConf(Settings *settings, QObject *parent) :
m_bootFilter(false),
m_filterEnabled(true),
m_filterLocals(false),
m_stopTraffic(false),
m_stopInetTraffic(false),
m_blockTraffic(false),
m_blockInetTraffic(false),
m_allowAllNew(false),
m_askToConnect(false),
m_logStat(false),
@ -51,14 +51,14 @@ void FirewallConf::setFilterLocals(bool filterLocals)
m_filterLocals = filterLocals;
}
void FirewallConf::setStopTraffic(bool stopTraffic)
void FirewallConf::setBlockTraffic(bool blockTraffic)
{
m_stopTraffic = stopTraffic;
m_blockTraffic = blockTraffic;
}
void FirewallConf::setStopInetTraffic(bool stopInetTraffic)
void FirewallConf::setBlockInetTraffic(bool blockInetTraffic)
{
m_stopInetTraffic = stopInetTraffic;
m_blockInetTraffic = blockInetTraffic;
}
void FirewallConf::setAllowAllNew(bool allowAllNew)
@ -328,8 +328,8 @@ void FirewallConf::copyFlags(const FirewallConf &o)
m_bootFilter = o.bootFilter();
m_filterEnabled = o.filterEnabled();
m_filterLocals = o.filterLocals();
m_stopTraffic = o.stopTraffic();
m_stopInetTraffic = o.stopInetTraffic();
m_blockTraffic = o.blockTraffic();
m_blockInetTraffic = o.blockInetTraffic();
m_allowAllNew = o.allowAllNew();
m_askToConnect = o.askToConnect();
@ -376,8 +376,8 @@ QVariant FirewallConf::flagsToVariant() const
map["bootFilter"] = bootFilter();
map["filterEnabled"] = filterEnabled();
map["filterLocals"] = filterLocals();
map["stopTraffic"] = stopTraffic();
map["stopInetTraffic"] = stopInetTraffic();
map["blockTraffic"] = blockTraffic();
map["blockInetTraffic"] = blockInetTraffic();
map["allowAllNew"] = allowAllNew();
map["askToConnect"] = askToConnect();
@ -408,8 +408,8 @@ void FirewallConf::flagsFromVariant(const QVariant &v)
m_bootFilter = map["bootFilter"].toBool();
m_filterEnabled = map["filterEnabled"].toBool();
m_filterLocals = map["filterLocals"].toBool();
m_stopTraffic = map["stopTraffic"].toBool();
m_stopInetTraffic = map["stopInetTraffic"].toBool();
m_blockTraffic = map["blockTraffic"].toBool();
m_blockInetTraffic = map["blockInetTraffic"].toBool();
m_allowAllNew = map["allowAllNew"].toBool();
m_askToConnect = map["askToConnect"].toBool();

View File

@ -52,11 +52,11 @@ public:
bool filterLocals() const { return m_filterLocals; }
void setFilterLocals(bool filterLocals);
bool stopTraffic() const { return m_stopTraffic; }
void setStopTraffic(bool stopTraffic);
bool blockTraffic() const { return m_blockTraffic; }
void setBlockTraffic(bool blockTraffic);
bool stopInetTraffic() const { return m_stopInetTraffic; }
void setStopInetTraffic(bool stopInetTraffic);
bool blockInetTraffic() const { return m_blockInetTraffic; }
void setBlockInetTraffic(bool blockInetTraffic);
bool allowAllNew() const { return m_allowAllNew; }
void setAllowAllNew(bool allowAllNew);
@ -175,8 +175,8 @@ private:
uint m_bootFilter : 1;
uint m_filterEnabled : 1;
uint m_filterLocals : 1;
uint m_stopTraffic : 1;
uint m_stopInetTraffic : 1;
uint m_blockTraffic : 1;
uint m_blockInetTraffic : 1;
uint m_allowAllNew : 1;
uint m_askToConnect : 1;

View File

@ -63,8 +63,8 @@ public:
int quotaMonthMb() const { return valueInt("quota/quotaMonthMb"); }
void setQuotaMonthMb(int v) { setValue("quota/quotaMonthMb", v); }
bool quotaStopInetTraffic() const { return valueBool("quota/stopInetTraffic"); }
void setQuotaStopInternet(bool v) { setValue("quota/stopInetTraffic", v); }
bool quotaBlockInetTraffic() const { return valueBool("quota/blockInetTraffic"); }
void setQuotaBlockInternet(bool v) { setValue("quota/blockInetTraffic", v); }
int monthStart() const { return valueInt("stat/monthStart", DEFAULT_MONTH_START); }
void setMonthStart(int v) { setValue("stat/monthStart", v); }

View File

@ -163,13 +163,13 @@ void OptionsPage::onRetranslateUi()
m_cbService->setText(tr("Run Fort Firewall as a Service in background"));
m_cbFilterEnabled->setText(tr("Filter Enabled"));
m_cbStopTraffic->setText(tr("Stop Traffic"));
m_cbStopInetTraffic->setText(tr("Stop Internet Traffic"));
m_cbBlockTraffic->setText(tr("Block All Traffic"));
m_cbBlockInetTraffic->setText(tr("Block Internet Traffic"));
m_labelFilterMode->setText(tr("Filter Mode:"));
retranslateComboFilterMode();
m_cbBootFilter->setText(tr("Stop traffic when Fort Firewall is not running"));
m_cbBootFilter->setText(tr("Block traffic when Fort Firewall is not running"));
m_cbFilterLocals->setText(tr("Filter Local Addresses"));
m_cbFilterLocals->setToolTip(
tr("Filter Local Loopback (127.0.0.0/8) and Broadcast (255.255.255.255) Addresses"));
@ -294,8 +294,8 @@ void OptionsPage::retranslateComboTrayAction()
// Sync with TrayIcon::ActionType
const QStringList list = { tr("Show My Fort"), tr("Show Programs"), tr("Show Options"),
tr("Show Statistics"), tr("Show/Hide Traffic Graph"), tr("Switch Filter Enabled"),
tr("Switch Stop Traffic"), tr("Switch Stop Internet Traffic"), tr("Show Filter Mode Menu"),
tr("Show Tray Menu"), tr("Ignore") };
tr("Switch Block All Traffic"), tr("Switch Block Internet Traffic"),
tr("Show Filter Mode Menu"), tr("Show Tray Menu"), tr("Ignore") };
m_comboTrayAction->clear();
m_comboTrayAction->addItems(list);
@ -392,21 +392,22 @@ void OptionsPage::setupTrafficBox()
conf()->setFilterEnabled(checked);
ctrl()->setFlagsEdited();
});
m_cbStopTraffic = ControlUtil::createCheckBox(conf()->stopTraffic(), [&](bool checked) {
conf()->setStopTraffic(checked);
ctrl()->setFlagsEdited();
});
m_cbStopInetTraffic = ControlUtil::createCheckBox(conf()->stopInetTraffic(), [&](bool checked) {
conf()->setStopInetTraffic(checked);
m_cbBlockTraffic = ControlUtil::createCheckBox(conf()->blockTraffic(), [&](bool checked) {
conf()->setBlockTraffic(checked);
ctrl()->setFlagsEdited();
});
m_cbBlockInetTraffic =
ControlUtil::createCheckBox(conf()->blockInetTraffic(), [&](bool checked) {
conf()->setBlockInetTraffic(checked);
ctrl()->setFlagsEdited();
});
auto filterModeLayout = setupFilterModeLayout();
auto layout = new QVBoxLayout();
layout->addWidget(m_cbFilterEnabled);
layout->addWidget(m_cbStopTraffic);
layout->addWidget(m_cbStopInetTraffic);
layout->addWidget(m_cbBlockTraffic);
layout->addWidget(m_cbBlockInetTraffic);
layout->addLayout(filterModeLayout);
m_gbTraffic = new QGroupBox();

View File

@ -82,8 +82,8 @@ private:
QComboBox *m_comboAutoRun = nullptr;
QCheckBox *m_cbService = nullptr;
QCheckBox *m_cbFilterEnabled = nullptr;
QCheckBox *m_cbStopTraffic = nullptr;
QCheckBox *m_cbStopInetTraffic = nullptr;
QCheckBox *m_cbBlockTraffic = nullptr;
QCheckBox *m_cbBlockInetTraffic = nullptr;
QLabel *m_labelFilterMode = nullptr;
QComboBox *m_comboFilterMode = nullptr;
QCheckBox *m_cbBootFilter = nullptr;

View File

@ -61,7 +61,7 @@ void StatisticsPage::onRetranslateUi()
m_lscQuotaDayMb->label()->setText(tr("Day's Quota:"));
m_lscQuotaMonthMb->label()->setText(tr("Month's Quota:"));
m_cbQuotaStopInternet->setText(tr("Stop Internet traffic when quota exceeds"));
m_cbQuotaBlockInternet->setText(tr("Block Internet traffic when quota exceeds"));
m_cbLogBlockedIp->setText(tr("Collect blocked connections"));
m_cbLogAlertedBlockedIp->setText(tr("Alerted only"));
@ -166,7 +166,7 @@ void StatisticsPage::setupTrafficBox()
{ m_cbLogStat, m_cbLogStatNoFilter, m_ctpActivePeriod, m_lscMonthStart,
ControlUtil::createSeparator(), m_lscTrafHourKeepDays, m_lscTrafDayKeepDays,
m_lscTrafMonthKeepMonths, ControlUtil::createSeparator(), m_lscQuotaDayMb,
m_lscQuotaMonthMb, m_cbQuotaStopInternet });
m_lscQuotaMonthMb, m_cbQuotaBlockInternet });
m_gbTraffic = new QGroupBox();
m_gbTraffic->setLayout(layout);
@ -288,10 +288,10 @@ void StatisticsPage::setupQuota()
}
});
m_cbQuotaStopInternet =
ControlUtil::createCheckBox(ini()->quotaStopInetTraffic(), [&](bool checked) {
if (ini()->quotaStopInetTraffic() != checked) {
ini()->setQuotaStopInternet(checked);
m_cbQuotaBlockInternet =
ControlUtil::createCheckBox(ini()->quotaBlockInetTraffic(), [&](bool checked) {
if (ini()->quotaBlockInetTraffic() != checked) {
ini()->setQuotaBlockInternet(checked);
ctrl()->setIniEdited();
}
});

View File

@ -50,7 +50,7 @@ private:
LabelSpinCombo *m_lscTrafMonthKeepMonths = nullptr;
LabelSpinCombo *m_lscQuotaDayMb = nullptr;
LabelSpinCombo *m_lscQuotaMonthMb = nullptr;
QCheckBox *m_cbQuotaStopInternet = nullptr;
QCheckBox *m_cbQuotaBlockInternet = nullptr;
QCheckBox *m_cbLogBlockedIp = nullptr;
QCheckBox *m_cbLogAlertedBlockedIp = nullptr;
LabelSpinCombo *m_lscBlockedIpKeepCount = nullptr;

View File

@ -40,8 +40,8 @@ const QString actionShowOptions = QStringLiteral("Options");
const QString actionShowStatistics = QStringLiteral("Statistics");
const QString actionShowTrafficGraph = QStringLiteral("TrafficGraph");
const QString actionSwitchFilterEnabled = QStringLiteral("FilterEnabled");
const QString actionSwitchStopTraffic = QStringLiteral("StopTraffic");
const QString actionSwitchStopInetTraffic = QStringLiteral("StopInetTraffic");
const QString actionSwitchBlockTraffic = QStringLiteral("BlockTraffic");
const QString actionSwitchBlockInetTraffic = QStringLiteral("BlockInetTraffic");
const QString actionShowFilterModeMenu = QStringLiteral("FilterModeMenu");
const QString actionShowTrayMenu = QStringLiteral("TrayMenu");
const QString actionIgnore = QStringLiteral("Ignore");
@ -75,8 +75,8 @@ QString actionNameByType(TrayIcon::ActionType actionType)
actionShowStatistics,
actionShowTrafficGraph,
actionSwitchFilterEnabled,
actionSwitchStopTraffic,
actionSwitchStopInetTraffic,
actionSwitchBlockTraffic,
actionSwitchBlockInetTraffic,
actionShowFilterModeMenu,
actionShowTrayMenu,
actionIgnore,
@ -98,8 +98,8 @@ TrayIcon::ActionType actionTypeByName(const QString &name)
{ actionShowStatistics, TrayIcon::ActionShowStatistics },
{ actionShowTrafficGraph, TrayIcon::ActionShowTrafficGraph },
{ actionSwitchFilterEnabled, TrayIcon::ActionSwitchFilterEnabled },
{ actionSwitchStopTraffic, TrayIcon::ActionSwitchStopTraffic },
{ actionSwitchStopInetTraffic, TrayIcon::ActionSwitchStopInetTraffic },
{ actionSwitchBlockTraffic, TrayIcon::ActionSwitchBlockTraffic },
{ actionSwitchBlockInetTraffic, TrayIcon::ActionSwitchBlockInetTraffic },
{ actionShowFilterModeMenu, TrayIcon::ActionShowFilterModeMenu },
{ actionShowTrayMenu, TrayIcon::ActionShowTrayMenu },
{ actionIgnore, TrayIcon::ActionIgnore }
@ -328,8 +328,8 @@ void TrayIcon::retranslateUi()
m_graphAction->setText(tr("Traffic Graph"));
m_filterEnabledAction->setText(tr("Filter Enabled"));
m_stopTrafficAction->setText(tr("Stop Traffic"));
m_stopInetTrafficAction->setText(tr("Stop Internet Traffic"));
m_blockTrafficAction->setText(tr("Block All Traffic"));
m_blockInetTrafficAction->setText(tr("Block Internet Traffic"));
m_filterModeMenu->setTitle(tr("Filter Mode"));
retranslateFilterModeActions();
@ -381,11 +381,11 @@ void TrayIcon::setupTrayMenu()
m_filterEnabledAction = addAction(m_menu, QString(), this, SLOT(switchTrayFlag(bool)), true);
addHotKey(m_filterEnabledAction, iniUser()->hotKeyFilter());
m_stopTrafficAction = addAction(m_menu, QString(), this, SLOT(switchTrayFlag(bool)), true);
addHotKey(m_stopTrafficAction, iniUser()->hotKeyStopTraffic());
m_blockTrafficAction = addAction(m_menu, QString(), this, SLOT(switchTrayFlag(bool)), true);
addHotKey(m_blockTrafficAction, iniUser()->hotKeyBlockTraffic());
m_stopInetTrafficAction = addAction(m_menu, QString(), this, SLOT(switchTrayFlag(bool)), true);
addHotKey(m_stopInetTrafficAction, iniUser()->hotKeyStopInetTraffic());
m_blockInetTrafficAction = addAction(m_menu, QString(), this, SLOT(switchTrayFlag(bool)), true);
addHotKey(m_blockInetTrafficAction, iniUser()->hotKeyBlockInetTraffic());
m_filterModeMenuAction = addAction(m_menu, QString(), this, SLOT(switchFilterModeMenu(bool)));
m_filterModeMenuAction->setVisible(false);
@ -478,11 +478,11 @@ void TrayIcon::updateTrayMenuFlags()
m_filterEnabledAction->setEnabled(editEnabled);
m_filterEnabledAction->setChecked(conf()->filterEnabled());
m_stopTrafficAction->setEnabled(editEnabled);
m_stopTrafficAction->setChecked(conf()->stopTraffic());
m_blockTrafficAction->setEnabled(editEnabled);
m_blockTrafficAction->setChecked(conf()->blockTraffic());
m_stopInetTrafficAction->setEnabled(editEnabled);
m_stopInetTrafficAction->setChecked(conf()->stopInetTraffic());
m_blockInetTrafficAction->setEnabled(editEnabled);
m_blockInetTrafficAction->setChecked(conf()->blockInetTraffic());
m_filterModeMenu->setEnabled(editEnabled);
{
@ -556,7 +556,7 @@ void TrayIcon::updateTrayIconShape()
if (!conf()->filterEnabled() || !driverManager()->isDeviceOpened()) {
mainIconPath = ":/icons/fort_gray.png";
} else if (conf()->stopTraffic() || conf()->stopInetTraffic()) {
} else if (conf()->blockTraffic() || conf()->blockInetTraffic()) {
mainIconPath = ":/icons/fort_red.png";
} else {
mainIconPath = ":/icons/fort.png";
@ -573,8 +573,8 @@ void TrayIcon::updateTrayIconShape()
void TrayIcon::saveTrayFlags()
{
conf()->setFilterEnabled(m_filterEnabledAction->isChecked());
conf()->setStopTraffic(m_stopTrafficAction->isChecked());
conf()->setStopInetTraffic(m_stopInetTrafficAction->isChecked());
conf()->setBlockTraffic(m_blockTrafficAction->isChecked());
conf()->setBlockInetTraffic(m_blockInetTrafficAction->isChecked());
// Set Filter Mode
{
@ -717,8 +717,8 @@ QAction *TrayIcon::clickActionByType(TrayIcon::ActionType actionType) const
m_statisticsAction,
m_graphAction,
m_filterEnabledAction,
m_stopTrafficAction,
m_stopInetTrafficAction,
m_blockTrafficAction,
m_blockInetTrafficAction,
m_filterModeMenuAction,
m_trayMenuAction,
};

View File

@ -40,8 +40,8 @@ public:
ActionShowStatistics,
ActionShowTrafficGraph,
ActionSwitchFilterEnabled,
ActionSwitchStopTraffic,
ActionSwitchStopInetTraffic,
ActionSwitchBlockTraffic,
ActionSwitchBlockInetTraffic,
ActionShowFilterModeMenu,
ActionShowTrayMenu,
ActionIgnore,
@ -139,8 +139,8 @@ private:
QAction *m_graphAction = nullptr;
QAction *m_zonesAction = nullptr;
QAction *m_filterEnabledAction = nullptr;
QAction *m_stopTrafficAction = nullptr;
QAction *m_stopInetTrafficAction = nullptr;
QAction *m_blockTrafficAction = nullptr;
QAction *m_blockInetTrafficAction = nullptr;
QAction *m_filterModeMenuAction = nullptr;
QMenu *m_filterModeMenu = nullptr;
QActionGroup *m_filterModeActions = nullptr;

View File

@ -322,8 +322,8 @@ void FortSettings::readConfIni(FirewallConf &conf) const
conf.setBootFilter(iniBool("bootFilter"));
conf.setFilterEnabled(iniBool("filterEnabled", true));
conf.setFilterLocals(iniBool("filterLocals"));
conf.setStopTraffic(iniBool("stopTraffic"));
conf.setStopInetTraffic(iniBool("stopInetTraffic"));
conf.setBlockTraffic(iniBool("blockTraffic"));
conf.setBlockInetTraffic(iniBool("blockInetTraffic"));
conf.setAllowAllNew(iniBool("allowAllNew", true));
conf.setAskToConnect(iniBool("askToConnect"));
conf.setLogStat(iniBool("logStat", true));
@ -364,8 +364,8 @@ void FortSettings::writeConfIni(const FirewallConf &conf)
setIniValue("bootFilter", conf.bootFilter());
setIniValue("filterEnabled", conf.filterEnabled());
setIniValue("filterLocals", conf.filterLocals());
setIniValue("stopTraffic", conf.stopTraffic());
setIniValue("stopInetTraffic", conf.stopInetTraffic());
setIniValue("blockTraffic", conf.blockTraffic());
setIniValue("blockInetTraffic", conf.blockInetTraffic());
setIniValue("allowAllNew", conf.allowAllNew());
setIniValue("askToConnect", conf.askToConnect());
setIniValue("logStat", conf.logStat());

View File

@ -173,8 +173,8 @@ void QuotaManager::processQuotaExceed(AlertType alertType)
auto confManager = IoC<ConfManager>();
FirewallConf *conf = confManager->conf();
if (conf->ini().quotaStopInetTraffic() && !conf->stopInetTraffic()) {
conf->setStopInetTraffic(true);
if (conf->ini().quotaBlockInetTraffic() && !conf->blockInetTraffic()) {
conf->setBlockInetTraffic(true);
confManager->saveFlags();
}

View File

@ -31,8 +31,8 @@ public:
QString hotKeyGraph() const { return valueText("hotKey/graph"); }
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"); }
QString hotKeyBlockTraffic() const { return valueText("hotKey/blockTraffic"); }
QString hotKeyBlockInetTraffic() const { return valueText("hotKey/blockInetTraffic"); }
QString hotKeyAppGroupModifiers() const
{
return valueText("hotKey/appGroupModifiers", "Ctrl+Alt+Shift");

View File

@ -57,8 +57,8 @@ void writeConfFlags(const FirewallConf &conf, PFORT_CONF_FLAGS confFlags)
confFlags->boot_filter = conf.bootFilter();
confFlags->filter_enabled = conf.filterEnabled();
confFlags->filter_locals = conf.filterLocals();
confFlags->stop_traffic = conf.stopTraffic();
confFlags->stop_inet_traffic = conf.stopInetTraffic();
confFlags->block_traffic = conf.blockTraffic();
confFlags->block_inet_traffic = conf.blockInetTraffic();
confFlags->allow_all_new = conf.allowAllNew();
confFlags->ask_to_connect = conf.askToConnect();