[qet] [4592] Creation of folio sequential type for Element Autonumbering.

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


Revision: 4592
Author:   dfochi
Date:     2016-07-26 20:52:49 +0200 (Tue, 26 Jul 2016)
Log Message:
-----------
Creation of folio sequential type for Element Autonumbering. Correction of autonumbering type handling in numparteditorw.cpp

Modified Paths:
--------------
    trunk/sources/diagram.cpp
    trunk/sources/diagram.h
    trunk/sources/diagramevent/diagrameventaddelement.cpp
    trunk/sources/numerotationcontext.cpp
    trunk/sources/numerotationcontext.h
    trunk/sources/numerotationcontextcommands.cpp
    trunk/sources/numerotationcontextcommands.h
    trunk/sources/projectview.cpp
    trunk/sources/qetdiagrameditor.cpp
    trunk/sources/qetgraphicsitem/element.cpp
    trunk/sources/qetgraphicsitem/element.h
    trunk/sources/qetproject.cpp
    trunk/sources/qetproject.h
    trunk/sources/ui/autonumberingdockwidget.cpp
    trunk/sources/ui/numparteditorw.cpp
    trunk/sources/ui/numparteditorw.h
    trunk/sources/ui/numparteditorw.ui
    trunk/sources/ui/selectautonumw.cpp

Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/diagram.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -1,4 +1,4 @@
-/*
+/*
 	Copyright 2006-2016 The QElectroTech Team
 	This file is part of QElectroTech.
 	
@@ -37,6 +37,7 @@
 #include "qetapp.h"
 #include "elementcollectionhandler.h"
 #include "element.h"
+#include "diagramview.h"
 
 const int   Diagram::xGrid  = 10;
 const int   Diagram::yGrid  = 10;
@@ -79,6 +80,7 @@
 	connect(&border_and_titleblock, SIGNAL(diagramTitleChanged(const QString &)),    this, SLOT(titleChanged(const QString &)));
 	connect(&border_and_titleblock, SIGNAL(borderChanged(QRectF,QRectF)), this, SLOT(adjustSceneRect()));
 	connect(&border_and_titleblock, SIGNAL(titleBlockFolioChanged()), this, SLOT(updateLabels()));
+	connect(this, SIGNAL (diagramActivated()), this, SLOT(loadElmtFolioSeq()));
 	adjustSceneRect();
 }
 
@@ -473,6 +475,28 @@
 
 		//Default New Element
 		racine.setAttribute("freezeNewElement", m_freeze_new_elements_ ? "true" : "false");
+
+		//Folio Sequential Variables
+		if (!m_elmt_unitfolio_max.isEmpty() || !m_elmt_tenfolio_max.isEmpty() || !m_elmt_hundredfolio_max.isEmpty()) {
+			QDomElement folioContainedAutonum = document.createElement("elementautonumfoliosequentials");
+			QHash<QString, QStringList>::iterator i;
+			if (!m_elmt_unitfolio_max.isEmpty()) {
+				QDomElement elmtfolioseq = document.createElement("elementunitfolioseq");
+				elementFolioSequentialsToXml(&m_elmt_unitfolio_max, &elmtfolioseq, "sequf_");
+				folioContainedAutonum.appendChild(elmtfolioseq);	
+			}
+			if (!m_elmt_tenfolio_max.isEmpty()) {
+				QDomElement elmtfolioseq = document.createElement("elementtenfolioseq");
+				elementFolioSequentialsToXml(&m_elmt_tenfolio_max, &elmtfolioseq, "seqtf_");
+				folioContainedAutonum.appendChild(elmtfolioseq);
+			}
+			if (!m_elmt_hundredfolio_max.isEmpty()) {
+				QDomElement elmtfolioseq = document.createElement("elementhundredfolioseq");
+				elementFolioSequentialsToXml(&m_elmt_hundredfolio_max, &elmtfolioseq, "seqhf_");
+				folioContainedAutonum.appendChild(elmtfolioseq);
+			}
+			racine.appendChild(folioContainedAutonum);
+		}
 	}
 	else {
 			//this method with whole_content to false,
@@ -570,6 +594,23 @@
 }
 
 /**
++ * @brief Diagram::elementFolioSequentialsToXml
++ * Add element folio sequential to QDomElement
++ * @param domElement to add attributes
++ * @param hash to retrieve content with content
++ * @param sequential type
++ */
+void Diagram::elementFolioSequentialsToXml(QHash<QString, QStringList> *hash, QDomElement *domElement, QString seq_type) {
+	QHash<QString, QStringList>::iterator i;
+	for (i = hash->begin(); i != hash->end(); i++) {
+		domElement->setAttribute("title", i.key());
+		for (int j = 0; j < i.value().size(); j++) {
+			domElement->setAttribute(seq_type + QString::number(j+1), i.value().at(j));
+		}
+	}
+}
+
+/**
 	Importe le schema decrit dans un document XML. Si une position est
 	precisee, les elements importes sont positionnes de maniere a ce que le
 	coin superieur gauche du plus petit rectangle pouvant les entourant tous
@@ -658,8 +699,12 @@
 
 		// Load Freeze New Element
 		m_freeze_new_elements_ = root.attribute("freezeNewElement").toInt();
+
+		elementFolioSequentialsFromXml(root, &m_elmt_unitfolio_max, "elementunitfolioseq","sequf_");
+		elementFolioSequentialsFromXml(root, &m_elmt_tenfolio_max, "elementtenfolioseq","seqtf_");
+		elementFolioSequentialsFromXml(root, &m_elmt_hundredfolio_max, "elementhundredfolioseq","seqhf_");
 	}
-	
+
 	// if child haven't got a child, loading is finish (diagram is empty)
 	if (root.firstChild().isNull()) {
 		write(document);
@@ -832,6 +877,27 @@
 }
 
 /**
+ * @brief Diagram::elementFolioSequentialsFromXml
+ * Load element folio sequential from QDomElement
+ * @param root containing all folio sequentials
+ * @param hash to be loaded with content
+ * @param folioSeq type
+ * @param seq type
+ */
+void Diagram::elementFolioSequentialsFromXml(const QDomElement &root, QHash<QString, QStringList>* hash, QString folioSeq, QString seq) {
+	foreach (QDomElement folioSeqAutoNum, QET::findInDomElement(root, "elementautonumfoliosequentials", folioSeq)) {
+		QString title = folioSeqAutoNum.attribute("title");
+		QStringList unit;
+		int i = 1;
+		while (folioSeqAutoNum.hasAttribute(seq + QString::number(i))) {
+			unit << folioSeqAutoNum.attribute(seq + QString::number(i));
+			i++;
+		}
+		hash->insert(title,unit);
+	}
+}
+
+/**
 	Enregistre le schema XML dans son document XML interne et emet le signal
 	written().
 */
@@ -1074,6 +1140,93 @@
 }
 
 /**
+ * @brief Diagram::insertFolioSeqHash
+ * This class inserts a stringlist containing all
+ * sequential variables related to an autonum in a QHash
+ * @param Hash to be accessed
+ * @param autonum title
+ * @param sequential to be treated
+ * @param type to be treated
+ * @param Numerotation Context to be manipulated
+ */
+void Diagram::insertFolioSeqHash(QHash<QString, QStringList> *hash, QString title, QString seq, QString type, NumerotationContext *nc) {
+	if (project()->elementAutoNumFormula().contains(seq)) {
+		QStringList max;
+		for (int i = 0; i < nc->size(); i++) {
+				if (nc->itemAt(i).at(0) == type) {
+					nc->replaceValue(i, QString::number(nc->itemAt(i).at(3).toInt()));
+					max.append(QString::number(nc->itemAt(i).at(3).toInt() - nc->itemAt(i).at(2).toInt()));
+				}
+		}
+		hash->insert(title,max);
+		project()->addElementAutoNum(title,*nc);
+	}
+}
+
+/**
+ * @brief Diagram::loadElmtFolioSeqHash
+ * This class loads all folio sequential variables
+ * related to the current autonum
+ * @param Hash to be accessed
+ * @param autonum title
+ * @param sequential to be treated
+ * @param type to be treated
+ * @param Numerotation Context to be manipulated
+ */
+void Diagram::loadElmtFolioSeqHash(QHash<QString, QStringList> *hash, QString title, QString seq, QString type, NumerotationContext *nc) {
+	if (project()->elementAutoNumFormula().contains(seq)) {
+		int j = 0;
+		for (int i = 0; i < nc->size(); i++) {
+			if (nc->itemAt(i).at(0) == type) {
+				QString new_value;
+				new_value = QString::number(hash->value(title).at(j).toInt() + nc->itemAt(i).at(2).toInt());
+				nc->replaceValue(i,new_value);
+				j++;
+			}
+		}
+		project()->addElementAutoNum(title,*nc);
+	}
+}
+
+/**
+ * @brief Diagram::loadElmtFolioSeq
+ * This class loads all folio sequential variables related
+ * to the current autonum
+ */
+void Diagram::loadElmtFolioSeq() {
+	//Element
+	QString title = project()->elementCurrentAutoNum();
+	NumerotationContext nc = project()->elementAutoNum(title);
+	//Unit Folio
+	if (m_elmt_unitfolio_max.isEmpty() || !m_elmt_unitfolio_max.contains(title)) {
+		//Insert Initial Value
+		insertFolioSeqHash(&m_elmt_unitfolio_max,title,"%sequf_","unitfolio",&nc);
+	}
+	else if (m_elmt_unitfolio_max.contains(title)) {
+		//Load Folio Current Value
+		loadElmtFolioSeqHash(&m_elmt_unitfolio_max,title,"%sequf_","unitfolio",&nc);
+	}
+	//Ten Folio
+	if (m_elmt_tenfolio_max.isEmpty() || !m_elmt_tenfolio_max.contains(title)) {
+		//Insert Initial Value
+		insertFolioSeqHash(&m_elmt_tenfolio_max,title,"%seqtf_","tenfolio",&nc);
+	}
+	else if (m_elmt_tenfolio_max.contains(title)) {
+		//Load Folio Current Value
+		loadElmtFolioSeqHash(&m_elmt_tenfolio_max,title,"%seqtf_","tenfolio",&nc);
+	}
+	//Hundred Folio
+	if (m_elmt_hundredfolio_max.isEmpty() || !m_elmt_hundredfolio_max.contains(title)) {
+		//Insert Initial Value
+		insertFolioSeqHash(&m_elmt_hundredfolio_max,title,"%seqhf_","hundredfolio",&nc);
+	}
+	else if (m_elmt_hundredfolio_max.contains(title)) {
+		//Load Folio Current Value
+		loadElmtFolioSeqHash(&m_elmt_hundredfolio_max,title,"%seqhf_","hundredfolio",&nc);
+	}
+}
+
+/**
 	@return le titre du cartouche
 */
 QString Diagram::title() const {

Modified: trunk/sources/diagram.h
===================================================================
--- trunk/sources/diagram.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/diagram.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -83,6 +83,10 @@
 		static const qreal margin;
 		/// background color of diagram
 		static QColor background_color;
+		/// Hash containing max values for folio sequential autonums in this diagram
+		QHash <QString, QStringList> m_elmt_unitfolio_max;
+		QHash <QString, QStringList> m_elmt_tenfolio_max;
+		QHash <QString, QStringList> m_elmt_hundredfolio_max;
 
 	private:
 		QGraphicsLineItem *conductor_setter_;
@@ -153,8 +157,10 @@
 	void write(const QDomElement &);
 	bool wasWritten() const;
 	QDomElement writeXml(QDomDocument &) const;
-	
-		// methods related to graphics items addition/removal on the diagram
+	void elementFolioSequentialsToXml(QHash<QString, QStringList>*, QDomElement *, QString);
+	void elementFolioSequentialsFromXml(const QDomElement&, QHash<QString, QStringList>*, QString, QString);
+
+	// methods related to graphics items addition/removal on the diagram
 	void initElementsLinks();
 	virtual void addItem    (QGraphicsItem *item);
 	virtual void removeItem (QGraphicsItem *item);
@@ -202,12 +208,17 @@
 	QUndoStack &undoStack();
 	QGIManager &qgiManager();
 	
+	//methods related to element label Update Policy
 	void freezeElements();
 	void unfreezeElements();
 	void freezeNew();
 	void unfreezeNew();
 	bool freezeNewElements();
 
+	//methods related to insertion and loading of element folio sequential
+	void insertFolioSeqHash (QHash<QString, QStringList> *hash, QString title, QString seq, QString type, NumerotationContext *nc);
+	void loadElmtFolioSeqHash (QHash<QString, QStringList> *hash, QString title, QString seq, QString type, NumerotationContext *nc);
+
 	public slots:
 		void adjustSceneRect ();
 		void titleChanged(const QString &);
@@ -216,6 +227,7 @@
 		void titleBlockTemplateRemoved(const QString &, const QString & = QString());
 		void setTitleBlockTemplate(const QString &);
 		void updateLabels();
+		void loadElmtFolioSeq();
 	
 		// methods related to graphics items selection
 		void selectAll();
@@ -231,6 +243,7 @@
 		void editElementRequired(const ElementsLocation &);		/// Signal emitted when users wish to edit an element from the diagram
 		void reportPropertiesChanged(QString);
 		void XRefPropertiesChanged();
+		void diagramActivated();
 };
 Q_DECLARE_METATYPE(Diagram *)
 

