aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printdialog.h
AgeCommit message (Collapse)Author
2015-07-05Printing: add template_options struct that contains templateGravatar Gehad elrobey
The template_options struct holds the settings variables in the code. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-01Fix NO_PRINTING when printing is disabled in QtGravatar Anton Lundin
Qt for android doesn't have any printing support, so this fixes NO_PRINTING so we can build against a Qt without any printing support at all. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Make Subsurface compile with NO_PRINTING setGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: call print from printer classGravatar Gehad elrobey
This is the main function that prints dive lists. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: remove the print_options struct from display.hGravatar Gehad elrobey
Move print_options struct to printoptions.h, its more relevant to be placed here. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: Remove the obsolete code from PrintDialogGravatar Gehad elrobey
We don't need any further calls to printLayout as it will be replaced by Printer class that handles the new custom printing capability. Also fix one coding style issue. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13Print: add the support to store margins and printer optionsGravatar Lubomir I. Ivanov
All the print options will be stored after the user closes or "cancels" the print dialog. There seems to be no good way to store the last selected page size, because print dialogs are different and some just list them as strings - A4, A3, etc. The patch also applies the following changes: - renames display.h's 'struct options' to 'struct print_options' as these were really just for the print dialog - the print_options dialog now stores more options as 'bool' - demote PrintDialog's 'printOptions' to 'private' Fixes #653 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Printing: only give up if no size is availableGravatar Dirk Hohndel
Checking for available printers appears to sometimes fail, even if there is a valid PDF or PS printer. Instead we bail if we can't get a valid size for the printer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Print: display an error message if no printers are foundGravatar Lubomir I. Ivanov
When pressing Print or Preview from the PrintDialog, we need to first check if there are printers installed. If not we abort and show an error message. This is needed because if no printers are installed, things like the reported page height could be zero and the profile and table print code in PrintLayout will break. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Remove printing when building for AndroidGravatar Anton Lundin
Qt for Android doesn't support printing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09PrintDialog small improvements.Gravatar Boris Barbulovski
* Remove closeClicked() slot, and use QDialogs accept() slot * Simplify QObject::connect call by removing the QObject scope. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09PrintDialog class cleanup.Gravatar Boris Barbulovski
* Remove static PrintDialog::instance() method * Remove void PrintDialog::runDialog() method * construct/destruct print dialog on demand Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04PrintDialog: reset the progress bar each time the dialog opensGravatar Lubomir I. Ivanov
This requires us to expose the progressBar as a private class member. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04Print: fix some forward declarationsGravatar Lubomir I. Ivanov
In the PrintLayout constructor we receive a pointer of PrintDialog, but the type is incomplete, as we only forward declare it in the class header. If we decide to eventually call a method from PrintDialog we also need to include printdialog.h in printlayout.cpp. The patch also fixes a similar issue in printdialog.h. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04PrintDialog: add a 'Close' buttonGravatar Lubomir I. Ivanov
The dialog was missing a 'Close' button so we add it. Also change the mnemonic of the 'Preview' button, as it was the same as the one for print 'Print'. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04PrintDialog: add separate Preview/Print buttonsGravatar Lubomir I. Ivanov
We rename our old 'Print' button to 'Preview' (as it did just that), and add a new one called 'Print' which does the direct printing, by creating a QPrintDialog instance. Both buttons are located on top of the dialog for now in a QHBoxLayout. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: add a print preview for testing purposesGravatar Lubomir I. Ivanov
Use a QPrintPreviewDialog, while the print logic is WIP. This way Qt will show the print output in a window instead of exporting to a file and opending it manualy. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10Print: add a class for print layoutingGravatar Lubomir I. Ivanov
PrintLayout is a class that will handle the layouting part of dive profiles, text, tables depending on the settings of a QPrinter and the PrinterDialog and PrintOptions instances. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-09Print: add UI for a print dialogGravatar Lubomir I. Ivanov
PrintOptions is a QWidget class to be used as an addition to a future print dialog (possibly based on QPrintDialog). Currently only contains a couple of radio buttons. PrintDialog (printdialog.cpp/h) which is a basic QDialog is currently added for testing only and it holds an instance of PrintOptions. Calling File->Print opens this test dialog for now. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>