[qet] [3371] Conductor: activate option "Don' t be subjected to the option one potential text per folio" |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3371
Author: blacksun
Date: 2014-10-12 11:29:41 +0200 (Sun, 12 Oct 2014)
Log Message:
-----------
Conductor: activate option "Don't be subjected to the option one potential text per folio"
Modified Paths:
--------------
trunk/sources/qetgraphicsitem/conductor.cpp
trunk/sources/ui/conductorpropertieswidget.ui
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2014-10-11 17:45:11 UTC (rev 3370)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2014-10-12 09:29:41 UTC (rev 3371)
@@ -1181,27 +1181,35 @@
* If text was moved by user, this function do nothing, except check if text is near conductor.
*/
void Conductor::calculateTextItemPosition() {
- if (!text_item || !diagram()) return;
+ if (!text_item || !diagram() || properties_.type != ConductorProperties::Multi) return;
if (diagram() -> defaultConductorProperties.m_one_text_per_folio == true) {
+
Conductor *longuest_conductor = longuestConductorInPotential(this);
//The longuest conductor isn't this conductor
//we call calculateTextItemPosition of the longuest conductor
if(longuest_conductor != this) {
longuest_conductor -> calculateTextItemPosition();
- return;
- }
+ //This isn't the longuest conductor, if option "m_no_one_text_per_folio" is false we return now
+ //else is true, that mean the text is visible, so we need to calcule position
+ if (properties_.m_no_one_text_per_folio == false) return;
- //At this point this conductor is the longuest conductor
- //we hide all text of conductor_list
- foreach (Conductor *c, relatedPotentialConductors(false)) {
- c -> textItem() -> setVisible(false);
+ } else {
+ //At this point this conductor is the longuest conductor
+ //we hide all text of conductor_list or setVisible according to the
+ //properties of current conductor if option "m_no_one_text_per_folio" is true
+ foreach (Conductor *c, relatedPotentialConductors(false)) {
+ if (c -> properties_.m_no_one_text_per_folio == false)
+ c -> textItem() -> setVisible(false);
+ else
+ c -> textItem() -> setVisible(c -> properties().m_show_text);
+ }
+ //Make sure text item is visible
+ text_item -> setVisible(true);
}
- //Make sure text item is visible
- text_item -> setVisible(true);
}
-
+
//position
if (text_item -> wasMovedByUser()) {
//Text field was moved by user :
Modified: trunk/sources/ui/conductorpropertieswidget.ui
===================================================================
--- trunk/sources/ui/conductorpropertieswidget.ui 2014-10-11 17:45:11 UTC (rev 3370)
+++ trunk/sources/ui/conductorpropertieswidget.ui 2014-10-12 09:29:41 UTC (rev 3371)
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>633</width>
- <height>461</height>
+ <height>470</height>
</rect>
</property>
<property name="windowTitle">
@@ -25,6 +25,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="m_multi_rb">
+ <property name="toolTip">
+ <string>Multifilaire</string>
+ </property>
<property name="text">
<string>Multifilaire</string>
</property>
@@ -71,7 +74,7 @@
<item>
<widget class="QSpinBox" name="m_text_size_sb">
<property name="toolTip">
- <string>taille</string>
+ <string>Taille du texte</string>
</property>
<property name="minimum">
<number>5</number>
@@ -83,6 +86,9 @@
</item>
<item>
<widget class="QCheckBox" name="m_show_text_cb">
+ <property name="toolTip">
+ <string>Texte visible</string>
+ </property>
<property name="text">
<string>Visible</string>
</property>
@@ -97,15 +103,21 @@
<layout class="QVBoxLayout" name="m_autonum_layout">
<item>
<widget class="QCheckBox" name="m_one_text_per_folio_cb">
+ <property name="toolTip">
+ <string>activer l'option un texte par potentiel</string>
+ </property>
<property name="text">
- <string>Afficher un seul texte par potentiel présent sur un folio. (expérimental)</string>
+ <string>Afficher un texte de potentiel par folio. (expérimental)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="m_no_one_text_per_folio_cb">
+ <property name="toolTip">
+ <string>Ne pas subir l'option un texte par potentiel</string>
+ </property>
<property name="text">
- <string>Ne pas subir l'option : afficher un seul texte par potentiel présent sur un folio. (Inactif)</string>
+ <string>Ne pas subir l'option : Afficher un texte de potentiel par folio. (expérimental)</string>
</property>
</widget>
</item>
@@ -150,6 +162,9 @@
</item>
<item>
<widget class="QRadioButton" name="m_single_rb">
+ <property name="toolTip">
+ <string>Unifilaire</string>
+ </property>
<property name="text">
<string>Unifilaire</string>
</property>
@@ -186,6 +201,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Nombre de phase</string>
+ </property>
<property name="minimum">
<number>1</number>
</property>
@@ -199,6 +217,9 @@
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="m_neutral_cb">
+ <property name="toolTip">
+ <string>Neutre</string>
+ </property>
<property name="text">
<string>neutre</string>
</property>
@@ -210,6 +231,9 @@
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="m_phase_cb">
+ <property name="toolTip">
+ <string>Phase</string>
+ </property>
<property name="text">
<string>phase</string>
</property>
@@ -221,6 +245,9 @@
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="m_phase_sb">
+ <property name="toolTip">
+ <string>Nombre de phase</string>
+ </property>
<property name="minimum">
<number>1</number>
</property>
@@ -241,6 +268,9 @@
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="m_earth_cb">
+ <property name="toolTip">
+ <string>Terre</string>
+ </property>
<property name="text">
<string>terre</string>
</property>
@@ -282,10 +312,17 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="2">
- <widget class="QComboBox" name="m_line_style_cb"/>
+ <widget class="QComboBox" name="m_line_style_cb">
+ <property name="toolTip">
+ <string>Style du conducteur</string>
+ </property>
+ </widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_6">
+ <property name="toolTip">
+ <string>Couleur du conducteur</string>
+ </property>
<property name="text">
<string>Couleur :</string>
</property>
@@ -293,13 +330,28 @@
</item>
<item row="1" column="2">
<widget class="QPushButton" name="m_color_pb">
+ <property name="toolTip">
+ <string>Couleur du conducteur</string>
+ </property>
+ <property name="accessibleName">
+ <string/>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
<property name="text">
<string/>
</property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_7">
+ <property name="toolTip">
+ <string>Style du conducteur</string>
+ </property>
<property name="text">
<string>Style :</string>
</property>