mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
add call method to enumerate conductor
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2139 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -80,3 +80,41 @@ void DialogConductorAutoNum::on_pushButton_close_clicked() {
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user