[qet] qet/qet: [4897] Link single element widget : use folio label/ ID switch for show or hide

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4897
Author:   scorpio810
Date:     2017-02-02 19:00:53 +0100 (Thu, 02 Feb 2017)
Log Message:
-----------
Link single element widget : use folio label/ID switch for show or hide
columns in the QTreeWidgetItem

Modified Paths:
--------------
    trunk/sources/ui/linksingleelementwidget.cpp

Modified: trunk/sources/ui/linksingleelementwidget.cpp
===================================================================
--- trunk/sources/ui/linksingleelementwidget.cpp	2017-02-02 10:01:40 UTC (rev 4896)
+++ trunk/sources/ui/linksingleelementwidget.cpp	2017-02-02 18:00:53 UTC (rev 4897)
@@ -207,6 +207,7 @@
 {
 	clearTreeWidget();
 	setUpHeaderLabels();
+	QSettings settings;
 	
 	if (m_element->linkType() == Element::Slave)
 	{
@@ -224,10 +225,15 @@
 			
 			if (Diagram *diag = elmt->diagram())
 			{
+			if (settings.value("genericpanel/folio", false).toBool()){
 				str_list << QString::number(diag->folioIndex() + 1);
+				}
+				else
+				{
 				autonum::sequentialNumbers seq;
 				QString F =autonum::AssignVariables::formulaToLabel(diag->border_and_titleblock.folio(), seq, diag, elmt);
 				str_list << F;
+				}
 				str_list << diag->convertPosition(elmt->scenePos()).toString();
 				str_list << diag->title();
 			}
@@ -241,7 +247,7 @@
 			m_qtwi_strl_hash.insert(qtwi, search_list);
 		}
 		
-		QSettings settings;
+
 		QVariant v = settings.value("link-element-widget/slave-state");
 		if(!v.isNull())
 			ui->m_tree_widget->header()->restoreState(v.toByteArray());
@@ -272,10 +278,15 @@
 			
 			if (Diagram *diag = elmt->diagram())
 			{
+			if (settings.value("genericpanel/folio", false).toBool()){
 				str_list << QString::number(diag->folioIndex() + 1);
+				}
+				else
+				{
 				autonum::sequentialNumbers seq;
 				QString F =autonum::AssignVariables::formulaToLabel(diag->border_and_titleblock.folio(), seq, diag, elmt);
 				str_list << F;
+				}
 				str_list << diag->convertPosition(elmt->scenePos()).toString();
 				str_list << diag->title();
 			}
@@ -384,11 +395,27 @@
 void LinkSingleElementWidget::setUpHeaderLabels()
 {
 	QStringList list;
-	if (m_element->linkType() == Element::Slave)
-		list << tr("Label") << tr("Commentaire") << tr("N° de folio") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
-	else if (m_element->linkType() & Element::AllReport)
-		list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("N° de folio") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
+	QSettings settings;
+	if (m_element->linkType() == Element::Slave){
+	if (settings.value("genericpanel/folio", false).toBool()){
+		list << tr("Label") << tr("Commentaire") << tr("N° de folio") << tr("Position") << tr("Titre de folio");
+		}
+		else
+		{
+		list << tr("Label") << tr("Commentaire") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
+		}
+	}
 	
+	if (m_element->linkType() & Element::AllReport){
+	if (settings.value("genericpanel/folio", false).toBool()){
+		list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("N° de folio") << tr("Position") << tr("Titre de folio");
+		}
+		else
+		{
+		list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
+		}
+	}
+	
 	ui->m_tree_widget->setHeaderLabels(list);
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/