mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-11 14:44:15 +02:00
Fix cable numbering rule questions: per project, and a first rule counts
Two defects found while re-testing the cable management after the upstream merge, plus one change of intent for the numbering question. The question "define a cable numbering rule now?" kept its answer in the program settings, so saying no once silenced every project of the program -- the exact opposite of what it should do. The answer now travels with the project itself, stored on the <cable_autonums> element as ask_numbering_rule="false"; a file which does not hold the answer asks again, and taking the rule away in the project properties or in the numbering window brings the question back for that project alone. Read-only projects are no longer asked at all, since there is nowhere in them to define a rule. The numbering window could not hand out the first rule of a project: it drew the rule, worked the numbers out with it, and only wrote the rule into the project together with those numbers -- while the planning refused to run on a project which had no rule saved yet. The counters of a cable rule are kept under its fixed name anyway, so planning now falls back to that name when the project holds no rule yet: a rule which is being drawn in the window counts from the moment it is complete, and the first renumbering of a project works.
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QSettings>
|
||||
#include <QUndoStack>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -214,11 +213,9 @@ void CableNumberingDialog::removeRule()
|
||||
//No rule left, so the button which takes one away goes too. And
|
||||
//having just taken the rule away means numbering cables by hand
|
||||
//again: the question of defining one comes back the next time a
|
||||
//cable is drawn, so it is not held back any more.
|
||||
//cable is drawn, so it is not held back in this project any more.
|
||||
m_rule->setRuleRemovable(false);
|
||||
QSettings settings;
|
||||
settings.setValue(QStringLiteral("cable-management/ask_numbering_rule"),
|
||||
true);
|
||||
m_project->setCableAskNumbering(true);
|
||||
m_project->setModified(true);
|
||||
updateEnabling();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user