Modified: trunk/sources/diagramevent/diagrameventaddelement.cpp
===================================================================
--- trunk/sources/diagramevent/diagrameventaddelement.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/diagramevent/diagrameventaddelement.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -233,7 +233,7 @@
 		can.numerate();
 	};
 	m_diagram -> undoStack().push(undo_object);
-	element->setSeq();
+	element->setSequential();
 	element->freezeNewAddedElement();
 	element->updateLabel();
 }

Modified: trunk/sources/numerotationcontext.cpp
===================================================================
--- trunk/sources/numerotationcontext.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/numerotationcontext.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -45,13 +45,13 @@
  * @param increase the increase number of value
  * @return true if value is append
  */
-bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase) {
+bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase, const int initialvalue) {
 	if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String)) return false;
 	if (keyIsNumber(type) && !value.canConvert(QVariant::Int)) return false;
 
 	QString valuestr = value.toString();
 	valuestr.remove("|");
-	content_ << type + "|" + valuestr + "|" + QString::number(increase);
+	content_ << type + "|" + valuestr + "|" + QString::number(increase) + "|" + QString::number(initialvalue);
 	return true;
 }
 
@@ -99,7 +99,7 @@
  * @return all type use to numerotation
  */
 QString NumerotationContext::validRegExpNum () const {
-	return ("unit|ten|hundred|string|idfolio|folio|elementline|elementcolumn|elementprefix");
+	return ("unit|unitfolio|ten|hundred|string|idfolio|folio|elementline|elementcolumn|elementprefix");
 }
 
 /**
@@ -107,7 +107,7 @@
  * @return all type represents a number
  */
 QString NumerotationContext::validRegExpNumber() const {
-	return ("unit|ten|hundred");
+	return ("unit|unitfolio|ten|hundred");
 }
 
 /**
@@ -138,6 +138,11 @@
 		part.setAttribute("type", strl.at(0));
 		part.setAttribute("value", strl.at(1));
 		part.setAttribute("increase", strl.at(2));
+		if (strl.at(0) == ("unitfolio") ||
+			strl.at(0) == ("tenfolio")  ||
+			strl.at(0) == ("hundredfolio")) {
+			part.setAttribute("initialvalue", strl.at(3));
+		}
 		num_auto.appendChild(part);
 	}
 	return num_auto;
@@ -149,5 +154,20 @@
  */
 void NumerotationContext::fromXml(QDomElement &e) {
 	clear();
-	foreach(QDomElement qde, QET::findInDomElement(e, "part")) addValue(qde.attribute("type"), qde.attribute("value"), qde.attribute("increase").toInt());
+	foreach(QDomElement qde, QET::findInDomElement(e, "part")) addValue(qde.attribute("type"), qde.attribute("value"), qde.attribute("increase").toInt(), qde.attribute("initialvalue").toInt());
 }
+
+/**
+ * @brief NumerotationContext::replaceValue
+ * This class replaces the current NC field value with content
+ * @param index of NC Item
+ * @param QString content to replace current value
+ */
+void NumerotationContext::replaceValue(int index, QString content) {
+	QString sep = "|";
+	QString type = content_[index].split("|").at(0);
+	QString value = content;
+	QString increase = content_[index].split("|").at(2);
+	QString initvalue = content_[index].split("|").at(3);
+	content_[index].replace(content_[index], type + "|" + value + "|" + increase + "|" + initvalue);
+}

Modified: trunk/sources/numerotationcontext.h
===================================================================
--- trunk/sources/numerotationcontext.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/numerotationcontext.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -33,7 +33,7 @@
 	NumerotationContext ();
 	NumerotationContext (QDomElement &);
 	void clear();
-	bool addValue(const QString &, const QVariant & = QVariant(1), const int = 1);
+	bool addValue(const QString &, const QVariant & = QVariant(1), const int = 1, const int = 0);
 	QString operator[] (const int &) const;
 	void operator << (const NumerotationContext &);
 	int size() const;
@@ -45,6 +45,7 @@
 	bool keyIsNumber(const QString &) const;
 	QDomElement toXml(QDomDocument &, QString);
 	void fromXml(QDomElement &);
+	void replaceValue(int, QString);
 
 	private:
 	QStringList content_;

Modified: trunk/sources/numerotationcontextcommands.cpp
===================================================================
--- trunk/sources/numerotationcontextcommands.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/numerotationcontextcommands.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -92,14 +92,26 @@
 		strategy_ = new UnitNum(diagram_);
 		return;
 	}
+	else if (str == "unitfolio") {
+		strategy_ = new UnitFNum (diagram_);
+		return;
+	}
 	else if (str == "ten") {
 		strategy_ = new TenNum (diagram_);
 		return;
 	}
+	else if (str == "tenfolio") {
+		strategy_ = new TenFNum (diagram_);
+		return;
+	}
 	else if (str == "hundred") {
 		strategy_ = new HundredNum (diagram_);
 		return;
 	}
