[qet] [2149] dialog autonum, add default text if diagram or project title are empty

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


Revision: 2149
Author:   blacksun
Date:     2013-05-08 12:32:08 +0200 (Wed, 08 May 2013)
Log Message:
-----------
dialog autonum, add default text if diagram or project title are empty

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

Modified: trunk/sources/ui/diagramselection.cpp
===================================================================
--- trunk/sources/ui/diagramselection.cpp	2013-05-07 17:54:46 UTC (rev 2148)
+++ trunk/sources/ui/diagramselection.cpp	2013-05-08 10:32:08 UTC (rev 2149)
@@ -27,7 +27,10 @@
 	// list all diagrams presents in project
 	list_diagram_ = prj_ -> diagrams();
 	
-	ui -> label_prj -> setText( tr("Projet : ") + prj_ -> title() );
+	QString project_title = prj_ -> title();
+	if (project_title.isEmpty()) project_title = tr("Projet sans titre");
+
+	ui -> label_prj -> setText( tr("Projet : ") + project_title );
 	load_TableDiagram();
 }
 
@@ -63,7 +66,10 @@
 		QTableWidgetItem *item_Name  = new QTableWidgetItem();
 		QTableWidgetItem *item_State = new QTableWidgetItem();
 
-		item_Name  -> setData(Qt::DisplayRole, list_diagram_.at(i) -> title() );
+		QString diagram_title = list_diagram_.at(i) -> title();
+		if (diagram_title.isEmpty()) diagram_title = tr("Sch\351ma sans titre");
+
+		item_Name  -> setData(Qt::DisplayRole, diagram_title);
 		item_State -> setData(Qt::CheckStateRole, Qt::Checked);
 
 		ui -> tableDiagram -> setRowCount(j+1);		


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