mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-12 15:14:12 +02:00
Warn with a pop-up, not a box, when a wires-per-terminal rule is turned on
Review of #1272: scorpio810 asked for a warning box for users; the inline
box added in 9a55939bb is replaced by a pop-up, as the element editor
gives for unnamed terminals. When OK in Settings > General or in Project
properties turns a rule on (a limit where there was none, or one wire
per folio report), a warning says the rules are experimental, may change
with settings to redo if wires and conductors become separate objects,
and can all be turned off in Settings > General. OK goes on. Changing a
limit that was already on, or turning rules off, shows nothing.
tst_wiringrules: when the warning is due (WiringRules::turnsRuleOn()).
Checked in the GUI from both pages, and that a plain OK shows nothing.
English for translators: "Warning"; "The wires-per-terminal rules are an
experimental feature. They count wires as QElectroTech represents them
today. They could change, and your settings need redoing, if wires and
conductors become separate objects in a future version. All these rules
can be turned off in Configure QElectroTech > General."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FPuYPS4T7QuEwjNu22rXD
This commit is contained in:
@@ -186,8 +186,13 @@ void ProjectMainConfigPage::applyProjectConf()
|
||||
wiring_rules.one_wire_per_report = one_wire_per_report_cb_ -> isChecked();
|
||||
}
|
||||
if (m_project -> projectWiringRules() != wiring_rules) {
|
||||
const WiringRules::Settings before = m_project -> wiringRules();
|
||||
m_project -> setWiringRules(wiring_rules);
|
||||
modified_project = true;
|
||||
if (WiringRules::masterEnabled()
|
||||
&& WiringRules::turnsRuleOn(before, m_project -> wiringRules())) {
|
||||
WiringRulesWarning::show(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (modified_project) {
|
||||
@@ -307,7 +312,6 @@ void ProjectMainConfigPage::initLayout()
|
||||
main_layout0 -> addSpacing(10);
|
||||
|
||||
QVBoxLayout *wiring_rules_layout = new QVBoxLayout(wiring_rules_gb_);
|
||||
wiring_rules_layout -> addWidget(WiringRulesWarning::create(wiring_rules_gb_));
|
||||
wiring_rules_layout -> addWidget(use_application_rules_cb_);
|
||||
QHBoxLayout *max_wires_layout = new QHBoxLayout();
|
||||
max_wires_layout -> addWidget(max_wires_label_);
|
||||
|
||||
Reference in New Issue
Block a user