mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-03 18:44:13 +02:00
52c8ef6b49
Follows @scorpio810's review on PR #626 and three defects found by finally running the thing rather than only building it. Replace the "?" button with an editable value field, as asked for. It shows the current value of the context's counter -- the last part that actually progresses, i.e. the least significant digit -- and typing a new value and committing it writes that value back. This is strictly more useful than the button it replaces: "?" is still reachable by typing it, and any other value is now reachable too, which was the point of the request. It also removes a destructive edge the button had: "reset to ?" rewrote *every* part, so a scheme built as "K" + counter became "?????" and the configured prefix was gone for good. There is no undo command for numbering contexts. Two bugs fixed in the reset path itself: - The project was never marked modified. addConductorAutoNum() and friends are a plain insert into a QMap; they emit nothing and set no dirty flag, and the properties dialog that this code was modelled on calls setModified(true) separately afterwards. Without it the user resets a counter, closes the project, is not asked to save, and the reset is lost. Verified before the fix: projectWasModified() stayed false across a click. - A wrap part was reset to "1". A modulo part cycles over [0, modulus) -- the PLC addressing that motivated the feature runs %IX0.0..%IX0.31 -- so its starting value is 0, not 1. An empty value field is treated as "no change" rather than as an empty value, so clearing the box by accident cannot wipe a counter, and the field is refreshed from the context after every write and whenever the selected context changes.
182 lines
5.3 KiB
XML
182 lines
5.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>AutoNumberingDockWidget</class>
|
|
<widget class="QDockWidget" name="AutoNumberingDockWidget">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>388</width>
|
|
<height>335</height>
|
|
</rect>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>Sélection numérotation auto</string>
|
|
</property>
|
|
<widget class="QWidget" name="dockWidgetContents">
|
|
<layout class="QGridLayout" name="gridLayout">
|
|
<item row="3" column="1">
|
|
<widget class="QComboBox" name="m_element_cb"/>
|
|
</item>
|
|
<item row="4" column="0">
|
|
<widget class="QLabel" name="label_3">
|
|
<property name="text">
|
|
<string>Folio</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="1">
|
|
<widget class="QComboBox" name="m_conductor_cb"/>
|
|
</item>
|
|
<item row="2" column="2">
|
|
<widget class="QPushButton" name="m_conductor_reset_start_pb">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>24</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Réinitialiser à la valeur de départ</string>
|
|
</property>
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="../../../qelectrotech.qrc">
|
|
<normaloff>:/ico/16x16/view-refresh.png</normaloff>:/ico/16x16/view-refresh.png</iconset>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="3">
|
|
<widget class="QLineEdit" name="m_conductor_value_le">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>70</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Valeur actuelle du compteur. Saisir une nouvelle valeur et valider pour la modifier.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="0">
|
|
<widget class="QLabel" name="label">
|
|
<property name="text">
|
|
<string>Element</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="label_2">
|
|
<property name="text">
|
|
<string>Conducteur</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="2">
|
|
<widget class="QPushButton" name="m_element_reset_start_pb">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>24</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Réinitialiser à la valeur de départ</string>
|
|
</property>
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="../../../qelectrotech.qrc">
|
|
<normaloff>:/ico/16x16/view-refresh.png</normaloff>:/ico/16x16/view-refresh.png</iconset>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="3">
|
|
<widget class="QLineEdit" name="m_element_value_le">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>70</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Valeur actuelle du compteur. Saisir une nouvelle valeur et valider pour la modifier.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="4" column="1">
|
|
<widget class="QComboBox" name="m_folio_cb"/>
|
|
</item>
|
|
<item row="4" column="2">
|
|
<widget class="QPushButton" name="m_folio_reset_start_pb">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>24</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Réinitialiser à la valeur de départ</string>
|
|
</property>
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="../../../qelectrotech.qrc">
|
|
<normaloff>:/ico/16x16/view-refresh.png</normaloff>:/ico/16x16/view-refresh.png</iconset>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="4" column="3">
|
|
<widget class="QLineEdit" name="m_folio_value_le">
|
|
<property name="maximumSize">
|
|
<size>
|
|
<width>70</width>
|
|
<height>16777215</height>
|
|
</size>
|
|
</property>
|
|
<property name="toolTip">
|
|
<string>Valeur actuelle du compteur. Saisir une nouvelle valeur et valider pour la modifier.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="6" column="0">
|
|
<spacer name="verticalSpacer">
|
|
<property name="orientation">
|
|
<enum>Qt::Vertical</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>20</width>
|
|
<height>40</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
<item row="5" column="1">
|
|
<widget class="QPushButton" name="m_configure_pb">
|
|
<property name="toolTip">
|
|
<string>Configurer les règles d'auto numérotation</string>
|
|
</property>
|
|
<property name="text">
|
|
<string>Configurer</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="../../../qelectrotech.qrc">
|
|
<normaloff>:/ico/16x16/configure.png</normaloff>:/ico/16x16/configure.png</iconset>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
</widget>
|
|
<resources>
|
|
<include location="../../../qelectrotech.qrc"/>
|
|
</resources>
|
|
<connections/>
|
|
</ui>
|