+	else if (str == "hundredfolio") {
+		strategy_ = new HundredFNum (diagram_);
+		return;
+	}
 	else if (str == "string") {
 		strategy_ = new StringNum (diagram_);
 		return;
@@ -156,7 +168,7 @@
 	QStringList strl = nc.itemAt(i);
 	NumerotationContext newnc;
 	QString value = QString::number( (strl.at(1).toInt()) + (strl.at(2).toInt()) );
-	newnc.addValue(strl.at(0), value, strl.at(2).toInt());
+	newnc.addValue(strl.at(0), value, strl.at(2).toInt(), strl.at(3).toInt());
 	return (newnc);
 }
 
@@ -168,7 +180,7 @@
 	QStringList strl = nc.itemAt(i);
 	NumerotationContext newnc;
 	QString value = QString::number( (strl.at(1).toInt()) - (strl.at(2).toInt()) );
-	newnc.addValue(strl.at(0), value, strl.at(2).toInt());
+	newnc.addValue(strl.at(0), value, strl.at(2).toInt(), strl.at(3).toInt());
 	return (newnc);
 }
 
@@ -206,6 +218,37 @@
 /**
  * Constructor
  */
+UnitFNum::UnitFNum(Diagram *d):
+	NumStrategy(d)
+{}
+
+/**
+ * @brief UnitFNum::toRepresentedString
+ * @return the represented string of num
+ */
+QString UnitFNum::toRepresentedString(const QString num) const {
+	return (num);
+}
+
+/**
+ * @brief UnitFNum::next
+ * @return the next NumerotationContext nc at position i
+ */
+NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const {
+	return (nextNumber(nc, i));
+}
+
+/**
+ * @brief UnitFNum::previous
+ * @return the previous NumerotationContext nc at posiiton i
+ */
+NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const {
+	return (previousNumber(nc, i));
+}
+
+/**
+ * Constructor
+ */
 TenNum::TenNum (Diagram *d):
 	NumStrategy (d)
 {}
@@ -240,6 +283,41 @@
 /**
  * Constructor
  */
+TenFNum::TenFNum (Diagram *d):
+	NumStrategy (d)
+{}
+
+/**
+ * @brief TenFNum::toRepresentedString
+ * @return the represented string of num
+ */
+QString TenFNum::toRepresentedString(const QString num) const {
+	int numint = num.toInt();
+	QString numstr = num;
+	if (numint<10) numstr.prepend("0");
+	return (numstr);
+}
+
+/**
+ * @brief TenFNum::next
+ * @return the next NumerotationContext nc at position i
+ */
+NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const {
+	return (nextNumber(nc, i));
+}
+
+/**
+ * @brief TenFNum::previous
+ * @return the previous NumerotationContext nc at posiiton i
+ */
+NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const {
+	return (previousNumber(nc, i));
+}
+
+
+/**
+ * Constructor
+ */
 HundredNum::HundredNum (Diagram *d):
 	NumStrategy (d)
 {}
@@ -279,6 +357,45 @@
 /**
  * Constructor
  */
+HundredFNum::HundredFNum (Diagram *d):
+	NumStrategy (d)
+{}
+
+/**
+ * @brief HundredFNum::toRepresentedString
+ * @return the represented string of num
+ */
+QString HundredFNum::toRepresentedString(const QString num) const {
+	int numint = num.toInt();
+	QString numstr = num;
+	if (numint<100) {
+		if (numint<10) {
+			numstr.prepend("00");
+		}
+		else numstr.prepend("0");
+	}
+	return (numstr);
+}
+
+/**
+ * @brief HundredFNum::next
+ * @return the next NumerotationContext nc at position i
+ */
+NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const {
+	return (nextNumber(nc, i));
+}
+
+/**
+ * @brief HundredFNum::previous
+ * @return the previous NumerotationContext nc at posiiton i
+ */
+NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const {
+	return (previousNumber(nc, i));
+}
+
+/**
+ * Constructor
+ */
 StringNum::StringNum (Diagram *d):
 	NumStrategy (d)
 {}
@@ -352,7 +469,7 @@
  */
 QString FolioNum::toRepresentedString(const QString str) const {
 	Q_UNUSED(str);
-	return (diagram_->border_and_titleblock.folio());
+	return ("%F");
 }
 
 /**

Modified: trunk/sources/numerotationcontextcommands.h
===================================================================
--- trunk/sources/numerotationcontextcommands.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/numerotationcontextcommands.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -69,6 +69,15 @@
 	NumerotationContext previous (const NumerotationContext &, const int) const;
 };
 
+class UnitFNum: public NumStrategy
+{
+	public:
+	UnitFNum (Diagram *);
+	QString toRepresentedString(const QString) const;
+	NumerotationContext next     (const NumerotationContext &, const int) const;
+	NumerotationContext previous (const NumerotationContext &, const int) const;
+};
+
 class TenNum: public NumStrategy
 {
 	public:
@@ -78,6 +87,15 @@
 	NumerotationContext previous (const NumerotationContext &, const int) const;
 };
 
+class TenFNum: public NumStrategy
+{
+	public:
+	TenFNum (Diagram *);
+	QString toRepresentedString(const QString) const;
+	NumerotationContext next     (const NumerotationContext &, const int) const;
+	NumerotationContext previous (const NumerotationContext &, const int) const;
+};
+
 class HundredNum: public NumStrategy
 {
 	public:
@@ -87,6 +105,15 @@
 	NumerotationContext previous (const NumerotationContext &, const int) const;
 };
 
+class HundredFNum: public NumStrategy
+{
+	public:
+	HundredFNum (Diagram *);
+	QString toRepresentedString(const QString) const;
+	NumerotationContext next     (const NumerotationContext &, const int) const;
+	NumerotationContext previous (const NumerotationContext &, const int) const;
+};
+
 class StringNum: public NumStrategy
 {
 	public:

Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/projectview.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -1019,6 +1019,8 @@
 		setDisplayFallbackWidget(false);
 
 	emit(diagramActivated(diagram_ids_[tab_id]));
+	if (diagram_ids_[tab_id] != nullptr)
+		diagram_ids_[tab_id]->diagram()->diagramActivated();
 }
 
 /**

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/qetdiagrameditor.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -954,6 +954,7 @@
 	// met a jour le panel d'elements
 	if (update_panel) {
 		pa -> elementsPanel().projectWasOpened(project);
+		if (currentDiagram() != NULL)
 		m_autonumbering_dock->setProject(project, project_view);
 	}
 	
@@ -1326,7 +1327,7 @@
 void QETDiagramEditor::slot_updateAutoNumDock() {
 	if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) {
 			activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow());
-			if (currentProject()!=NULL) {
+			if (currentProject() != NULL && currentDiagram() != NULL) {
 				m_autonumbering_dock->setProject(currentProject()->project(),currentProject());
 			}
 	}

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/qetgraphicsitem/element.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -429,27 +429,14 @@
 	//load prefix
 	m_prefix = e.attribute("prefix");
 
-	//Load Unit Sequential Values
-	int i = 0;
-	while (!e.attribute("sequ_" + QString::number(i+1)).isEmpty()) {
-			seq_unit.append(e.attribute("sequ_" + QString::number(i+1)));
-			i++;
-	}
+	//Load Sequential Values
+	loadSequential(&e,"sequ_",&seq_unit);
+	loadSequential(&e,"sequf_",&seq_unitfolio);
+	loadSequential(&e,"seqt_",&seq_ten);
+	loadSequential(&e,"seqtf_",&seq_tenfolio);
+	loadSequential(&e,"seqh_",&seq_hundred);
+	loadSequential(&e,"seqhf_",&seq_hundredfolio);
 
-	//Load Ten Sequential Values
-	i = 0;
-	while (!e.attribute("seqt_" + QString::number(i+1)).isEmpty()) {
-			seq_ten.append(e.attribute("seqt_" + QString::number(i+1)));
-			i++;
-	}
-
-	//Load Hundred Sequential Values
-	i = 0;
-	while (!e.attribute("seqh_" + QString::number(i+1)).isEmpty()) {
-			seq_hundred.append(e.attribute("seqh_" + QString::number(i+1)));
-			i++;
-	}
-
 	//load informations
 	m_element_informations.fromXml(e.firstChildElement("elementInformations"), "elementInformation");
 
@@ -471,6 +458,21 @@
 }
 
 /**
+	Load Sequentials to display on element label
+	@param element QDomElement to set Attributes
+	@param Qstring seq to be retrieved
+	@param QStringList list to be inserted values
+*/
+void Element::loadSequential(QDomElement* e, QString seq, QStringList* list) {
+	//Load Sequential Values
+	int i = 0;
+	while (!e->attribute(seq + QString::number(i+1)).isEmpty()) {
+			list->append(e->attribute(seq + QString::number(i+1)));
+			i++;
+	}
+}
+
+/**
 	Permet d'exporter l'element en XML
 	@param document Document XML a utiliser
 	@param table_adr_id Table de correspondance entre les adresses des bornes
@@ -488,20 +490,36 @@
 	// prefix
 	element.setAttribute("prefix", m_prefix);
 
-	//Save Unit Sequential Values
+	// Save Element sequential values to Xml
+	// Save Unit Sequential Values
 	for (int i = 0; i < seq_unit.size(); i++) {
 			element.setAttribute("sequ_" + QString::number(i+1),seq_unit.at(i));
 	}
 
-	//Save Ten Sequential Values
+	// Save UnitFolio Sequential Values
+	for (int i = 0; i < seq_unitfolio.size(); i++) {
+			element.setAttribute("sequf_" + QString::number(i+1),seq_unitfolio.at(i));
+	}
+
+	// Save Ten Sequential Values
 	for (int i = 0; i < seq_ten.size(); i++) {
 			element.setAttribute("seqt_" + QString::number(i+1),seq_ten.at(i));
 	}
 
-	//Save Hundred Sequential Values
+	// Save TenFolio Sequential Values
+	for (int i = 0; i < seq_tenfolio.size(); i++) {
+			element.setAttribute("seqtf_" + QString::number(i+1),seq_tenfolio.at(i));
+	}
+
+	// Save Hundred Sequential Values
 	for (int i = 0; i < seq_hundred.size(); i++) {
 			element.setAttribute("seqh_" + QString::number(i+1),seq_hundred.at(i));
 	}
+
+	// Save Hundred Sequential Values
+	for (int i = 0; i < seq_hundredfolio.size(); i++) {
+			element.setAttribute("seqhf_" + QString::number(i+1),seq_hundredfolio.at(i));
+	}
 	
 	// position, selection et orientation
 	element.setAttribute("x", QString("%1").arg(pos().x()));
@@ -748,10 +766,10 @@
 }
 
 /**
- * @brief Element::setSeq()
+ * @brief Element::setSequential
  * Set sequential values to element
  */
