aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printdialog.cpp
AgeCommit message (Collapse)Author
2014-04-25Print dialog: make Ctrl-Q and Ctlr-W workGravatar Dirk Hohndel
All these recent commits should have included: See #489 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-16UI adjustments in Print Dialog WindowGravatar Andrey Zhdanov
- move buttons to the bottom of the window - use QDialogButtonBox that allows to follow platform-dependent button layout - enlarge window size to not to crop content - change "Close" button action from "accept" to "reject" Signed-off-by: Andrey Zhdanov <andrjufka@gmail.com> 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-12Correctly track parent of print dialogGravatar Dirk Hohndel
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: make the dialog slightly largerGravatar Lubomir I. Ivanov
I don't recall why but this dialog ended with a fixed size (setFixedSize()), so it has to be re-adjusted each time a change is made in there. We resize it to compensate for the addition of the progress bar. 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-12-04PrintDialog: change a commentGravatar Lubomir I. Ivanov
The entire dialog is 'temporary' and should be replaced, so we slightly modify the comment about the PrintOptions widget. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04PrintDialog: add a progress bar in the dialogGravatar Lubomir I. Ivanov
This dialog will be eventually replaced by a better one, but for now we can add a progress bar to it. Next step would be to add separate Print/Preview buttons and emit progress bar updates from the PrintLayout class. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Fix all leak-at-exit from singletons in SubsurfaceGravatar Thiago Macieira
Subsurface creates a lot of singleton instances on demand, but nothing ever deleted them. Since they are singletons, these memory allocations are technically not leaks. However, they clutter the output in valgrind and other memory analysers, hiding the real issues. The solution is to delete these items at exit. For the models and for gettextFromC, the solution is to use a QScopedPointer, which will delete its payload when it gets destroyed. For the dialogs and other widgets, we can't do that: they need to be deleted before QApplication exits, so we just set the parent in all of them to the main window. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Print: add an icon for the print dialogGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30Print: adjustments to PrintDialogGravatar Lubomir I. Ivanov
- Hide the sizeing sliders from PrintOptions. we don't really support any of those in PrintLayout and these are not that useful and easy to implement, until some sort of layouting/templating system is in place. - Move the 'Print' button on top as a workaround, since if it's bellow the print options it stays bellow an empty area where the now hidden sizing sliders are. - Resize the dialog to a smaller size Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-10-15printdialog: Remove the pre-set DPI and some commentsGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-18Print: add experimental code for printing profilesGravatar Lubomir I. Ivanov
PrintLayout::printSixDives() goes trough all dives and prints their profiles on full portrait pages. This method is based on resizing the ProfileGraphicsView widget, plotting each dive and then 'grabbing' it using QPixmap::grabWidget(). 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 setup() method to PrintLayoutGravatar Lubomir I. Ivanov
The setup() method will be called each time to obtain the current printer settings. Also it calculates required scalling based on screen agains printer DPI. 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-10Print: label update on height slider moveGravatar Lubomir I. Ivanov
The PrintOptions widget has value labels next to the horizontal sliders. Add slots to update these labels when a slider moves. Patch also makes a modification so that the PrintOptions constructor requires a 'struct options' pointer. If an options struct is not received we do not set predefined values and do not connect signals to slots, where options will be updated immediately. 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>