From 6e4ebe3c5427b178808c0b0579803c56c5cf53d5 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Fri, 18 Jul 2014 11:43:15 +0300 Subject: Print: remove the height sliders from the PrintOptions class These were hidden and we don't really support them because our print layouting is not that flexible in Qt! Note: printoptions.ui is now converted to UNIX line breaks. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- qt-ui/printoptions.cpp | 45 ---- qt-ui/printoptions.h | 6 - qt-ui/printoptions.ui | 621 +++++++++++++++++-------------------------------- 3 files changed, 217 insertions(+), 455 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp index 5db665ab4..ac5f6550c 100644 --- a/qt-ui/printoptions.cpp +++ b/qt-ui/printoptions.cpp @@ -14,18 +14,7 @@ PrintOptions::PrintOptions(QWidget *parent, struct options *printOpt) void PrintOptions::setup(struct options *printOpt) { - /* these options are not supported ATM and we hide them. - * basically the entire PrintDialog class needs re-implementation, so that - * the paper size, DPI and all other options are displayed in one dialog. - * this way we can print directly or do an optional preview first. - */ - ui.sizingHeights->setVisible(false); - printOptions = printOpt; - // layout height sliders - initSliderWithLabel(ui.sliderPHeight, ui.valuePHeight, printOptions->profile_height); - initSliderWithLabel(ui.sliderOHeight, ui.valueOHeight, printOptions->notes_height); - initSliderWithLabel(ui.sliderNHeight, ui.valueNHeight, printOptions->tanks_height); // print type radio buttons switch (printOptions->type) { case options::PRETTY: @@ -52,9 +41,6 @@ void PrintOptions::setup(struct options *printOpt) // connect slots only once if (hasSetupSlots) return; - connect(ui.sliderPHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderPHeightMoved(int))); - connect(ui.sliderOHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderOHeightMoved(int))); - connect(ui.sliderNHeight, SIGNAL(sliderMoved(int)), this, SLOT(sliderNHeightMoved(int))); connect(ui.radioSixDives, SIGNAL(clicked(bool)), this, SLOT(radioSixDivesClicked(bool))); connect(ui.radioTwoDives, SIGNAL(clicked(bool)), this, SLOT(radioTwoDivesClicked(bool))); @@ -68,37 +54,6 @@ void PrintOptions::setup(struct options *printOpt) hasSetupSlots = true; } -// layout height sliders -void PrintOptions::initSliderWithLabel(QSlider *slider, QLabel *label, int value) -{ - slider->setValue(value); - label->setText(formatSliderValueText(value)); -} - -QString PrintOptions::formatSliderValueText(int value) -{ - QString str = QString("%1%").arg(QString::number(value)); - return str; -} - -void PrintOptions::sliderPHeightMoved(int value) -{ - ui.valuePHeight->setText(formatSliderValueText(value)); - printOptions->profile_height = value; -} - -void PrintOptions::sliderOHeightMoved(int value) -{ - ui.valueOHeight->setText(formatSliderValueText(value)); - printOptions->notes_height = value; -} - -void PrintOptions::sliderNHeightMoved(int value) -{ - ui.valueNHeight->setText(formatSliderValueText(value)); - printOptions->tanks_height = value; -} - // print type radio buttons void PrintOptions::radioSixDivesClicked(bool check) { diff --git a/qt-ui/printoptions.h b/qt-ui/printoptions.h index 9fc55ed52..66d3d7424 100644 --- a/qt-ui/printoptions.h +++ b/qt-ui/printoptions.h @@ -15,17 +15,11 @@ public: private: Ui::PrintOptions ui; - void setLabelFromSlider(QSlider *slider, QLabel *label); - void initSliderWithLabel(QSlider *slider, QLabel *label, int value); - QString formatSliderValueText(int value); struct options *printOptions; bool hasSetupSlots; private slots: - void sliderPHeightMoved(int value); - void sliderOHeightMoved(int value); - void sliderNHeightMoved(int value); void radioSixDivesClicked(bool check); void radioTwoDivesClicked(bool check); void radioTablePrintClicked(bool check); diff --git a/qt-ui/printoptions.ui b/qt-ui/printoptions.ui index 43f8e6cfd..c108315d0 100644 --- a/qt-ui/printoptions.ui +++ b/qt-ui/printoptions.ui @@ -1,408 +1,221 @@ - - - PrintOptions - - - - 0 - 0 - 511 - 448 - - - - - - 10 + + + PrintOptions + + + + 0 + 0 + 511 + 308 + + + + + + 10 70 - 489 - 81 - - - - Print options - - - - - 10 - 30 - 461 - 18 - - - - - 0 - 0 - - - - Print only selected dives - - - - - - 10 - 50 - 461 - 18 - - - - - 0 - 0 - - - - Print in color - - - - - - - 10 - 10 - 489 + 489 + 81 + + + + Print options + + + + + 10 + 30 + 461 + 18 + + + + + 0 + 0 + + + + Print only selected dives + + + + + + 10 + 50 + 461 + 18 + + + + + 0 + 0 + + + + Print in color + + + + + + + 10 + 10 + 489 51 - - - - - 0 - 0 - - - - - 0 - 0 - - - - Print type - - - - - 0 - 20 - 491 - 31 - - - - - QLayout::SetDefaultConstraint - - - 15 - - - 15 - - - - - - 0 - 0 - - - - 6 dives per page - - - true - - - - - - - - 0 - 0 - - - - 2 dives per page - - - - - - - - 0 - 0 - - - - Table print - - - - - - - - - - 10 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Print type + + + + + 0 + 20 + 491 + 31 + + + + + QLayout::SetDefaultConstraint + + + 15 + + + 15 + + + + + + 0 + 0 + + + + 6 dives per page + + + true + + + + + + + + 0 + 0 + + + + 2 dives per page + + + + + + + + 0 + 0 + + + + Table print + + + + + + + + + + 10 160 - 489 + 489 81 - - - - Ordering - - - - - 10 - 30 - 461 - 18 - - - - - 0 - 0 - - - - Profile on top - - - true - - - - - - 10 - 50 - 461 - 18 - - - - - 0 - 0 - - - - Notes on top - - - false - - - - - - - 10 - 250 - 489 - 141 - - - - Sizing heights (% of layout) - - - - - 260 - 30 - 211 - 20 - - - - 43 - - - 85 - - - Qt::Horizontal - - - - - - 10 - 30 - 201 - 20 - - - - - 0 - 0 - - - - Profile height (43% - 85%) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 70 - 201 - 20 - - - - - 0 - 0 - - - - Other data height (8% - 17%) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 260 - 70 - 211 - 20 - - - - 8 - - - 17 - - - Qt::Horizontal - - - - - - 260 - 110 - 211 - 20 - - - - 52 - - - Qt::Horizontal - - - - - - 10 - 110 - 201 - 20 - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Notes height (0% - 52%) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 220 - 30 - 31 - 20 - - - - 0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 220 - 70 - 31 - 20 - - - - 0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 220 - 110 - 31 - 20 - - - - 0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - radioSixDives - radioTwoDives - radioTablePrint - printSelected - printInColor - profileOnTop - notesOnTop - sliderPHeight - sliderOHeight - sliderNHeight - - - - + + + + Ordering + + + + + 10 + 30 + 461 + 18 + + + + + 0 + 0 + + + + Profile on top + + + true + + + + + + 10 + 50 + 461 + 18 + + + + + 0 + 0 + + + + Notes on top + + + false + + + + + + radioSixDives + radioTwoDives + radioTablePrint + printSelected + printInColor + profileOnTop + notesOnTop + + + + -- cgit v1.2.3-70-g09d2