[qet] [2846] Folio List: DXF folio corrected, Delete folio sheet bug corrected, |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2846
Author: abhishekm71
Date: 2014-02-10 12:48:05 +0100 (Mon, 10 Feb 2014)
Log Message:
-----------
Folio List: DXF folio corrected, Delete folio sheet bug corrected,
Folio New Sheets are inserted in the beginning but after the previous folio sheets
Modified Paths:
--------------
trunk/sources/exportdialog.cpp
trunk/sources/projectview.cpp
trunk/sources/qetdiagrameditor.cpp
trunk/sources/qetproject.cpp
Modified: trunk/sources/exportdialog.cpp
===================================================================
--- trunk/sources/exportdialog.cpp 2014-02-10 06:19:09 UTC (rev 2845)
+++ trunk/sources/exportdialog.cpp 2014-02-10 11:48:05 UTC (rev 2846)
@@ -419,8 +419,8 @@
y0 += rowHeight;
QRectF row_rect(x0, y0, list_rectangles[0] -> width(), rowHeight);
fillRow(file_path, row_rect, diagram_list[i] -> border_and_titleblock.author(),
- diagram_list[i] -> border_and_titleblock.title(),
- diagram_list[i] -> border_and_titleblock.folio(),
+ diagram_list[i] -> title(),
+ QString::number(diagram_list[i] ->folioIndex()+1),
diagram_list[i] -> border_and_titleblock.date().toString("dd/MM/yyyy"));
}
@@ -436,8 +436,8 @@
y0 += rowHeight;
QRectF row_rect(x0, y0, list_rectangles[1] -> width(), rowHeight);
fillRow(file_path, row_rect, diagram_list[i] -> border_and_titleblock.author(),
- diagram_list[i] -> border_and_titleblock.title(),
- diagram_list[i] -> border_and_titleblock.folio(),
+ diagram_list[i] -> title(),
+ QString::number(diagram_list[i] ->folioIndex()+1),
diagram_list[i] -> border_and_titleblock.date().toString("dd/MM/yyyy"));
}
Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp 2014-02-10 06:19:09 UTC (rev 2845)
+++ trunk/sources/projectview.cpp 2014-02-10 11:48:05 UTC (rev 2846)
@@ -339,7 +339,13 @@
// Add new tab for the diagram
tabs_ -> addTab(diagram, QET::Icons::Diagram, diagram -> title());
diagram -> setFrameStyle(QFrame::Plain | QFrame::NoFrame);
- diagrams_ << diagram;
+
+ // Add diagram type is a folio list then add it just after the last folio list in project, else add it at the back.
+ //if (DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram))
+ //diagrams_.insert(DiagramFolioList::folioList_quantity, diagram);
+ //else
+ diagrams_ << diagram;
+
rebuildDiagramsMap();
connect(diagram, SIGNAL(showDiagram(Diagram*)), this, SLOT(showDiagram(Diagram*)));
connect(diagram, SIGNAL(titleChanged(DiagramView *, const QString &)), this, SLOT(updateTabTitle(DiagramView *, const QString &)));
@@ -350,8 +356,12 @@
// signal diagram was added
emit(diagramAdded(diagram));
// move tab to front if wanted
- if (front)
- tabs_->moveTab(tabs_->count()-1, 0);
+ if (front) { //DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram ->diagram())) {
+ //int tabCount = tabs_ -> count();
+ //for (int i = 0; i < (tabCount-1) - (DiagramFolioList::folioList_quantity-1); i++)
+ //moveDiagramUp(diagram);
+ tabs_->moveTab(tabs_->count()-1, DiagramFolioList::folioList_quantity-1);
+ }
}
/**
@@ -421,6 +431,7 @@
void ProjectView::showDiagram(DiagramView *diagram) {
if (!diagram) return;
tabs_ -> setCurrentWidget(diagram);
+ ;
}
/**
Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp 2014-02-10 06:19:09 UTC (rev 2845)
+++ trunk/sources/qetdiagrameditor.cpp 2014-02-10 11:48:05 UTC (rev 2846)
@@ -652,7 +652,7 @@
new_project -> setDefaultReportProperties(defaultReportProperties());
// add summary and new diagram
- new_project -> addNewDiagramFolioList();
+ //new_project -> addNewDiagramFolioList();
new_project -> addNewDiagram();
return(addProject(new_project));
@@ -1804,7 +1804,24 @@
if (ProjectView *current_project = currentProject()) {
if (DiagramView *current_diagram = current_project -> currentDiagram()) {
can_update_actions = false;
+ bool isFolioList = false;
+ if (DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(current_diagram -> diagram()))
+ isFolioList = true;
current_project -> removeDiagram(current_diagram);
+ if (isFolioList) {
+ foreach (DiagramView *diag, current_project -> diagrams()) {
+ if (DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diag -> diagram())) {
+ current_project -> removeDiagram(diag);
+ }
+ }
+ } 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) {
+ current_project -> removeDiagram(diag);
+ }
+ }
+ }
}
}
}
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2014-02-10 06:19:09 UTC (rev 2845)
+++ trunk/sources/qetproject.cpp 2014-02-10 11:48:05 UTC (rev 2846)
@@ -865,34 +865,12 @@
*/
void QETProject::removeDiagram(Diagram *diagram) {
// ne fait rien si le projet est en lecture seule
- if (isReadOnly()) return;
-
+ if (isReadOnly()) return;
if (!diagram || !diagrams_.contains(diagram)) return;
- DiagramFolioList *ptr = dynamic_cast<DiagramFolioList *>(diagram);
- if (ptr) {
- foreach (Diagram *diag, diagrams_) {
- ptr = dynamic_cast<DiagramFolioList *>(diag);
- if (ptr) {
- diagrams_.removeAll(ptr);
- emit(diagramRemoved(this, ptr));
- delete ptr;
- }
- }
- } else if (diagrams_.removeAll(diagram)) {
+ if (diagrams_.removeAll(diagram)) {
emit(diagramRemoved(this, diagram));
delete diagram;
- if (diagrams_.size() % 58 == 0) {
- foreach (Diagram *diag, diagrams_) {
- ptr = dynamic_cast<DiagramFolioList *>(diag);
- if (ptr && ptr -> getId() == DiagramFolioList::folioList_quantity-1) {
- diagrams_.removeAll(ptr);
- emit(diagramRemoved(this, ptr));
- delete ptr;
- break;
- }
- }
- }
}
updateDiagramsFolioData();