-void Element::setSeq() {
+void Element::setSequential() {
 	DiagramContext &dc = this->rElementInformations();
 	QString element_currentAutoNum = diagram()->project()->elementCurrentAutoNum();
 	QString formula = diagram()->project()->elementAutoNumFormula();
@@ -759,34 +777,75 @@
 	NumerotationContext nc = diagram()->project()->elementAutoNum(element_currentAutoNum);
 	NumerotationContextCommands ncc (nc);
 	if (!nc.isEmpty()) {
-		//Unit Format
-		if (label.contains("%sequ_")) {
-			for (int i = 0; i < nc.size(); i++) {
-				if (nc.itemAt(i).at(0) == "unit") {
-					seq_unit.append(QString::number(nc.itemAt(i).at(1).toInt()));
-				}
-			}
+		if (label.contains("%sequ_"))
+			setSequentialToList(&seq_unit,&nc,"unit");
+		if (label.contains("%sequf_")) {
+			setSequentialToList(&seq_unitfolio,&nc,"unitfolio");
+			setFolioSequentialToHash(&seq_unitfolio,&diagram()->m_elmt_unitfolio_max,element_currentAutoNum);
 		}
-		//Ten Format
-		if (label.contains("%seqt_")) {
-			for (int i = 0; i < nc.size(); i++) {
-				if (nc.itemAt(i).at(0) == "ten") {
-					QString number = QString ("%1").arg(nc.itemAt(i).at(1).toInt(), 2, 10, QChar('0'));
-					seq_ten.append(number);
-				}
-			}
+		if (label.contains("%seqt_"))
+			setSequentialToList(&seq_ten,&nc,"ten");
+		if (label.contains("%seqtf_")) {
+			setSequentialToList(&seq_tenfolio,&nc,"tenfolio");
+			setFolioSequentialToHash(&seq_tenfolio,&diagram()->m_elmt_tenfolio_max,element_currentAutoNum);
 		}
-		//Hundred Format
-		if (label.contains("%seqh_")) {
-			for (int i = 0; i < nc.size(); i++) {
-				if (nc.itemAt(i).at(0) == "hundred") {
-					QString number = QString ("%1").arg(nc.itemAt(i).at(1).toInt(), 3, 10, QChar('0'));
-					seq_hundred.append(number);
-				}
+		if (label.contains("%seqh_"))
+			setSequentialToList(&seq_hundred,&nc,"hundred");
+		if (label.contains("%seqhf_")) {
+			setSequentialToList(&seq_hundredfolio,&nc,"hundredfolio");
+			setFolioSequentialToHash(&seq_hundredfolio,&diagram()->m_elmt_hundredfolio_max,element_currentAutoNum);
+		}
+	this->diagram()->project()->addElementAutoNum(element_currentAutoNum,ncc.next());
+	}
+}
+
+/**
+ * @brief Element::setSequentialToList
+ * This class appends all sequential to selected list
+ * @param list to have values inserted
+ * @param nc to retrieve values from
+ * @param sequential type
+ */
+void Element::setSequentialToList(QStringList* list, NumerotationContext* nc, QString type) {
+	for (int i = 0; i < nc->size(); i++) {
+		if (nc->itemAt(i).at(0) == type) {
+			QString number;
+			if (type == "ten" || type == "tenfolio")
+				number = QString("%1").arg(nc->itemAt(i).at(1).toInt(), 2, 10, QChar('0'));
+			else if (type == "hundred" || type == "hundredfolio")
+				number = QString("%1").arg(nc->itemAt(i).at(1).toInt(), 3, 10, QChar('0'));
+			else number = QString::number(nc->itemAt(i).at(1).toInt());
+				list->append(number);
+		}
+	}
+}
+
+/**
+ * @brief Element::setFolioSequentialToHash
+ * This class inserts all elements from list to hash
+ * @param list to retrieve values from
+ * @param hash to have values inserted
+ * @param current element autonum to insert on hash
+ */
+void Element::setFolioSequentialToHash(QStringList* list, QHash<QString, QStringList> *hash, QString element_currentAutoNum) {
+	if (hash->isEmpty() || (!(hash->contains(element_currentAutoNum)))) {
+		QStringList max;
+		for (int i = 0; i < list->size(); i++) {
+			max.append(list->at(i));
+		}
+		hash->insert(element_currentAutoNum,max);
+	}
+	else if (hash->contains(element_currentAutoNum)) {
+		//Load the String List and update it
+		QStringList max = hash->value(element_currentAutoNum);
+		for (int i = 0; i < list->size(); i++) {
+			if ((list->at(i).toInt()) > max.at(i).toInt()) {
+				max.replace(i,list->at(i));
+				hash->remove(element_currentAutoNum);
+				hash->insert(element_currentAutoNum,max);
 			}
 		}
 	}
-	this->diagram()->project()->addElementAutoNum(element_currentAutoNum,ncc.next());
 }
 
 /**
@@ -796,7 +855,7 @@
  * @return replaced label
  */
 QString Element::assignSeq(QString label) {
-	for (int i = 1; i <= qMax(seq_unit.size(),qMax(seq_hundred.size(),seq_ten.size())); i++) {
+	for (int i = 1; i <= qMax(qMax(qMax(seq_unitfolio.size(), seq_tenfolio.size()),qMax(seq_hundredfolio.size(),seq_unit.size())),qMax(seq_hundred.size(),seq_ten.size())); i++) {
 		if (label.contains("%sequ_" + QString::number(i))) {
 			label.replace("%sequ_" + QString::number(i),seq_unit.at(i-1));
 		}
@@ -806,6 +865,15 @@
 		if (label.contains("%seqh_" + QString::number(i))) {
 			label.replace("%seqh_" + QString::number(i),seq_hundred.at(i-1));
 		}
+		if (label.contains("%sequf_" + QString::number(i))) {
+			label.replace("%sequf_" + QString::number(i),seq_unitfolio.at(i-1));
+		}
+		if (label.contains("%seqtf_" + QString::number(i))) {
+			label.replace("%seqtf_" + QString::number(i),seq_tenfolio.at(i-1));
+		}
+		if (label.contains("%seqhf_" + QString::number(i))) {
+			label.replace("%seqhf_" + QString::number(i),seq_hundredfolio.at(i-1));
+		}
 	}
 	return label;
 }

Modified: trunk/sources/qetgraphicsitem/element.h
===================================================================
--- trunk/sources/qetgraphicsitem/element.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/qetgraphicsitem/element.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -26,6 +26,7 @@
 class QETProject;
 class Terminal;
 class Conductor;
+class NumerotationContext;
 
 /**
 	This is the base class for electrical elements.
@@ -135,7 +136,9 @@
 																									// kind of contact (simple tempo) or number of contact show by the element.
 		QString assignVariables (QString, Element *);
 		QString assignSeq (QString);
-		void setSeq ();
+		void setSequential ();
+		void setSequentialToList(QStringList*, NumerotationContext*, QString);
+		void setFolioSequentialToHash(QStringList*, QHash<QString, QStringList>*, QString);
 		void setPrefix(QString);
 		QString getPrefix();
 		void freezeLabel();
@@ -194,6 +197,7 @@
 		void drawHighlight(QPainter *, const QStyleOptionGraphicsItem *);
 		void updatePixmap();
 		void etiToElementLabels(ElementTextItem*);
+		void loadSequential(QDomElement* e, QString seq, QStringList* list);
 
 	protected:
 		virtual void mouseMoveEvent    ( QGraphicsSceneMouseEvent *event );
@@ -205,8 +209,11 @@
 		bool m_mouse_over;
 		QString m_prefix;
 		QStringList seq_unit;
+		QStringList seq_unitfolio;
 		QStringList seq_ten;
+		QStringList seq_tenfolio;
 		QStringList seq_hundred;
+		QStringList seq_hundredfolio;
 
 };
 

Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/qetproject.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -556,7 +556,7 @@
  * If key is not found, return an empty numerotation context
  * @param key
  */
-NumerotationContext QETProject::elementAutoNum (const QString &key) const {
+NumerotationContext QETProject::elementAutoNum (const QString &key) {
 	if (m_element_autonum.contains(key)) return m_element_autonum[key];
 	else return NumerotationContext();
 }

Modified: trunk/sources/qetproject.h
===================================================================
--- trunk/sources/qetproject.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/qetproject.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -120,7 +120,7 @@
 		void removeFolioAutoNum (QString key);
 		NumerotationContext conductorAutoNum(const QString &key) const;
 		NumerotationContext folioAutoNum(const QString &key)     const;
-		NumerotationContext elementAutoNum(const QString &key)   const;
+		NumerotationContext elementAutoNum(const QString &key);
 		QString elementAutoNumFormula(const QString key) const; //returns Formula
 		QString elementAutoNumFormula() const;
 		QString elementCurrentAutoNum () const;

Modified: trunk/sources/ui/autonumberingdockwidget.cpp
===================================================================
--- trunk/sources/ui/autonumberingdockwidget.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/ui/autonumberingdockwidget.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -223,6 +223,7 @@
 	}
 	else
 		project_->setElementAutoNumCurrentFormula("","");
+	projectview_->currentDiagram()->diagram()->loadElmtFolioSeq();
 }
 
 /**

Modified: trunk/sources/ui/numparteditorw.cpp
===================================================================
--- trunk/sources/ui/numparteditorw.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/ui/numparteditorw.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -28,8 +28,7 @@
 	intValidator (new QIntValidator(0,99999,this))
 {
 	ui -> setupUi(this);
-	if (parentWidget()->parentWidget()->objectName()=="FolioTab") ui->type_combo->setMaxCount(4);
-	else if (parentWidget()->parentWidget()->objectName()=="ConductorTab") ui->type_combo->setMaxCount(6);
+	setVisibleItems();
 	setType(NumPartEditorW::unit, true);
 }
 
@@ -43,16 +42,17 @@
 	intValidator (new QIntValidator(0,99999,this))
 {
 	ui -> setupUi(this);
-	if (parentWidget()->parentWidget()->objectName()=="FolioTab") ui->type_combo->setMaxCount(4);
-	else if (parentWidget()->parentWidget()->objectName()=="ConductorTab") ui->type_combo->setMaxCount(6);
-	//if @context contains nothing build with default value
+	setVisibleItems();
 	if(context.size()==0) setType(NumPartEditorW::unit, true);
 
 	else {
 		QStringList strl = context.itemAt(i);
 		if (strl.at(0)=="unit") setType(NumPartEditorW::unit, true);
+		else if (strl.at(0)=="unitfolio") setType(NumPartEditorW::unitfolio, true);
 		else if (strl.at(0)=="ten") setType(NumPartEditorW::ten, true);
+		else if (strl.at(0)=="tenfolio") setType(NumPartEditorW::tenfolio, true);
 		else if (strl.at(0)=="hundred") setType(NumPartEditorW::hundred, true);
+		else if (strl.at(0)=="hundredfolio") setType(NumPartEditorW::hundredfolio, true);
 		else if (strl.at(0)=="string") setType(NumPartEditorW::string);
 		else if (strl.at(0)=="idfolio") setType(NumPartEditorW::idfolio);
 		else if (strl.at(0)=="folio") setType(NumPartEditorW::folio);
@@ -73,6 +73,27 @@
 	delete ui;
 }
 
+void NumPartEditorW::setVisibleItems() {
+	ui->type_cb->setInsertPolicy(QComboBox::InsertAtBottom);
+	QStringList items;
+	if (parentWidget()->parentWidget()->objectName()=="FolioTab") {
+		items	<< tr("Chiffre 1") << tr("Chiffre 01")
+				<< tr("Chiffre 001")
+				<< tr("Texte") << tr("N° folio");
+	}
+	else if (parentWidget()->parentWidget()->objectName()=="ConductorTab") {
+		items	<< tr("Chiffre 1") << tr("Chiffre 01")
+				<< tr("Chiffre 001")
+				<< tr("Texte") << tr("N° folio") << tr("Folio");
+	}
+	else
+		items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
+			  << tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
+			  << tr("Texte") << tr("N° folio") << tr("Folio")
+			  << tr("Element Line") << tr("Element Column") << tr("Element Prefix");
+	ui->type_cb->insertItems(0,items);
+}
+
 /**
  * @brief NumPartEditorW::toNumContext
  * @return the display to NumerotationContext
@@ -84,12 +105,21 @@
 		case unit:
 			type_str = "unit";
 			break;
+		case unitfolio:
+			type_str = "unitfolio";
+			break;
 		case ten:
 			type_str = "ten";
 			break;
+		case tenfolio:
+			type_str = "tenfolio";
+			break;
 		case hundred:
 			type_str = "hundred";
 			break;
+		case hundredfolio:
+			type_str = "hundredfolio";
+			break;
 		case string:
 			type_str = "string";
 			break;
@@ -109,6 +139,9 @@
 			type_str = "elementprefix";
 			break;
 	}
+	if (type_str == "unitfolio" || type_str == "tenfolio" || type_str == "hundredfolio")
+		nc.addValue(type_str, ui -> value_field -> displayText(), ui -> increase_spinBox -> value(), ui->value_field->displayText().toInt());
+	else
 	nc.addValue(type_str, ui -> value_field -> displayText(), ui -> increase_spinBox -> value());
 	return nc;
 }
@@ -125,39 +158,34 @@
 }
 
 /**
- * @brief NumPartEditorW::on_type_combo_activated
+ * @brief NumPartEditorW::on_type_cb_activated
  * Action when user change the type comboBox
  */
-void NumPartEditorW::on_type_combo_activated(int index) {
-	switch (index) {
-		case unit:
-			setType(unit);
-			break;
-		case ten:
-			setType(ten);
-			break;
-		case hundred:
-			setType(hundred);
-			break;
-		case string:
-			setType(string);
-			break;
-		case idfolio:
-			setType(idfolio);
-			break;
-		case folio:
-			setType(folio);
-			break;
-		case elementline:
-			setType(elementline);
-			break;
-		case elementcolumn:
-			setType(elementcolumn);
-			break;
-		case elementprefix:
-			setType(elementprefix);
-			break;
-	};
+void NumPartEditorW::on_type_cb_activated(int) {
+	if (ui->type_cb->currentText() == tr("Chiffre 1"))
+		setType(unit);
+	else if (ui->type_cb->currentText() == tr("Chiffre 1 - Folio"))
+		setType(unitfolio);
+	else if (ui->type_cb->currentText() ==  tr("Chiffre 01"))
+		setType(ten);
+	else if (ui->type_cb->currentText() == tr("Chiffre 01 - Folio"))
+		setType(tenfolio);
+	else if (ui->type_cb->currentText() == tr("Chiffre 001"))
+		setType(hundred);
+	else if (ui->type_cb->currentText() == tr("Chiffre 001 - Folio"))
+		setType(hundredfolio);
+	else if (ui->type_cb->currentText() == tr("Texte"))
+		setType(string);
+	else if (ui->type_cb->currentText() == tr("N° folio"))
+		setType(idfolio);
+	else if (ui->type_cb->currentText() == tr("Folio"))
+		setType(folio);
+	else if (ui->type_cb->currentText() == tr("Element Line"))
+		setType(elementline);
+	else if (ui->type_cb->currentText() == tr("Element Column"))
+		setType(elementcolumn);
+	else if (ui->type_cb->currentText() == tr("Element Prefix"))
+		setType(elementprefix);
 	emit changed();
 }
 
@@ -184,11 +212,11 @@
  * @param fnum, force the behavior of numeric type
  */
 void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
-	ui -> type_combo -> setCurrentIndex(t);
+//	ui -> type_cb -> setCurrentIndex(t);
 
 	//if @t is a numeric type and preview type @type_ isn't a numeric type
 	//or @fnum is true, we set numeric behavior
-	if ( ((t==unit || t==ten || t==hundred) &&
+	if ( ((t==unit || t==unitfolio || t==ten || t==tenfolio || t==hundred || t==hundredfolio) &&
 		  (type_==string || type_==folio || type_==idfolio ||
 		   type_==elementcolumn || type_==elementline || type_==elementprefix))
 		 || fnum) {

Modified: trunk/sources/ui/numparteditorw.h
===================================================================
--- trunk/sources/ui/numparteditorw.h	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/ui/numparteditorw.h	2016-07-26 18:52:49 UTC (rev 4592)
@@ -41,13 +41,20 @@
 	NumPartEditorW (NumerotationContext &, int, QWidget *parent=0);
 	~NumPartEditorW();
 
-	enum type {unit,ten,hundred,string,idfolio,folio,elementline,elementcolumn,elementprefix};
+	enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,
+			   string,idfolio,folio,
+			   elementline,elementcolumn,elementprefix,
+			  };
 	NumerotationContext toNumContext();
 	bool isValid ();
 	type type_;
 
+	private:
+	void setVisibleItems();
+	void disableItem(int index);
+
 	private slots:
-	void on_type_combo_activated(int);
+	void on_type_cb_activated(int);
 	void on_value_field_textEdited();
 	void on_increase_spinBox_valueChanged(int);
 	void setType (NumPartEditorW::type t, bool=false);

Modified: trunk/sources/ui/numparteditorw.ui
===================================================================
--- trunk/sources/ui/numparteditorw.ui	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/ui/numparteditorw.ui	2016-07-26 18:52:49 UTC (rev 4592)
@@ -30,7 +30,7 @@
     <number>2</number>
    </property>
    <item>
-    <widget class="QComboBox" name="type_combo">
+    <widget class="QComboBox" name="type_cb">
      <property name="sizePolicy">
       <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
        <horstretch>0</horstretch>
@@ -40,51 +40,6 @@
      <property name="editable">
       <bool>true</bool>
      </property>
-     <item>
-      <property name="text">
-       <string>Chiffre 1</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Chiffre 01</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Chiffre 001</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Texte</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>N° folio</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Folio</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Element Line</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Element Column</string>
-      </property>
-     </item>
-     <item>
-      <property name="text">
-       <string>Element Prefix</string>
-      </property>
-     </item>
     </widget>
    </item>
    <item>

Modified: trunk/sources/ui/selectautonumw.cpp
===================================================================
--- trunk/sources/ui/selectautonumw.cpp	2016-07-25 19:18:26 UTC (rev 4591)
+++ trunk/sources/ui/selectautonumw.cpp	2016-07-26 18:52:49 UTC (rev 4592)
@@ -233,8 +233,11 @@
 void SelectAutonumW::contextToFormula() {
 	m_eaw->clearContext();
 	int count_unit = 0;
+	int count_unitf = 0;
 	int count_ten = 0;
+	int count_tenf = 0;
 	int count_hundred = 0;
+	int count_hundredf = 0;
 	foreach (NumPartEditorW *npe, num_part_list_) {
 		if (npe->isValid()) {
 			if (npe->type_ == NumPartEditorW::idfolio) {
@@ -259,14 +262,26 @@
 				count_unit++;
 				m_eaw->setContext("%sequ_"+QString::number(count_unit));
 			}
+			else if (npe->type_ == NumPartEditorW::unitfolio) {
+				count_unitf++;
+				m_eaw->setContext("%sequf_"+QString::number(count_unitf));
+			}
 			else if (npe->type_ == NumPartEditorW::ten) {
 				count_ten++;
 				m_eaw->setContext("%seqt_"+QString::number(count_ten));
 			}
+			else if (npe->type_ == NumPartEditorW::tenfolio) {
+				count_tenf++;
+				m_eaw->setContext("%seqtf_"+QString::number(count_tenf));
+			}
 			else if (npe->type_ == NumPartEditorW::hundred) {
 				count_hundred++;
 				m_eaw->setContext("%seqh_"+QString::number(count_hundred));
 			}
+			else if (npe->type_ == NumPartEditorW::hundredfolio) {
+				count_hundredf++;
+				m_eaw->setContext("%seqhf_"+QString::number(count_hundredf));
+			}
 		}
 	}
 }


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