mirror of
https://github.com/tnodir/fort
synced 2024-11-15 11:55:09 +00:00
UI: RuleEdit: Message on Global Rules count exceeded
This commit is contained in:
parent
732ae8be41
commit
9461d59c9a
@ -37,6 +37,11 @@ ConfRuleManager *RuleEditDialog::confRuleManager() const
|
|||||||
return ctrl()->confRuleManager();
|
return ctrl()->confRuleManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WindowManager *RuleEditDialog::windowManager() const
|
||||||
|
{
|
||||||
|
return ctrl()->windowManager();
|
||||||
|
}
|
||||||
|
|
||||||
void RuleEditDialog::initialize(const RuleRow &ruleRow)
|
void RuleEditDialog::initialize(const RuleRow &ruleRow)
|
||||||
{
|
{
|
||||||
m_ruleRow = ruleRow;
|
m_ruleRow = ruleRow;
|
||||||
@ -397,6 +402,7 @@ bool RuleEditDialog::validateFields() const
|
|||||||
const auto ruleType = Rule::RuleType(m_comboRuleType->currentIndex());
|
const auto ruleType = Rule::RuleType(m_comboRuleType->currentIndex());
|
||||||
if (ruleType == Rule::GlobalBeforeAppsRule || ruleType == Rule::GlobalAfterAppsRule) {
|
if (ruleType == Rule::GlobalBeforeAppsRule || ruleType == Rule::GlobalAfterAppsRule) {
|
||||||
if (confRuleManager()->rulesCountByType(ruleType) >= ConfUtil::ruleSetMaxCount()) {
|
if (confRuleManager()->rulesCountByType(ruleType) >= ConfUtil::ruleSetMaxCount()) {
|
||||||
|
windowManager()->showErrorBox(tr("Global rules count exceeded!"));
|
||||||
m_comboRuleType->setFocus();
|
m_comboRuleType->setFocus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ class PlainTextEdit;
|
|||||||
class Rule;
|
class Rule;
|
||||||
class RuleSetModel;
|
class RuleSetModel;
|
||||||
class RulesController;
|
class RulesController;
|
||||||
|
class WindowManager;
|
||||||
class ZonesSelector;
|
class ZonesSelector;
|
||||||
|
|
||||||
class RuleEditDialog : public QDialog
|
class RuleEditDialog : public QDialog
|
||||||
@ -31,6 +32,7 @@ public:
|
|||||||
RulesController *ctrl() const { return m_ctrl; }
|
RulesController *ctrl() const { return m_ctrl; }
|
||||||
RuleSetModel *ruleSetModel() const { return m_ruleSetModel; }
|
RuleSetModel *ruleSetModel() const { return m_ruleSetModel; }
|
||||||
ConfRuleManager *confRuleManager() const;
|
ConfRuleManager *confRuleManager() const;
|
||||||
|
WindowManager *windowManager() const;
|
||||||
|
|
||||||
bool isEmpty() const { return m_ruleRow.ruleId == 0; }
|
bool isEmpty() const { return m_ruleRow.ruleId == 0; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user