Mercurial > octave
annotate libgui/languages/build_ts/octave-qt/qpagesetupdialog_unix.cpp @ 32535:dd5ece3664ed stable
update Qt and Qsci sources for scanning text for translation
* libgui/languages/build_ts/octave-qsci/*: updated source files
from Qscintilla
* libgui/languages/build_ts/octave-qt/*.: updated source files
from Qt
* libgui/languages/build_ts/update_external_sources: script for
updating above mentioned source files from user defined directories
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Mon, 04 Dec 2023 19:55:32 +0100 |
parents | 5ceb4bfcdb0f |
children |
rev | line source |
---|---|
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
1 // Copyright (C) 2016 The Qt Company Ltd. |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
3 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
4 #include "qpagesetupdialog.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
5 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
6 #include "qpagesetupdialog_unix_p.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
7 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
8 #include <private/qpagesetupdialog_p.h> |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
9 #include <private/qprintdevice_p.h> |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
10 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
11 #include <private/qcups_p.h> |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
12 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
13 |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
14 #include "qpainter.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
15 #include "qprintdialog.h" |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
16 #include "qstringconverter.h" |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
17 #include "qdialogbuttonbox.h" |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
18 #include <ui_qpagesetupwidget.h> |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
19 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
20 #include <QtPrintSupport/qprinter.h> |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
21 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
22 #include <qpa/qplatformprintplugin.h> |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
23 #include <qpa/qplatformprintersupport.h> |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
24 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
25 QT_BEGIN_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
26 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
27 using namespace Qt::StringLiterals; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
28 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
29 extern QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
30 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
31 // Disabled until we have support for papersources on unix |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
32 // #define PSD_ENABLE_PAPERSOURCE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
33 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
34 #ifdef PSD_ENABLE_PAPERSOURCE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
35 static const char *paperSourceNames[] = { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
36 "Only One", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
37 "Lower", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
38 "Middle", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
39 "Manual", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
40 "Envelope", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
41 "Envelope manual", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
42 "Auto", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
43 "Tractor", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
44 "Small format", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
45 "Large format", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
46 "Large capacity", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
47 "Cassette", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
48 "Form source", |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
49 0 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
50 }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
51 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
52 struct PaperSourceNames |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
53 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
54 PaperSourceNames(const char *nam, QPrinter::PaperSource ps) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
55 : paperSource(ps), name(nam) {} |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
56 QPrinter::PaperSource paperSource; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
57 const char *name; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
58 }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
59 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
60 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
61 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
62 // QPagePreview |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
63 // - Private widget to display preview of page layout |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
64 // - Embedded in QPageSetupWidget |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
65 |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
66 class QPagePreview : public QWidget |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
67 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
68 public: |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
69 QPagePreview(QWidget *parent) : QWidget(parent) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
70 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
71 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
72 setMinimumSize(50, 50); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
73 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
74 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
75 void setPageLayout(const QPageLayout &layout) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
76 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
77 m_pageLayout = layout; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
78 update(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
79 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
80 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
81 void setPagePreviewLayout(int columns, int rows) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
82 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
83 m_pagePreviewColumns = columns; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
84 m_pagePreviewRows = rows; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
85 update(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
86 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
87 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
88 protected: |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
89 void paintEvent(QPaintEvent *) override |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
90 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
91 QSize pageSize = m_pageLayout.fullRectPoints().size(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
92 QSizeF scaledSize = pageSize.scaled(width() - 10, height() - 10, Qt::KeepAspectRatio); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
93 QRect pageRect = QRect(QPoint(0,0), scaledSize.toSize()); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
94 pageRect.moveCenter(rect().center()); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
95 qreal width_factor = scaledSize.width() / pageSize.width(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
96 qreal height_factor = scaledSize.height() / pageSize.height(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
97 QMarginsF margins = m_pageLayout.margins(QPageLayout::Point); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
98 int left = qRound(margins.left() * width_factor); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
99 int top = qRound(margins.top() * height_factor); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
100 int right = qRound(margins.right() * width_factor); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
101 int bottom = qRound(margins.bottom() * height_factor); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
102 QRect marginRect(pageRect.x() + left, pageRect.y() + top, |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
103 pageRect.width() - (left + right + 1), pageRect.height() - (top + bottom + 1)); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
104 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
105 QPainter p(this); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
106 QColor shadow(palette().mid().color()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
107 for (int i=1; i<6; ++i) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
108 shadow.setAlpha(180-i*30); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
109 QRect offset(pageRect.adjusted(i, i, i, i)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
110 p.setPen(shadow); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
111 p.drawLine(offset.left(), offset.bottom(), offset.right(), offset.bottom()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
112 p.drawLine(offset.right(), offset.top(), offset.right(), offset.bottom()-1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
113 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
114 p.fillRect(pageRect, palette().light()); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
115 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
116 if (marginRect.isValid()) { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
117 p.setPen(QPen(palette().color(QPalette::Dark), 0, Qt::DotLine)); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
118 p.drawRect(marginRect); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
119 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
120 marginRect.adjust(2, 2, -1, -1); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
121 p.setClipRect(marginRect); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
122 QFont font; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
123 font.setPointSizeF(font.pointSizeF()*0.25); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
124 p.setFont(font); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
125 p.setPen(palette().color(QPalette::Dark)); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
126 QString text("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."_L1); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
127 for (int i=0; i<3; ++i) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
128 text += text; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
129 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
130 const int spacing = pageRect.width() * 0.1; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
131 const int textWidth = (marginRect.width() - (spacing * (m_pagePreviewColumns-1))) / m_pagePreviewColumns; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
132 const int textHeight = (marginRect.height() - (spacing * (m_pagePreviewRows-1))) / m_pagePreviewRows; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
133 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
134 for (int x = 0 ; x < m_pagePreviewColumns; ++x) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
135 for (int y = 0 ; y < m_pagePreviewRows; ++y) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
136 QRect textRect(marginRect.left() + x * (textWidth + spacing), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
137 marginRect.top() + y * (textHeight + spacing), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
138 textWidth, textHeight); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
139 p.drawText(textRect, Qt::TextWordWrap|Qt::AlignVCenter, text); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
140 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
141 } |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
142 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
143 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
144 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
145 private: |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
146 // Page Layout |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
147 QPageLayout m_pageLayout; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
148 // Pages Per Sheet / n-up layout |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
149 int m_pagePreviewColumns, m_pagePreviewRows; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
150 }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
151 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
152 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
153 // QUnixPageSetupDialogPrivate |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
154 // - Linux / Cups implementation of QPageSetupDialogPrivate |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
155 // - Embeds QPageSetupWidget |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
156 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
157 class QUnixPageSetupDialogPrivate : public QPageSetupDialogPrivate |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
158 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
159 Q_DECLARE_PUBLIC(QPageSetupDialog) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
160 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
161 public: |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
162 QUnixPageSetupDialogPrivate(QPrinter *printer); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
163 ~QUnixPageSetupDialogPrivate(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
164 void init(); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
165 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
166 QPageSetupWidget *widget; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
167 }; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
168 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
169 QUnixPageSetupDialogPrivate::QUnixPageSetupDialogPrivate(QPrinter *printer) : QPageSetupDialogPrivate(printer) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
170 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
171 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
172 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
173 QUnixPageSetupDialogPrivate::~QUnixPageSetupDialogPrivate() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
174 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
175 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
176 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
177 void QUnixPageSetupDialogPrivate::init() |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
178 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
179 Q_Q(QPageSetupDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
180 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
181 widget = new QPageSetupWidget(q); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
182 widget->setPrinter(printer, nullptr, printer->outputFormat(), printer->printerName()); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
183 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
184 QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
185 | QDialogButtonBox::Cancel, |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
186 Qt::Horizontal, q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
187 QObject::connect(buttons, SIGNAL(accepted()), q, SLOT(accept())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
188 QObject::connect(buttons, SIGNAL(rejected()), q, SLOT(reject())); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
189 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
190 QVBoxLayout *lay = new QVBoxLayout(q); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
191 lay->addWidget(widget); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
192 lay->addWidget(buttons); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
193 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
194 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
195 // QPageSetupWidget |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
196 // - Private widget implementation for Linux / CUPS |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
197 // - Embeds QPagePreview |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
198 // - TODO Could be made public as a stand-alone widget? |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
199 |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
200 QPageSetupWidget::QPageSetupWidget(QWidget *parent) |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
201 : QWidget(parent), |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
202 m_pagePreview(nullptr), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
203 m_printer(nullptr), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
204 m_printDevice(nullptr), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
205 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
206 m_pageSizePpdOption(nullptr), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
207 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
208 m_outputFormat(QPrinter::PdfFormat), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
209 m_units(QPageLayout::Point), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
210 m_savedUnits(QPageLayout::Point), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
211 m_savedPagesPerSheet(-1), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
212 m_savedPagesPerSheetLayout(-1), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
213 m_blockSignals(false), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
214 m_realCustomPageSizeIndex(-1) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
215 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
216 m_ui.setupUi(this); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
217 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
218 QVBoxLayout *lay = new QVBoxLayout(m_ui.preview); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
219 m_pagePreview = new QPagePreview(m_ui.preview); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
220 m_pagePreview->setPagePreviewLayout(1, 1); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
221 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
222 lay->addWidget(m_pagePreview); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
223 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
224 setAttribute(Qt::WA_WState_Polished, false); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
225 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
226 #ifdef PSD_ENABLE_PAPERSOURCE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
227 for (int i=0; paperSourceNames[i]; ++i) |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
228 m_ui.paperSource->insertItem(paperSourceNames[i]); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
229 #else |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
230 m_ui.paperSourceLabel->setVisible(false); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
231 m_ui.paperSource->setVisible(false); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
232 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
233 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
234 m_ui.reverseLandscape->setVisible(false); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
235 m_ui.reversePortrait->setVisible(false); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
236 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
237 initUnits(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
238 initPagesPerSheet(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
239 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
240 connect(m_ui.unitCombo, &QComboBox::activated, this, &QPageSetupWidget::unitChanged); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
241 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
242 connect(m_ui.pageSizeCombo, &QComboBox::currentIndexChanged, this, &QPageSetupWidget::pageSizeChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
243 connect(m_ui.pageWidth, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::pageSizeChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
244 connect(m_ui.pageHeight, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::pageSizeChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
245 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
246 connect(m_ui.leftMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::leftMarginChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
247 connect(m_ui.topMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::topMarginChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
248 connect(m_ui.rightMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::rightMarginChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
249 connect(m_ui.bottomMargin, &QDoubleSpinBox::valueChanged, this, &QPageSetupWidget::bottomMarginChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
250 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
251 connect(m_ui.portrait, &QRadioButton::clicked, this, &QPageSetupWidget::pageOrientationChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
252 connect(m_ui.landscape, &QRadioButton::clicked, this, &QPageSetupWidget::pageOrientationChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
253 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
254 connect(m_ui.pagesPerSheetCombo, &QComboBox::currentIndexChanged, this, &QPageSetupWidget::pagesPerSheetChanged); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
255 } |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
256 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
257 // Init the Units combo box |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
258 void QPageSetupWidget::initUnits() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
259 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
260 m_ui.unitCombo->addItem(tr("Millimeters (mm)"), QVariant::fromValue(QPageLayout::Millimeter)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
261 m_ui.unitCombo->addItem(tr("Inches (in)"), QVariant::fromValue(QPageLayout::Inch)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
262 m_ui.unitCombo->addItem(tr("Points (pt)"), QVariant::fromValue(QPageLayout::Point)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
263 m_ui.unitCombo->addItem(tr("Pica (P̸)"), QVariant::fromValue(QPageLayout::Pica)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
264 m_ui.unitCombo->addItem(tr("Didot (DD)"), QVariant::fromValue(QPageLayout::Didot)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
265 m_ui.unitCombo->addItem(tr("Cicero (CC)"), QVariant::fromValue(QPageLayout::Cicero)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
266 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
267 // Initially default to locale measurement system, mm if metric, in otherwise |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
268 m_ui.unitCombo->setCurrentIndex(QLocale().measurementSystem() != QLocale::MetricSystem); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
269 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
270 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
271 // Init the Pages Per Sheet (n-up) combo boxes if using CUPS |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
272 void QPageSetupWidget::initPagesPerSheet() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
273 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
274 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
275 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Top to Bottom"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
276 QVariant::fromValue(QCUPSSupport::LeftToRightTopToBottom)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
277 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Bottom to Top"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
278 QVariant::fromValue(QCUPSSupport::LeftToRightBottomToTop)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
279 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Right to Left, Bottom to Top"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
280 QVariant::fromValue(QCUPSSupport::RightToLeftBottomToTop)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
281 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Right to Left, Top to Bottom"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
282 QVariant::fromValue(QCUPSSupport::RightToLeftTopToBottom)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
283 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Bottom to Top, Left to Right"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
284 QVariant::fromValue(QCUPSSupport::BottomToTopLeftToRight)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
285 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Bottom to Top, Right to Left"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
286 QVariant::fromValue(QCUPSSupport::BottomToTopRightToLeft)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
287 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Top to Bottom, Left to Right"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
288 QVariant::fromValue(QCUPSSupport::TopToBottomLeftToRight)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
289 m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Top to Bottom, Right to Left"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
290 QVariant::fromValue(QCUPSSupport::TopToBottomRightToLeft)); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
291 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
292 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("1 (1x1)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
293 QVariant::fromValue(QCUPSSupport::OnePagePerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
294 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("2 (2x1)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
295 QVariant::fromValue(QCUPSSupport::TwoPagesPerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
296 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("4 (2x2)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
297 QVariant::fromValue(QCUPSSupport::FourPagesPerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
298 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("6 (2x3)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
299 QVariant::fromValue(QCUPSSupport::SixPagesPerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
300 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("9 (3x3)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
301 QVariant::fromValue(QCUPSSupport::NinePagesPerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
302 m_ui.pagesPerSheetCombo->addItem(QPrintDialog::tr("16 (4x4)"), |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
303 QVariant::fromValue(QCUPSSupport::SixteenPagesPerSheet)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
304 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
305 // Set to QCUPSSupport::OnePagePerSheet |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
306 m_ui.pagesPerSheetCombo->setCurrentIndex(0); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
307 // Set to QCUPSSupport::LeftToRightTopToBottom |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
308 m_ui.pagesPerSheetLayoutCombo->setCurrentIndex(0); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
309 #else |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
310 // Disable if CUPS wasn't found |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
311 m_ui.pagesPerSheetButtonGroup->hide(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
312 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
313 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
314 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
315 void QPageSetupWidget::initPageSizes() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
316 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
317 m_blockSignals = true; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
318 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
319 m_ui.pageSizeCombo->clear(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
320 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
321 m_realCustomPageSizeIndex = -1; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
322 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
323 if (m_outputFormat == QPrinter::NativeFormat && !m_printerName.isEmpty()) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
324 QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
325 if (ps) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
326 QPrintDevice printDevice = ps->createPrintDevice(m_printerName); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
327 const QPageSize defaultSize = printDevice.defaultPageSize(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
328 const auto pageSizes = printDevice.supportedPageSizes(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
329 for (const QPageSize &pageSize : pageSizes) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
330 m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
331 if (m_ui.pageSizeCombo->count() > 0) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
332 if (printDevice.supportsCustomPageSizes()) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
333 m_ui.pageSizeCombo->addItem(tr("Custom")); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
334 m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
335 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
336 m_blockSignals = false; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
337 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
338 // If the defaultSize is index 0, setCurrentIndex won't emit the currentIndexChanged |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
339 // signal; workaround the issue by initially setting the currentIndex to -1 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
340 m_ui.pageSizeCombo->setCurrentIndex(-1); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
341 m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(defaultSize))); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
342 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
343 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
344 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
345 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
346 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
347 // If PdfFormat or no available printer page sizes, populate with all page sizes |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
348 for (int id = 0; id < QPageSize::LastPageSize; ++id) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
349 if (QPageSize::PageSizeId(id) == QPageSize::Custom) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
350 m_ui.pageSizeCombo->addItem(tr("Custom")); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
351 m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
352 } else { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
353 QPageSize pageSize = QPageSize(QPageSize::PageSizeId(id)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
354 m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
355 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
356 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
357 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
358 m_blockSignals = false; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
359 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
360 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
361 // Set the dialog to use the given QPrinter |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
362 // Usually only called on first creation |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
363 void QPageSetupWidget::setPrinter(QPrinter *printer, QPrintDevice *printDevice, |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
364 QPrinter::OutputFormat outputFormat, const QString &printerName) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
365 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
366 m_printer = printer; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
367 m_printDevice = printDevice; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
368 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
369 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
370 // find the PageSize cups option |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
371 m_pageSizePpdOption = m_printDevice ? QCUPSSupport::findPpdOption("PageSize", m_printDevice) : nullptr; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
372 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
373 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
374 // Initialize the layout to the current QPrinter layout |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
375 m_pageLayout = m_printer->pageLayout(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
376 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
377 // Assume if margins are Points then is by default, so set to locale default units |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
378 if (m_pageLayout.units() == QPageLayout::Point) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
379 if (QLocale().measurementSystem() == QLocale::MetricSystem) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
380 m_pageLayout.setUnits(QPageLayout::Millimeter); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
381 else |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
382 m_pageLayout.setUnits(QPageLayout::Inch); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
383 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
384 m_units = m_pageLayout.units(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
385 m_pagePreview->setPageLayout(m_pageLayout); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
386 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
387 m_outputFormat = outputFormat; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
388 m_printerName = printerName; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
389 initPageSizes(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
390 updateWidget(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
391 updateSavedValues(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
392 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
393 if (m_ui.pageSizeCombo->currentIndex() == -1) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
394 // This can happen in raw printers that since they don't have a default |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
395 // page size none will get selected so just default to the first size (A4) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
396 m_ui.pageSizeCombo->setCurrentIndex(0); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
397 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
398 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
399 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
400 // Update the widget with the current settings |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
401 // TODO Break up into more intelligent chunks? |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
402 void QPageSetupWidget::updateWidget() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
403 { |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
404 m_blockSignals = true; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
405 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
406 QString suffix; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
407 switch (m_units) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
408 case QPageLayout::Millimeter: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
409 //: Unit 'Millimeter' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
410 suffix = tr("mm"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
411 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
412 case QPageLayout::Point: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
413 //: Unit 'Points' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
414 suffix = tr("pt"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
415 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
416 case QPageLayout::Inch: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
417 //: Unit 'Inch' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
418 suffix = tr("in"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
419 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
420 case QPageLayout::Pica: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
421 //: Unit 'Pica' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
422 suffix = tr("P̸"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
423 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
424 case QPageLayout::Didot: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
425 //: Unit 'Didot' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
426 suffix = tr("DD"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
427 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
428 case QPageLayout::Cicero: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
429 //: Unit 'Cicero' |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
430 suffix = tr("CC"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
431 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
432 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
433 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
434 m_ui.unitCombo->setCurrentIndex(m_ui.unitCombo->findData(QVariant::fromValue(m_units))); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
435 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
436 const bool isCustom = m_ui.pageSizeCombo->currentIndex() == m_realCustomPageSizeIndex && m_realCustomPageSizeIndex != -1; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
437 if (!isCustom) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
438 m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(m_pageLayout.pageSize()))); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
439 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
440 QMarginsF min; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
441 QMarginsF max; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
442 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
443 if (m_pageLayout.mode() == QPageLayout::FullPageMode) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
444 min = QMarginsF(0.0, 0.0, 0.0, 0.0); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
445 max = QMarginsF(9999.9999, 9999.9999, 9999.9999, 9999.9999); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
446 } else { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
447 min = m_pageLayout.minimumMargins(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
448 max = m_pageLayout.maximumMargins(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
449 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
450 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
451 m_ui.leftMargin->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
452 m_ui.leftMargin->setMinimum(min.left()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
453 m_ui.leftMargin->setMaximum(max.left()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
454 m_ui.leftMargin->setValue(m_pageLayout.margins().left()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
455 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
456 m_ui.rightMargin->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
457 m_ui.rightMargin->setMinimum(min.right()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
458 m_ui.rightMargin->setMaximum(max.right()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
459 m_ui.rightMargin->setValue(m_pageLayout.margins().right()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
460 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
461 m_ui.topMargin->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
462 m_ui.topMargin->setMinimum(min.top()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
463 m_ui.topMargin->setMaximum(max.top()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
464 m_ui.topMargin->setValue(m_pageLayout.margins().top()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
465 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
466 m_ui.bottomMargin->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
467 m_ui.bottomMargin->setMinimum(min.bottom()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
468 m_ui.bottomMargin->setMaximum(max.bottom()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
469 m_ui.bottomMargin->setValue(m_pageLayout.margins().bottom()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
470 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
471 m_ui.pageWidth->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
472 m_ui.pageWidth->setValue(m_pageLayout.fullRect(m_units).width()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
473 m_ui.pageWidth->setEnabled(isCustom); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
474 m_ui.widthLabel->setEnabled(isCustom); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
475 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
476 m_ui.pageHeight->setSuffix(suffix); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
477 m_ui.pageHeight->setValue(m_pageLayout.fullRect(m_units).height()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
478 m_ui.pageHeight->setEnabled(isCustom); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
479 m_ui.heightLabel->setEnabled(isCustom); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
480 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
481 m_ui.portrait->setChecked(m_pageLayout.orientation() == QPageLayout::Portrait); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
482 m_ui.landscape->setChecked(m_pageLayout.orientation() == QPageLayout::Landscape); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
483 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
484 m_ui.pagesPerSheetButtonGroup->setEnabled(m_outputFormat == QPrinter::NativeFormat); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
485 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
486 #ifdef PSD_ENABLE_PAPERSOURCE |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
487 m_ui.paperSource->setCurrentItem(printer->paperSource()); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
488 #endif |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
489 |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
490 m_blockSignals = false; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
491 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
492 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
493 // Set the dialog chosen options on the QPrinter |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
494 // Normally only called when the QPrintDialog or QPageSetupDialog OK button is pressed |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
495 void QPageSetupWidget::setupPrinter() const |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
496 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
497 m_printer->setPageLayout(m_pageLayout); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
498 m_printer->setPageOrientation(m_pageLayout.orientation()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
499 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
500 QCUPSSupport::PagesPerSheet pagesPerSheet = qvariant_cast<QCUPSSupport::PagesPerSheet>(m_ui.pagesPerSheetCombo->currentData() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
501 ); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
502 QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = qvariant_cast<QCUPSSupport::PagesPerSheetLayout>(m_ui.pagesPerSheetLayoutCombo->currentData() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
503 ); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
504 QCUPSSupport::setPagesPerSheetLayout(m_printer, pagesPerSheet, pagesPerSheetLayout); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
505 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
506 #ifdef PSD_ENABLE_PAPERSOURCE |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
507 m_printer->setPaperSource((QPrinter::PaperSource)m_ui.paperSource->currentIndex()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
508 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
509 } |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
510 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
511 void QPageSetupWidget::updateSavedValues() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
512 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
513 m_savedUnits = m_units; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
514 m_savedPageLayout = m_pageLayout; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
515 m_savedPagesPerSheet = m_ui.pagesPerSheetCombo->currentIndex(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
516 m_savedPagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentIndex(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
517 } |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
518 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
519 void QPageSetupWidget::revertToSavedValues() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
520 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
521 m_units = m_savedUnits; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
522 m_pageLayout = m_savedPageLayout; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
523 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
524 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
525 updateWidget(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
526 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
527 m_ui.pagesPerSheetCombo->setCurrentIndex(m_savedPagesPerSheet); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
528 m_ui.pagesPerSheetLayoutCombo->setCurrentIndex(m_savedPagesPerSheetLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
529 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
530 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
531 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
532 bool QPageSetupWidget::hasPpdConflict() const |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
533 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
534 if (m_pageSizePpdOption) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
535 if (m_pageSizePpdOption->conflicted) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
536 const QIcon warning = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning, nullptr, nullptr); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
537 const int pixmap_size = m_ui.pageSizeCombo->sizeHint().height() * .75; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
538 m_ui.pageSizeWarningLabel->setPixmap(warning.pixmap(pixmap_size, pixmap_size)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
539 } else { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
540 m_ui.pageSizeWarningLabel->setPixmap(QPixmap()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
541 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
542 return m_pageSizePpdOption->conflicted; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
543 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
544 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
545 return false; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
546 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
547 #endif |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
548 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
549 // Updates size/preview after the combobox has been changed. |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
550 void QPageSetupWidget::pageSizeChanged() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
551 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
552 QPageSize pageSize; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
553 if (m_ui.pageSizeCombo->currentIndex() != m_realCustomPageSizeIndex) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
554 pageSize = qvariant_cast<QPageSize>(m_ui.pageSizeCombo->currentData()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
555 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
556 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
557 if (m_pageSizePpdOption) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
558 ppd_file_t *ppd = qvariant_cast<ppd_file_t*>(m_printDevice->property(PDPK_PpdFile)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
559 QStringDecoder toUtf16(ppd->lang_encoding, QStringDecoder::Flag::Stateless); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
560 if (!toUtf16.isValid()) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
561 qWarning() << "QPrinSupport: Cups uses unsupported encoding" << ppd->lang_encoding; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
562 toUtf16 = QStringDecoder(QStringDecoder::Utf8); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
563 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
564 for (int i = 0; i < m_pageSizePpdOption->num_choices; ++i) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
565 const ppd_choice_t *choice = &m_pageSizePpdOption->choices[i]; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
566 if (toUtf16(choice->text) == m_ui.pageSizeCombo->currentText()) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
567 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
568 << QString::fromLatin1(choice->choice); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
569 m_printDevice->setProperty(PDPK_PpdOption, values); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
570 emit ppdOptionChanged(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
571 break; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
572 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
573 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
574 } |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
575 #endif |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
576 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
577 } else { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
578 QSizeF customSize; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
579 if (m_pageLayout.orientation() == QPageLayout::Landscape) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
580 customSize = QSizeF(m_ui.pageHeight->value(), m_ui.pageWidth->value()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
581 else |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
582 customSize = QSizeF(m_ui.pageWidth->value(), m_ui.pageHeight->value()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
583 pageSize = QPageSize(customSize, QPageSize::Unit(m_units)); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
584 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
585 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
586 if (m_pageSizePpdOption) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
587 const auto values = QStringList{} << QString::fromLatin1(m_pageSizePpdOption->keyword) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
588 << QStringLiteral("Custom"); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
589 m_printDevice->setProperty(PDPK_PpdOption, values); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
590 emit ppdOptionChanged(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
591 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
592 #endif |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
593 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
594 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
595 // We always need to update the m_pageSizePpdOption when the page size changes |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
596 // even if it's from inside updateWidget, so do not move up |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
597 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
598 return; |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
599 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
600 const QMarginsF printable = m_printDevice ? m_printDevice->printableMargins(pageSize, m_pageLayout.orientation(), m_printer->resolution()) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
601 : QMarginsF(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
602 m_pageLayout.setPageSize(pageSize, qt_convertMargins(printable, QPageLayout::Point, m_pageLayout.units())); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
603 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
604 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
605 updateWidget(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
606 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
607 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
608 void QPageSetupWidget::pageOrientationChanged() |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
609 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
610 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
611 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
612 m_pageLayout.setOrientation(m_ui.portrait->isChecked() ? QPageLayout::Portrait : QPageLayout::Landscape); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
613 m_pagePreview->setPageLayout(m_pageLayout); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
614 updateWidget(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
615 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
616 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
617 void QPageSetupWidget::pagesPerSheetChanged() |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
618 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
619 #if QT_CONFIG(cups) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
620 switch (m_ui.pagesPerSheetCombo->currentData().toInt()) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
621 case QCUPSSupport::OnePagePerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
622 m_pagePreview->setPagePreviewLayout(1, 1); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
623 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
624 case QCUPSSupport::TwoPagesPerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
625 m_pagePreview->setPagePreviewLayout(1, 2); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
626 break; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
627 case QCUPSSupport::FourPagesPerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
628 m_pagePreview->setPagePreviewLayout(2, 2); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
629 break; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
630 case QCUPSSupport::SixPagesPerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
631 m_pagePreview->setPagePreviewLayout(3, 2); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
632 break; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
633 case QCUPSSupport::NinePagesPerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
634 m_pagePreview->setPagePreviewLayout(3, 3); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
635 break; |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
636 case QCUPSSupport::SixteenPagesPerSheet: |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
637 m_pagePreview->setPagePreviewLayout(4, 4); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
638 break; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
639 } |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
640 #endif |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
641 } |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
642 |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
643 void QPageSetupWidget::unitChanged() |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
644 { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
645 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
646 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
647 m_units = qvariant_cast<QPageLayout::Unit>(m_ui.unitCombo->currentData()); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
648 m_pageLayout.setUnits(m_units); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
649 updateWidget(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
650 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
651 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
652 void QPageSetupWidget::topMarginChanged(double newValue) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
653 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
654 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
655 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
656 m_pageLayout.setTopMargin(newValue); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
657 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
658 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
659 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
660 void QPageSetupWidget::bottomMarginChanged(double newValue) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
661 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
662 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
663 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
664 m_pageLayout.setBottomMargin(newValue); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
665 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
666 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
667 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
668 void QPageSetupWidget::leftMarginChanged(double newValue) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
669 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
670 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
671 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
672 m_pageLayout.setLeftMargin(newValue); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
673 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
674 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
675 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
676 void QPageSetupWidget::rightMarginChanged(double newValue) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
677 { |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
678 if (m_blockSignals) |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
679 return; |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
680 m_pageLayout.setRightMargin(newValue); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
681 m_pagePreview->setPageLayout(m_pageLayout); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
682 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
683 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
684 // QPageSetupDialog |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
685 // - Public Linux / CUPS class implementation |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
686 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
687 QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent) |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
688 : QDialog(*(new QUnixPageSetupDialogPrivate(printer)), parent) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
689 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
690 Q_D(QPageSetupDialog); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
691 setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup")); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
692 static_cast<QUnixPageSetupDialogPrivate *>(d)->init(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
693 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
694 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
695 QPageSetupDialog::QPageSetupDialog(QWidget *parent) |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
696 : QDialog(*(new QUnixPageSetupDialogPrivate(nullptr)), parent) |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
697 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
698 Q_D(QPageSetupDialog); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
699 setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup")); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
700 static_cast<QUnixPageSetupDialogPrivate *>(d)->init(); |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
701 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
702 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
703 int QPageSetupDialog::exec() |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
704 { |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
705 Q_D(QPageSetupDialog); |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
706 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
707 int ret = QDialog::exec(); |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
708 if (ret == Accepted) { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
709 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->setupPrinter(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
710 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->updateSavedValues(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
711 } else { |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
712 static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->revertToSavedValues(); |
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
713 } |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
714 return ret; |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
715 } |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
716 |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
717 QT_END_NAMESPACE |
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
718 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
719 #include "moc_qpagesetupdialog_unix_p.cpp" |
31537
5ceb4bfcdb0f
add tools and files for updating the gui's language files for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
diff
changeset
|
720 |
32535
dd5ece3664ed
update Qt and Qsci sources for scanning text for translation
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31537
diff
changeset
|
721 #include "moc_qpagesetupdialog.cpp" |