mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: move #includes from headers to source files
To decrease include-file interdependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2239ffe13c
commit
fa6eb6144b
10 changed files with 39 additions and 21 deletions
|
@ -55,9 +55,12 @@
|
||||||
#include "profile-widget/profilewidget2.h"
|
#include "profile-widget/profilewidget2.h"
|
||||||
|
|
||||||
#ifndef NO_PRINTING
|
#ifndef NO_PRINTING
|
||||||
|
#include <QPrinter>
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include "desktop-widgets/printdialog.h"
|
#include "desktop-widgets/printdialog.h"
|
||||||
|
#include "desktop-widgets/printer.h"
|
||||||
|
#include "desktop-widgets/templatelayout.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "qt-models/cylindermodel.h"
|
#include "qt-models/cylindermodel.h"
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include "printdialog.h"
|
#include "printdialog.h"
|
||||||
#include "printoptions.h"
|
#include "printer.h"
|
||||||
#include "mainwindow.h"
|
#include "core/pref.h"
|
||||||
|
#include "core/dive.h" // for existing_filename
|
||||||
|
|
||||||
#ifndef NO_PRINTING
|
#ifndef NO_PRINTING
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
#include <QPrinter>
|
||||||
#include <QPrintPreviewDialog>
|
#include <QPrintPreviewDialog>
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
#ifndef NO_PRINTING
|
#ifndef NO_PRINTING
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QPrinter>
|
|
||||||
#include "printoptions.h"
|
|
||||||
#include "printer.h"
|
|
||||||
#include "templateedit.h"
|
#include "templateedit.h"
|
||||||
|
#include "printoptions.h"
|
||||||
|
|
||||||
|
class Printer;
|
||||||
|
class QPrinter;
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
class PrintOptions;
|
class PrintOptions;
|
||||||
class PrintLayout;
|
class PrintLayout;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include "printer.h"
|
#include "printer.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
#include "templatelayout.h"
|
#include "templatelayout.h"
|
||||||
#include "core/statistics.h"
|
#include "core/statistics.h"
|
||||||
#include "core/qthelper.h"
|
#include "core/qthelper.h"
|
||||||
|
@ -7,6 +8,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QPrinter>
|
||||||
#include <QtWebKitWidgets>
|
#include <QtWebKitWidgets>
|
||||||
#include <QWebElementCollection>
|
#include <QWebElementCollection>
|
||||||
#include <QWebElement>
|
#include <QWebElement>
|
||||||
|
@ -28,7 +30,8 @@ Printer::~Printer()
|
||||||
delete webView;
|
delete webView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Printer::putProfileImage(QRect profilePlaceholder, QRect viewPort, QPainter *painter, struct dive *dive, QPointer<ProfileWidget2> profile)
|
void Printer::putProfileImage(const QRect &profilePlaceholder, const QRect &viewPort, QPainter *painter,
|
||||||
|
struct dive *dive, QPointer<ProfileWidget2> profile)
|
||||||
{
|
{
|
||||||
int x = profilePlaceholder.x() - viewPort.x();
|
int x = profilePlaceholder.x() - viewPort.x();
|
||||||
int y = profilePlaceholder.y() - viewPort.y();
|
int y = profilePlaceholder.y() - viewPort.y();
|
||||||
|
|
|
@ -2,14 +2,15 @@
|
||||||
#ifndef PRINTER_H
|
#ifndef PRINTER_H
|
||||||
#define PRINTER_H
|
#define PRINTER_H
|
||||||
|
|
||||||
#include <QPrinter>
|
|
||||||
#include <QWebView>
|
|
||||||
#include <QRect>
|
|
||||||
#include <QPainter>
|
|
||||||
|
|
||||||
#include "printoptions.h"
|
#include "printoptions.h"
|
||||||
#include "templateedit.h"
|
#include "templateedit.h"
|
||||||
|
|
||||||
|
class ProfileWidget2;
|
||||||
|
class QPainter;
|
||||||
|
class QPaintDevice;
|
||||||
|
class QRect;
|
||||||
|
class QWebView;
|
||||||
|
|
||||||
class Printer : public QObject {
|
class Printer : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -30,7 +31,8 @@ private:
|
||||||
int dpi;
|
int dpi;
|
||||||
void render(int Pages);
|
void render(int Pages);
|
||||||
void flowRender();
|
void flowRender();
|
||||||
void putProfileImage(QRect box, QRect viewPort, QPainter *painter, struct dive *dive, QPointer<ProfileWidget2> profile);
|
void putProfileImage(const QRect &box, const QRect &viewPort, QPainter *painter,
|
||||||
|
struct dive *dive, QPointer<ProfileWidget2> profile);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void templateProgessUpdated(int value);
|
void templateProgessUpdated(int value);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include "printoptions.h"
|
#include "printoptions.h"
|
||||||
#include "templateedit.h"
|
#include "templateedit.h"
|
||||||
|
#include "templatelayout.h"
|
||||||
#include "core/qthelper.h"
|
#include "core/qthelper.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include "templateedit.h"
|
#include "templateedit.h"
|
||||||
#include "printoptions.h"
|
#include "templatelayout.h"
|
||||||
#include "printer.h"
|
#include "printer.h"
|
||||||
#include "ui_templateedit.h"
|
#include "ui_templateedit.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
TemplateEdit::TemplateEdit(QWidget *parent, const print_options &printOptions, template_options &templateOptions) :
|
TemplateEdit::TemplateEdit(QWidget *parent, const print_options &printOptions, template_options &templateOptions) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#define TEMPLATEEDIT_H
|
#define TEMPLATEEDIT_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "templatelayout.h"
|
#include "printoptions.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class TemplateEdit;
|
class TemplateEdit;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <QFileDevice>
|
#include <QFileDevice>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <list>
|
#include <QTextStream>
|
||||||
|
|
||||||
#include "templatelayout.h"
|
#include "templatelayout.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "printoptions.h"
|
||||||
#include "core/divelist.h"
|
#include "core/divelist.h"
|
||||||
#include "core/selection.h"
|
#include "core/selection.h"
|
||||||
|
#include "core/qthelper.h"
|
||||||
|
#include "core/subsurface-qt/diveobjecthelper.h"
|
||||||
|
#include "core/subsurface-qt/cylinderobjecthelper.h" // TODO: remove once grantlee supports Q_GADGET objects
|
||||||
|
|
||||||
QList<QString> grantlee_templates, grantlee_statistics_templates;
|
QList<QString> grantlee_templates, grantlee_statistics_templates;
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
#ifndef TEMPLATELAYOUT_H
|
#ifndef TEMPLATELAYOUT_H
|
||||||
#define TEMPLATELAYOUT_H
|
#define TEMPLATELAYOUT_H
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include "mainwindow.h"
|
|
||||||
#include "printoptions.h"
|
|
||||||
#include "core/statistics.h"
|
#include "core/statistics.h"
|
||||||
#include "core/qthelper.h"
|
#include <QStringList>
|
||||||
#include "core/subsurface-qt/diveobjecthelper.h"
|
|
||||||
#include "core/subsurface-qt/cylinderobjecthelper.h" // TODO: remove once grantlee supports Q_GADGET objects
|
class DiveObjectHelperGrantlee;
|
||||||
|
class CylinderObjectHelper;
|
||||||
|
struct print_options;
|
||||||
|
struct template_options;
|
||||||
|
class QTextStream;
|
||||||
|
|
||||||
int getTotalWork(const print_options &printOptions);
|
int getTotalWork(const print_options &printOptions);
|
||||||
void find_all_templates();
|
void find_all_templates();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue