mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Conductor autonumerotation: Remove one autonum per diagram and add global autonums for the project.
several diagram can share the same autonumerotation. This is first step, need to be improved and readd some feature (disabled for first step). git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3239 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "titleblockpropertieswidget.h"
|
||||
#include "conductorpropertieswidget.h"
|
||||
#include "diagramcommands.h"
|
||||
#include "autonumselectorwidget.h"
|
||||
|
||||
/**
|
||||
* @brief DiagramPropertiesDialog::DiagramPropertiesDialog
|
||||
@@ -62,6 +63,11 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(conductors, this);
|
||||
cpw -> setReadOnly(diagram_is_read_only);
|
||||
|
||||
//Conductor autonum
|
||||
AutonumSelectorWidget *asw = new AutonumSelectorWidget(diagram -> project() -> conductorAutoNum().keys(), this);
|
||||
asw -> setCurrentItem(diagram -> conductorsAutonumName());
|
||||
cpw->addAutonumWidget(asw);
|
||||
|
||||
// Buttons
|
||||
QDialogButtonBox boutons(diagram_is_read_only ? QDialogButtonBox::Ok : QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(&boutons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
@@ -70,7 +76,7 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
QGridLayout glayout(this);
|
||||
glayout.addWidget(border_infos,0,0);
|
||||
glayout.addWidget(titleblock_infos, 1, 0);
|
||||
glayout.addWidget(cpw, 0, 1, 0 ,1, Qt::AlignTop);
|
||||
glayout.addWidget(cpw, 0, 1, 0, 1, Qt::AlignTop);
|
||||
glayout.addWidget(&boutons, 2, 1);
|
||||
|
||||
// if dialog is accepted
|
||||
@@ -94,6 +100,11 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
/// TODO implement an undo command to allow the user to undo/redo this action
|
||||
diagram -> defaultConductorProperties = new_conductors;
|
||||
}
|
||||
|
||||
// Conductor autonum name
|
||||
if (asw -> text() != diagram -> conductorsAutonumName()) {
|
||||
diagram -> setConductorsAutonumName (asw -> text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user