diff options
Diffstat (limited to 'qt-ui/printdialog.cpp')
-rw-r--r-- | qt-ui/printdialog.cpp | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index 6c50ae99b..002f9b9f4 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -17,21 +17,24 @@ template_options::color_palette_struct ssrf_colors, almond_colors, blueshades_co PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { // initialize const colors - ssrf_colors.color1 = QColor::fromRgb(0xef, 0xf7, 0xff); + ssrf_colors.color1 = QColor::fromRgb(0xff, 0xff, 0xff); ssrf_colors.color2 = QColor::fromRgb(0xa6, 0xbc, 0xd7); - ssrf_colors.color3 = QColor::fromRgb(0x34, 0x65, 0xa4); - ssrf_colors.color4 = QColor::fromRgb(0x20, 0x4a, 0x87); - ssrf_colors.color5 = QColor::fromRgb(0x17, 0x37, 0x64); - almond_colors.color1 = QColor::fromRgb(243, 234, 207); + ssrf_colors.color3 = QColor::fromRgb(0xef, 0xf7, 0xff); + ssrf_colors.color4 = QColor::fromRgb(0x34, 0x65, 0xa4); + ssrf_colors.color5 = QColor::fromRgb(0x20, 0x4a, 0x87); + ssrf_colors.color6 = QColor::fromRgb(0x17, 0x37, 0x64); + almond_colors.color1 = QColor::fromRgb(255, 255, 255); almond_colors.color2 = QColor::fromRgb(253, 204, 156); - almond_colors.color3 = QColor::fromRgb(136, 160, 150); - almond_colors.color4 = QColor::fromRgb(187, 171, 139); - almond_colors.color5 = QColor::fromRgb(239, 130, 117); - blueshades_colors.color1 = QColor::fromRgb(182, 192, 206); + almond_colors.color3 = QColor::fromRgb(243, 234, 207); + almond_colors.color4 = QColor::fromRgb(136, 160, 150); + almond_colors.color5 = QColor::fromRgb(187, 171, 139); + almond_colors.color6 = QColor::fromRgb(0, 0, 0); + blueshades_colors.color1 = QColor::fromRgb(255, 255, 255); blueshades_colors.color2 = QColor::fromRgb(142, 152, 166); - blueshades_colors.color3 = QColor::fromRgb(31, 49, 75); - blueshades_colors.color4 = QColor::fromRgb(21, 45, 84); - blueshades_colors.color5 = QColor::fromRgb(5, 25, 56); + blueshades_colors.color3 = QColor::fromRgb(182, 192, 206); + blueshades_colors.color4 = QColor::fromRgb(31, 49, 75); + blueshades_colors.color5 = QColor::fromRgb(21, 45, 84); + blueshades_colors.color6 = QColor::fromRgb(0, 0, 0); // check if the options were previously stored in the settings; if not use some defaults. QSettings s; @@ -164,13 +167,6 @@ void PrintDialog::onFinished() void PrintDialog::previewClicked(void) { - if (printOptions.type == print_options::STATISTICS) { - QMessageBox msgBox; - msgBox.setText("This feature is not implemented yet"); - msgBox.exec(); - return; - } - QPrintPreviewDialog previewDialog(&qprinter, this, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowTitleHint); @@ -180,13 +176,6 @@ void PrintDialog::previewClicked(void) void PrintDialog::printClicked(void) { - if (printOptions.type == print_options::STATISTICS) { - QMessageBox msgBox; - msgBox.setText("This feature is not implemented yet"); - msgBox.exec(); - return; - } - QPrintDialog printDialog(&qprinter, this); if (printDialog.exec() == QDialog::Accepted) { switch (printOptions.type) { @@ -195,6 +184,7 @@ void PrintDialog::printClicked(void) printer->print(); break; case print_options::STATISTICS: + printer->print_statistics(); break; } close(); @@ -204,7 +194,14 @@ void PrintDialog::printClicked(void) void PrintDialog::onPaintRequested(QPrinter *printerPtr) { connect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int))); - printer->print(); + switch (printOptions.type) { + case print_options::DIVELIST: + printer->print(); + break; + case print_options::STATISTICS: + printer->print_statistics(); + break; + } progressBar->setValue(0); disconnect(printer, SIGNAL(progessUpdated(int)), progressBar, SLOT(setValue(int))); } |