-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultParamsDialog.h
163 lines (95 loc) · 3.67 KB
/
DefaultParamsDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#ifndef SCANTAILOR_DEFAULTPARAMSDIALOG_H
#define SCANTAILOR_DEFAULTPARAMSDIALOG_H
#include <QButtonGroup>
#include <QWidget>
#include <list>
#include <set>
#include <unordered_map>
#include "DefaultParams.h"
#include "DefaultParamsProfileManager.h"
#include "OrthogonalRotation.h"
#include "ui_DefaultParamsDialog.h"
class DefaultParamsDialog : public QDialog, private Ui::DefaultParamsDialog {
Q_OBJECT
public:
explicit DefaultParamsDialog(QWidget* parent = nullptr);
~DefaultParamsDialog() override = default;
private slots:
void rotateLeft();
void rotateRight();
void resetRotation();
void layoutModeChanged(int idx);
void deskewModeChanged(bool auto_mode);
void pageDetectAutoToggled();
void pageDetectManualToggled();
void pageDetectDisableToggled();
void autoMarginsToggled(bool checked);
void alignmentModeChanged(int idx);
void alignWithOthersToggled(bool state);
void autoHorizontalAligningToggled(bool);
void autoVerticalAligningToggled(bool);
void topBottomLinkClicked();
void leftRightLinkClicked();
void horMarginsChanged(double val);
void vertMarginsChanged(double val);
void colorModeChanged(int idx);
void thresholdMethodChanged(int idx);
void pictureShapeChanged(int idx);
void equalizeIlluminationToggled(bool checked);
void splittingToggled(bool checked);
void bwForegroundToggled(bool checked);
void colorForegroundToggled(bool checked);
void thresholdSliderValueChanged(int value);
void colorSegmentationToggled(bool checked);
void posterizeToggled(bool checked);
void setLighterThreshold();
void setDarkerThreshold();
void setNeutralThreshold();
void dpiSelectionChanged(int index);
void dpiEditTextChanged(const QString& text);
void depthPerceptionChangedSlot(int val);
void despeckleToggled(bool checked);
void despeckleSliderValueChanged(int value);
void profileChanged(int index);
void profileSavePressed();
void profileDeletePressed();
void commitChanges();
private:
void updateFixOrientationDisplay(const DefaultParams::FixOrientationParams& params);
void updatePageSplitDisplay(const DefaultParams::PageSplitParams& params);
void updateDeskewDisplay(const DefaultParams::DeskewParams& params);
void updateSelectContentDisplay(const DefaultParams::SelectContentParams& params);
void updatePageLayoutDisplay(const DefaultParams::PageLayoutParams& params);
void updateOutputDisplay(const DefaultParams::OutputParams& params);
void updateUnits(Units units);
void setupUiConnections();
void removeUiConnections();
void setRotation(const OrthogonalRotation& rotation);
void setRotationPixmap();
void updateAlignmentButtonsEnabled();
void updateAutoModeButtons();
void updateAlignmentModeEnabled();
QToolButton* getCheckedAlignmentButton() const;
void setLinkButtonLinked(QToolButton* button, bool linked);
void loadParams(const DefaultParams& params);
std::unique_ptr<DefaultParams> buildParams() const;
bool isProfileNameReserved(const QString& name);
void setTabWidgetsEnabled(bool enabled);
QIcon m_chainIcon;
QIcon m_brokenChainIcon;
bool m_leftRightLinkEnabled;
bool m_topBottomLinkEnabled;
int m_ignoreMarginChanges;
OrthogonalRotation m_orthogonalRotation;
std::unordered_map<QToolButton*, page_layout::Alignment> m_alignmentByButton;
std::unique_ptr<QButtonGroup> m_alignmentButtonGroup;
DefaultParamsProfileManager m_profileManager;
int m_customDpiItemIdx;
QString m_customDpiValue;
int m_customProfileItemIdx;
Units m_currentUnits;
std::set<QString> m_reservedProfileNames;
int m_ignoreProfileChanges;
std::list<QMetaObject::Connection> m_connectionList;
};
#endif // SCANTAILOR_DEFAULTPARAMSDIALOG_H