forked from oferkv/phototonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogs.h
276 lines (227 loc) · 5.37 KB
/
dialogs.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
* Copyright (C) 2013 Ofer Kashayov <[email protected]>
* This file is part of Phototonic Image Viewer.
*
* Phototonic is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Phototonic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Phototonic. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIALOGS_H
#define DIALOGS_H
#include <QtWidgets>
#include "thumbview.h"
#include "imageview.h"
int cpMvFile(bool isCopy, QString &srcFile, QString &srcPath, QString &dstPath, QString &dstDir);
class CpMvDialog : public QDialog
{
Q_OBJECT
public slots:
void abort();
public:
CpMvDialog(QWidget *parent);
void exec(ThumbView *thumbView, QString &destDir, bool pasteInCurrDir);
int nfiles;
int latestRow;
private:
QLabel *opLabel;
QPushButton *cancelButton;
QFileInfo *dirInfo;
bool abortOp;
};
class ShortcutsTableView : public QTableView
{
Q_OBJECT
public:
ShortcutsTableView();
void addRow(QString action, QString description, QString shortcut);
public slots:
void showShortcutsTableMenu(QPoint pt);
void clearShortcut();
protected:
void keyPressEvent(QKeyEvent *e);
private:
QStandardItemModel *keysModel;
QModelIndex selectedEntry;
QMenu *shortcutsMenu;
QAction *clearAction;
};
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
static int const nZoomRadios = 5;
SettingsDialog(QWidget *parent);
private slots:
void pickColor();
void pickThumbsColor();
void pickThumbsTextColor();
void pickStartupDir();
void pickBgImage();
public slots:
void abort();
void saveSettings();
private:
QRadioButton *fitLargeRadios[nZoomRadios];
QRadioButton *fitSmallRadios[nZoomRadios];
QCheckBox *compactLayoutCb;
QToolButton *backgroundColorButton;
QToolButton *colThumbButton;
QToolButton *colThumbTextButton;
QSpinBox *thumbSpacingSpin;
QSpinBox *thumbPagesSpin;
QSpinBox *saveQualitySpin;
QColor bgColor;
QColor thumbBgColor;
QColor thumbTextColor;
QCheckBox *exitCliCb;
QCheckBox *wrapListCb;
QCheckBox *enableAnimCb;
QCheckBox *enableExifCb;
QCheckBox *enableThumbExifCb;
QCheckBox *imageInfoCb;
QCheckBox *noSmallThumbCb;
QCheckBox *reverseMouseCb;
QCheckBox *deleteConfirmCb;
QSpinBox *slideDelaySpin;
QCheckBox *slideRandomCb;
QRadioButton *startupDirRadios[3];
QLineEdit *startupDirEdit;
QLineEdit *thumbsBackImageEdit;
void setButtonBgColor(QColor &color, QToolButton *button);
};
class CropDialog : public QDialog
{
Q_OBJECT
public:
CropDialog(QWidget *parent, ImageView *imageView);
public slots:
void ok();
void reset();
void applyCrop(int);
private:
QSpinBox *topSpin;
QSpinBox *bottomSpin;
QSpinBox *leftSpin;
QSpinBox *rightSpin;
ImageView *imageView;
};
class ResizeDialog : public QDialog
{
Q_OBJECT
public:
ResizeDialog(QWidget *parent, ImageView *imageView);
public slots:
void ok();
void abort();
void setAspectLock();
void setUnits();
void adjustSizes();
private:
int width;
int height;
int lastWidth;
int lastHeight;
bool aspectLocked;
bool pixelUnits;
int newWidth;
int newHeight;
QSpinBox *widthSpin;
QSpinBox *heightSpin;
QRadioButton *pixelsRadio;
QRadioButton *percentRadio;
QLabel *newSizePixelsLab;
ImageView *imageView;
};
class ColorsDialog : public QDialog
{
Q_OBJECT
public:
ColorsDialog(QWidget *parent, ImageView *imageView);
public slots:
void ok();
void reset();
void enableColorize(int state);
void redNegative(int state);
void greenNegative(int state);
void blueNegative(int state);
void setRedChannel();
void setGreenChannel();
void setBlueChannel();
void applyColors(int value);
private:
ImageView *imageView;
QSlider *hueSlide;
QCheckBox *colorizeCb;
QSlider *saturationSlide;
QSlider *lightnessSlide;
QCheckBox *redB;
QCheckBox *greenB;
QCheckBox *blueB;
QSlider *brightSlide;
QSlider *contrastSlide;
QSlider *redSlide;
QSlider *greenSlide;
QSlider *blueSlide;
QCheckBox *rNegateCb;
QCheckBox *gNegateCb;
QCheckBox *bNegateCb;
};
class AppMgmtDialog : public QDialog
{
Q_OBJECT
public:
AppMgmtDialog(QWidget *parent);
public slots:
void ok();
private slots:
void add();
void remove();
void entry();
private:
QTableView *appsTable;
QStandardItemModel *appsTableModel;
void addTableModelItem(QStandardItemModel *model, QString &key, QString &val);
};
class CopyMoveToDialog : public QDialog
{
Q_OBJECT
public:
CopyMoveToDialog(QWidget *parent, QString thumbsPath, bool move);
QString selectedPath;
bool copyOp;
private slots:
void copyOrMove();
void justClose();
void add();
void remove();
void selection(const QItemSelection&, const QItemSelection&);
void pathDoubleClick(const QModelIndex &idx);
private:
QTableView *pathsTable;
QStandardItemModel *pathsTableModel;
QString currentPath;
QLabel *destinationLab;
void savePaths();
};
class ProgressDialog : public QDialog
{
Q_OBJECT
public slots:
void abort();
public:
QLabel *opLabel;
bool abortOp;
ProgressDialog(QWidget *parent);
private:
QPushButton *cancelButton;
};
#endif // DIALOGS_H