mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Folio List: New Diagram Folio list can be added if not already present.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2818 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -46,7 +46,8 @@ QETProject::QETProject(int diagrams, QObject *parent) :
|
||||
project_qet_version_(-1),
|
||||
modified_(false),
|
||||
read_only_(false),
|
||||
titleblocks_(this)
|
||||
titleblocks_(this),
|
||||
folio_list_added_(false)
|
||||
{
|
||||
// 0 a n schema(s) vide(s)
|
||||
int diagrams_count = qMax(0, diagrams);
|
||||
@@ -846,6 +847,7 @@ Diagram *QETProject::addNewDiagramFolioList() {
|
||||
diagram_folio_list -> border_and_titleblock.setTitle(title);
|
||||
|
||||
addDiagram(diagram_folio_list);
|
||||
folio_list_added_ = true;
|
||||
emit(diagramAdded(this, diagram_folio_list));
|
||||
return(diagram_folio_list);
|
||||
}
|
||||
@@ -861,6 +863,10 @@ void QETProject::removeDiagram(Diagram *diagram) {
|
||||
if (!diagram || !diagrams_.contains(diagram)) return;
|
||||
|
||||
if (diagrams_.removeAll(diagram)) {
|
||||
|
||||
DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
|
||||
if (ptr)
|
||||
folio_list_added_ = false;
|
||||
emit(diagramRemoved(this, diagram));
|
||||
delete diagram;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user