mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
PrintLayout: emit progress from printProfileDives()
printProfileDives() now emits a 'signalProgress' each time a dive is done processing. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
08cf1be212
commit
ac7126b84a
1 changed files with 8 additions and 2 deletions
|
@ -115,6 +115,12 @@ void PrintLayout::estimateTotalDives(struct dive *dive, int *i, int *total) cons
|
||||||
|
|
||||||
void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
{
|
{
|
||||||
|
int i, row = 0, col = 0, printed = 0, total = 0;
|
||||||
|
struct dive *dive;
|
||||||
|
estimateTotalDives(dive, &i, &total);
|
||||||
|
if (!total)
|
||||||
|
return;
|
||||||
|
|
||||||
// setup a painter
|
// setup a painter
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin(printer);
|
painter.begin(printer);
|
||||||
|
@ -159,8 +165,6 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
yOffsetTable = scaledH - tableH;
|
yOffsetTable = scaledH - tableH;
|
||||||
|
|
||||||
// plot the dives at specific rows and columns on the page
|
// plot the dives at specific rows and columns on the page
|
||||||
int i, row = 0, col = 0;
|
|
||||||
struct dive *dive;
|
|
||||||
for_each_dive(i, dive) {
|
for_each_dive(i, dive) {
|
||||||
if (!dive->selected && printOptions->print_selected)
|
if (!dive->selected && printOptions->print_selected)
|
||||||
continue;
|
continue;
|
||||||
|
@ -186,6 +190,8 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
table->render(&painter);
|
table->render(&painter);
|
||||||
painter.setTransform(origTransform);
|
painter.setTransform(origTransform);
|
||||||
col++;
|
col++;
|
||||||
|
printed++;
|
||||||
|
emit signalProgress((printed * 100) / total);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue