mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
PrintLayout: add estimateTotalDives()
estimateTotalDives() is used to calculate the total dives to be printed, it requires a 'struct dive' pointer and a couple of 'int' pointers for the iterator 'i' and 'total' return. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
ecf483db46
commit
08cf1be212
2 changed files with 15 additions and 0 deletions
|
@ -91,6 +91,17 @@ void PrintLayout::setup()
|
||||||
scaledPageH = pageRect.height() / scaleY;
|
scaledPageH = pageRect.height() / scaleY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// go trought the dive table and find how many dives we are a going to print
|
||||||
|
void PrintLayout::estimateTotalDives(struct dive *dive, int *i, int *total) const
|
||||||
|
{
|
||||||
|
*total = 0;
|
||||||
|
for_each_dive(*i, dive) {
|
||||||
|
if (!dive->selected && printOptions->print_selected)
|
||||||
|
continue;
|
||||||
|
(*total)++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* the used formula here is:
|
/* the used formula here is:
|
||||||
* s = (S - (n - 1) * p) / n
|
* s = (S - (n - 1) * p) / n
|
||||||
* where:
|
* where:
|
||||||
|
|
|
@ -34,11 +34,15 @@ private:
|
||||||
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
|
void estimateTotalDives(struct dive *dive, int *i, int *total) const;
|
||||||
void printProfileDives(int divesPerRow, int divesPerColumn);
|
void printProfileDives(int divesPerRow, int divesPerColumn);
|
||||||
QTableView *createProfileTable(ProfilePrintModel *model, const int tableW);
|
QTableView *createProfileTable(ProfilePrintModel *model, const int tableW);
|
||||||
void printTable();
|
void printTable();
|
||||||
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
|
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
|
||||||
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
|
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void signalProgress(int);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue