From a42e7dc42225b3dd2649df6f1bc3a8498bf844ef Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 12 Oct 2014 09:29:41 +0000 Subject: [PATCH] Conductor: activate option "Don't be subjected to the option one potential text per folio" git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3371 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetgraphicsitem/conductor.cpp | 28 +++++++---- sources/ui/conductorpropertieswidget.ui | 62 +++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 15 deletions(-) diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 942254d16..adeca35c7 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1181,27 +1181,35 @@ QPointF Conductor::posForText(Qt::Orientations &flag) { * 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 : diff --git a/sources/ui/conductorpropertieswidget.ui b/sources/ui/conductorpropertieswidget.ui index d470e4def..9ab9b4bb0 100644 --- a/sources/ui/conductorpropertieswidget.ui +++ b/sources/ui/conductorpropertieswidget.ui @@ -7,7 +7,7 @@ 0 0 633 - 461 + 470 @@ -25,6 +25,9 @@ + + Multifilaire + Multifilaire @@ -71,7 +74,7 @@ - taille + Taille du texte 5 @@ -83,6 +86,9 @@ + + Texte visible + Visible @@ -97,15 +103,21 @@ + + activer l'option un texte par potentiel + - Afficher un seul texte par potentiel présent sur un folio. (expérimental) + Afficher un texte de potentiel par folio. (expérimental) + + Ne pas subir l'option un texte par potentiel + - Ne pas subir l'option : afficher un seul texte par potentiel présent sur un folio. (Inactif) + Ne pas subir l'option : Afficher un texte de potentiel par folio. (expérimental) @@ -150,6 +162,9 @@ + + Unifilaire + Unifilaire @@ -186,6 +201,9 @@ 0 + + Nombre de phase + 1 @@ -199,6 +217,9 @@ + + Neutre + neutre @@ -210,6 +231,9 @@ + + Phase + phase @@ -221,6 +245,9 @@ + + Nombre de phase + 1 @@ -241,6 +268,9 @@ + + Terre + terre @@ -282,10 +312,17 @@ - + + + Style du conducteur + + + + Couleur du conducteur + Couleur : @@ -293,13 +330,28 @@ + + Couleur du conducteur + + + + + + false + + + false + + + Style du conducteur + Style :