[qet] [4595] Fix Autonumbering type load when selecting autonumbering

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


Revision: 4595
Author:   dfochi
Date:     2016-07-27 16:24:44 +0200 (Wed, 27 Jul 2016)
Log Message:
-----------
Fix Autonumbering type load when selecting autonumbering

Modified Paths:
--------------
    trunk/sources/ui/numparteditorw.cpp
    trunk/sources/ui/numparteditorw.h

Modified: trunk/sources/ui/numparteditorw.cpp
===================================================================
--- trunk/sources/ui/numparteditorw.cpp	2016-07-27 09:50:00 UTC (rev 4594)
+++ trunk/sources/ui/numparteditorw.cpp	2016-07-27 14:24:44 UTC (rev 4595)
@@ -212,7 +212,7 @@
  * @param fnum, force the behavior of numeric type
  */
 void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
-//	ui -> type_cb -> setCurrentIndex(t);
+	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
@@ -258,3 +258,37 @@
 	}
 	type_= t;
 }
+
+/**
+ * @brief NumPartEditorW::setCurrentIndex
+ * Set Current Index of type_cb
+ * @param t, type used
+ */
+void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
+	int i;
+	if (t == unit)
+		i = ui->type_cb->findText(tr("Chiffre 1"));
+	else if (t == unitfolio)
+		i = ui->type_cb->findText(tr("Chiffre 1 - Folio"));
+	else if (t == ten)
+		i = ui->type_cb->findText(tr("Chiffre 01"));
+	else if (t == tenfolio)
+		i = ui->type_cb->findText(tr("Chiffre 01 - Folio"));
+	else if (t == hundred)
+		i = ui->type_cb->findText(tr("Chiffre 001"));
+	else if (t == hundredfolio)
+		i = ui->type_cb->findText(tr("Chiffre 001 - Folio"));
+	else if (t == string)
+		i = ui->type_cb->findText(tr("Texte"));
+	else if (t == idfolio)
+		i = ui->type_cb->findText(tr("N° folio"));
+	else if (t == folio)
+		i = ui->type_cb->findText(tr("Folio"));
+	else if (t == elementline)
+		i = ui->type_cb->findText(tr("Element Line"));
+	else if (t == elementcolumn)
+		i = ui->type_cb->findText(tr("Element Column"));
+	else if (t == elementprefix)
+		i = ui->type_cb->findText(tr("Element Prefix"));
+	ui->type_cb->setCurrentIndex(i);
+}

Modified: trunk/sources/ui/numparteditorw.h
===================================================================
--- trunk/sources/ui/numparteditorw.h	2016-07-27 09:50:00 UTC (rev 4594)
+++ trunk/sources/ui/numparteditorw.h	2016-07-27 14:24:44 UTC (rev 4595)
@@ -52,6 +52,7 @@
 	private:
 	void setVisibleItems();
 	void disableItem(int index);
+	void setCurrentIndex(NumPartEditorW::type);
 
 	private slots:
 	void on_type_cb_activated(int);


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