subsurface/qt-ui/printdialog.h
Lubomir I. Ivanov 7ea728e95f Print: add the support to store margins and printer options
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-11-13 15:05:11 -08:00

33 lines
637 B
C++

#ifndef PRINTDIALOG_H
#define PRINTDIALOG_H
#include <QDialog>
#include <QPrinter>
#include "../display.h"
class QProgressBar;
class PrintOptions;
class PrintLayout;
// should be based on a custom QPrintDialog class
class PrintDialog : public QDialog {
Q_OBJECT
public:
explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
private:
PrintOptions *optionsWidget;
PrintLayout *printLayout;
QProgressBar *progressBar;
QPrinter printer;
struct print_options printOptions;
private
slots:
void onFinished();
void previewClicked();
void printClicked();
void onPaintRequested(QPrinter *);
};
#endif // PRINTDIALOG_H