[qet] [2139] add call method to enumerate conductor

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


Revision: 2139
Author:   cfdev
Date:     2013-05-02 16:50:44 +0200 (Thu, 02 May 2013)
Log Message:
-----------
add call method to enumerate conductor

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

Modified: trunk/sources/ui/dialogconductorautonum.cpp
===================================================================
--- trunk/sources/ui/dialogconductorautonum.cpp	2013-05-02 11:47:14 UTC (rev 2138)
+++ trunk/sources/ui/dialogconductorautonum.cpp	2013-05-02 14:50:44 UTC (rev 2139)
@@ -80,3 +80,41 @@
 	close();
 }
 
+/**
+ * @brief set the autonum to all diagram selected
+ */
+void DialogConductorAutoNum::on_pushButton_annotation_clicked(){
+	// Get list of diagrams selected
+	QList<Diagram *>listDiag = dgselect_ ->list_of_DiagramSelected();
+	if(listDiag.count()<=0) return;
+	
+	QString diagramsTitle;
+	for(int i=0; i<listDiag.count(); i++){
+		diagramsTitle += listDiag.at(i)->title();
+		if(i+1<listDiag.count()) diagramsTitle += ", ";
+	}
+	// Ask if user is sure to numerate the conductor
+	QMessageBox::StandardButton answer = QET::MessageBox::warning(
+		this,
+		tr("Annotation des conducteurs", "Attention"),
+		QString(
+			tr("Voulez vraiment annoter les conducteurs de :\n\n%1 ?")
+		).arg(diagramsTitle),
+		QMessageBox::Yes | QMessageBox::No,
+		QMessageBox::No
+	);
+	
+	// if yes numerate all
+	if( answer ==  QMessageBox::Yes) {
+		NumerotationContext num;
+		for(int i=0; i<listDiag.count(); i++){
+			num.clear();
+			num.addValue("ten",5);
+			num.addValue("string","U");
+			num.addValue("folio");
+			listDiag.at(i)->setNumerotation(Diagram::Conductors, num);
+			qDebug() << "ok";
+		}
+	}
+}
+

Modified: trunk/sources/ui/dialogconductorautonum.h
===================================================================
--- trunk/sources/ui/dialogconductorautonum.h	2013-05-02 11:47:14 UTC (rev 2138)
+++ trunk/sources/ui/dialogconductorautonum.h	2013-05-02 14:50:44 UTC (rev 2139)
@@ -36,7 +36,8 @@
 	~DialogConductorAutoNum();
 	
 	private slots:
-	void on_pushButton_delete_clicked();	
+	void on_pushButton_annotation_clicked();
+	void on_pushButton_delete_clicked();
 	void on_pushButton_close_clicked();
 	
 	private:


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