-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
107 lines (94 loc) · 3.24 KB
/
mainwindow.h
File metadata and controls
107 lines (94 loc) · 3.24 KB
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
#pragma once
#include <QtWidgets>
#include <QtNetwork>
#include "exiftool.h"
#include "filedroplabel.h"
#include "mappanel.h"
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow();
~MainWindow();
private:
// Widgets
QLineEdit *leFile=nullptr, *leDir=nullptr, *leFilter=nullptr;
QCheckBox *cbRecurse=nullptr, *cbAuthorized=nullptr, *cbOpenOnGps=nullptr, *cbKeepBackup=nullptr, *cbEnableUrlPipe=nullptr;
QPushButton *btnPickFile=nullptr, *btnPickDir=nullptr, *btnScan=nullptr, *btnRedact=nullptr, *btnExportCsv=nullptr, *btnExportHtml=nullptr;
QPushButton *btnReveal=nullptr, *btnOpenOsm=nullptr, *btnClear=nullptr, *btnAnalyzeUrls=nullptr, *btnCancel=nullptr;
QTableWidget *table=nullptr;
QLabel *preview=nullptr;
QTextEdit *log=nullptr;
QProgressBar *progress=nullptr;
QPlainTextEdit *urlBox=nullptr;
FileDropLabel *drop=nullptr;
MapPanel *map=nullptr;
QStatusBar *sb=nullptr;
// State
struct RowData { GpsResult r; bool revealed=false; };
QVector<RowData> rows;
bool busy=false;
// Setup
void createUi();
void applyTheme();
void loadSettings();
void saveSettings();
void checkExif();
// Ops
void pickFile();
void pickFolder();
QStringList collectFiles(const QString &path, bool recursive);
void scan();
void redact();
void analyzeUrls();
void revealMap();
void openInOsm();
// Table
void addRow(const GpsResult& r);
void onSelectionChange();
int currentRow() const;
void showPreview(const QString &path);
void tableMenu(const QPoint &pos);
void applyFilter();
// Exports
void exportCsv();
void exportHtml();
// Audit
void writeAudit(const QString &action, const QString &filePath, const QString &status, const QString &details);
// Drop
void handleDroppedFiles(const QStringList &paths);
void appendUrls(const QStringList &u);
// Log helpers
void logHtml(const QString &h);
void logInfo(const QString&m);
void logWarn(const QString&m);
void logError(const QString&m);
void logOk(const QString&m);
void logAlert(const QString&m);
void logGps(const QString&m);
private slots:
void onActionOpen(){ pickFile(); }
void onActionFolder(){ pickFolder(); }
void onActionScan(){ scan(); }
void onActionRedact(){ redact(); }
void onActionExportCsv(){ exportCsv(); }
void onActionExportReport(){ exportHtml(); }
void onBtnPickFile(){ pickFile(); }
void onBtnPickDir(){ pickFolder(); }
void onBtnScan(){ scan(); }
void onBtnRedact(){ redact(); }
void onBtnExportCsv(){ exportCsv(); }
void onBtnExportHtml(){ exportHtml(); }
void onBtnClear(){
table->setRowCount(0); rows.clear(); preview->setText("Preview"); map->lock();
}
void onBtnAnalyzeUrls(){ analyzeUrls(); }
void onBtnCancel(){ busy=false; }
void onFilterReturn(){ applyFilter(); }
void onBtnReveal(){ revealMap(); }
void onBtnOpenOsm(){ openInOsm(); }
void onTableSelection(){ onSelectionChange(); }
void onTableMenu(const QPoint& pos){ tableMenu(pos); }
// Drop signals
void onFilesDropped(const QStringList& p){ handleDroppedFiles(p); }
void onUrlsDropped(const QStringList& u){ appendUrls(u); }
};