mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: use the same code for both statistics and divelist print
- use the same generic code for both types of templates - check for the printing type before generating the template - remove unused printStatistics() method Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This commit is contained in:
parent
4553155cf3
commit
69f2921ffa
3 changed files with 13 additions and 74 deletions
|
@ -178,15 +178,8 @@ void PrintDialog::printClicked(void)
|
|||
{
|
||||
QPrintDialog printDialog(&qprinter, this);
|
||||
if (printDialog.exec() == QDialog::Accepted) {
|
||||
switch (printOptions.type) {
|
||||
case print_options::DIVELIST:
|
||||
connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
|
||||
printer->print();
|
||||
break;
|
||||
case print_options::STATISTICS:
|
||||
printer->print_statistics();
|
||||
break;
|
||||
}
|
||||
connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
|
||||
printer->print();
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
@ -194,14 +187,7 @@ void PrintDialog::printClicked(void)
|
|||
void PrintDialog::onPaintRequested(QPrinter *printerPtr)
|
||||
{
|
||||
connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
|
||||
switch (printOptions.type) {
|
||||
case print_options::DIVELIST:
|
||||
printer->print();
|
||||
break;
|
||||
case print_options::STATISTICS:
|
||||
printer->print_statistics();
|
||||
break;
|
||||
}
|
||||
printer->print();
|
||||
progressBar->setValue(0);
|
||||
disconnect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue