-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
98 lines (68 loc) · 2.63 KB
/
mainwindow.h
File metadata and controls
98 lines (68 loc) · 2.63 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QMessageBox>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QFileDialog>
#include <QUrl>
#include <QFileInfo>
#include <QFile>
#include <QMimeData>
#include <QElapsedTimer>
#include <QDragEnterEvent>
#include <QDebug>
#include <QSqlQueryModel>
#include <QSqlQuery>
#include <QSortFilterProxyModel>
#include <QQueue>
#include <QDateTime>
#include "historyitem.h"
#include "dbmanager.h"
#include "compressioncontroller.h"
#include "algorithmenum.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_action_Load_triggered();
void on_action_History_toggled(bool arg1);
void on_historyTableView_clicked(const QModelIndex &index);
void on_currentFilesTableWidget_clicked(const QModelIndex &index);
void on_historyDockWidget_visibilityChanged(bool visible);
void on_action_Stats_toggled(bool arg1);
void on_statsDockWidget_visibilityChanged(bool visible);
void on_actionClear_History_triggered();
void on_actionCompressIt_triggered();
void refreshHistoryTableView();
void on_actionDecompress_triggered();
signals:
void databaseChanged(); //signal to indicate the database is changed. Attached slot refreshes the historyTableView to accomodate newly changed values
protected:
void dropEvent(QDropEvent* event);
void dragEnterEvent(QDragEnterEvent* event);
private:
Ui::MainWindow *ui;
QFileDialog fileDialog;
QSqlQueryModel* historyTableViewModel = nullptr;
QSortFilterProxyModel* historyTableViewProxyModel = nullptr;
CompressionController compressionController;
QQueue<QString> filePaths;
void populateStatsDockWidget(const int& id) const; //populate with the stats associated with the record with the given id
void setupCurrentFilesTableWidget(); //sets the horizontal headers, number of columns and rows
void setupHistoryTableView(); //sets the model and resizing capabilities of the history table view
void displayFileData(const QString& fileName, const double& fileSize); //populates currentFilesTableWidget with the data associated with the file
QString getFileName(const QString& filePath); //returns the name of the file given its URL
double getFileSize(const QString& filePath); //returns the size of the specified file
QString getFilePath(const QUrl& url); //returns the properly formated file path
void extractFileInsights(const QList<QUrl>& urls);
};
#endif // MAINWINDOW_H