mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:25:18 +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();
|
||||
}
|
||||
|
||||
WindowManager *RuleEditDialog::windowManager() const
|
||||
{
|
||||
return ctrl()->windowManager();
|
||||
}
|
||||
|
||||
void RuleEditDialog::initialize(const RuleRow &ruleRow)
|
||||
{
|
||||
m_ruleRow = ruleRow;
|
||||
@ -397,6 +402,7 @@ bool RuleEditDialog::validateFields() const
|
||||
const auto ruleType = Rule::RuleType(m_comboRuleType->currentIndex());
|
||||
if (ruleType == Rule::GlobalBeforeAppsRule || ruleType == Rule::GlobalAfterAppsRule) {
|
||||
if (confRuleManager()->rulesCountByType(ruleType) >= ConfUtil::ruleSetMaxCount()) {
|
||||
windowManager()->showErrorBox(tr("Global rules count exceeded!"));
|
||||
m_comboRuleType->setFocus();
|
||||
return false;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ class PlainTextEdit;
|
||||
class Rule;
|
||||
class RuleSetModel;
|
||||
class RulesController;
|
||||
class WindowManager;
|
||||
class ZonesSelector;
|
||||
|
||||
class RuleEditDialog : public QDialog
|
||||
@ -31,6 +32,7 @@ public:
|
||||
RulesController *ctrl() const { return m_ctrl; }
|
||||
RuleSetModel *ruleSetModel() const { return m_ruleSetModel; }
|
||||
ConfRuleManager *confRuleManager() const;
|
||||
WindowManager *windowManager() const;
|
||||
|
||||
bool isEmpty() const { return m_ruleRow.ruleId == 0; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user