Folio List: XML save/open added. When Application starts, folio list is not added

so that user gets the option to choose whether he wants to add folio list or not.
Bug remaining:
- When open project file with folio_list present, folio list sheets are at the end,
  not at the beginning.
- Possibly many others. Thorough testing required.



git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2847 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2014-02-10 13:58:30 +00:00
parent c96036b7fa
commit 0888f6e347
6 changed files with 63 additions and 32 deletions

View File

@@ -1681,7 +1681,7 @@ void QETDiagramEditor::addDiagramToProject() {
void QETDiagramEditor::addDiagramFolioListToProject() {
ProjectView *current_project = currentProject();
if (current_project && DiagramFolioList::folioList_quantity == 0) {
if (current_project && current_project -> project() -> getFolioSheetsQuantity() == 0) {
int diagram_qty = current_project -> diagrams().size();
for (int i = 0; i <= diagram_qty/58; i++)
current_project -> addNewDiagramFolioList();
@@ -1814,11 +1814,14 @@ void QETDiagramEditor::removeDiagramFromProject() {
current_project -> removeDiagram(diag);
}
}
//current_project ->project() ->setFolioSheetsQuantity(0);
} else if (current_project -> diagrams().size() % 58 == 0) {
foreach (DiagramView *diag, current_project -> diagrams()) {
DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diag -> diagram());
if (ptr && ptr -> getId() == DiagramFolioList::folioList_quantity-1) {
if (ptr && ptr -> getId() == current_project -> project() -> getFolioSheetsQuantity() - 1) {
current_project -> removeDiagram(diag);
//int folioQuantity = current_project -> project() -> getFolioSheetsQuantity();
//current_project -> project() -> setFolioSheetsQuantity(folioQuantity - 1);
}
}
}