-
Notifications
You must be signed in to change notification settings - Fork 0
/
filebrowser.h
83 lines (71 loc) · 2.15 KB
/
filebrowser.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
#ifndef FILEBROWSER_H
#define FILEBROWSER_H
#include <QWidget>
#include <QListWidget>
#include <QListWidgetItem>
#include <QStackedLayout>
#include <QList>
#include <QMenu>
#include <QVariant>
#include <QMessageBox>
#include <QPushButton>
#include <QDesktopServices>
#include <QLineEdit>
#include <QFileDialog>
#include <QScrollBar>
#include <QProcess>
#include "userrole.h"
#include "selected.h"
#include "database.h"
#include "filetuple.h"
#include "taglist.h"
#include "tagadderdialog.h"
#include "settings.h"
#include "progressdialog.h"
#include "thumbnailmanager.h"
#include "qevent.h"
class FileBrowser : public QWidget
{
Q_OBJECT
public:
explicit FileBrowser(ThumbnailManager* manager, QWidget *parent = nullptr);
private:
ThumbnailManager* thumbnailManager;
int revisionCount;
QStackedLayout* layout;
QListWidget* viewingArea;
QList<int> searchList;
QList<int> excludeList;
void createLayout();
void createViewingArea();
void relaySignals();
void addFileToViewingArea(const FileTuple& file);
void addTagsToSelected(QStringList tags);
void removeFiles();
int getIdOfSelected();
void selectFileWithId(int id);
QString generateAndStoreThumbnail(const QString& path, const int& fileId);
void updateLastDirectory(QString pathToFile);
QString getParentFolder(const QString& filePath);
void loadThumbnails(QStringList thumbnailPaths, QList<QListWidgetItem*> items, int revision);
protected:
void keyPressEvent(QKeyEvent* event) override;
signals:
void selectionChanged(int selectedFile);
void databaseTagsChanged();
public slots:
void selectionChangedEmitter();
void reloadContents();
void showContextMenu(const QPoint& point);
void fileRemovePrompt();
void tagSelectedDialog();
void updateSearchList(QList<int> tagIds, QList<int> excludeTagIds);
void openFile(QListWidgetItem* item);
void updateThumbnailScale(int percentage);
void changeThumbnailOfSelectedFile();
void showSelectedInExplorer();
void reloadIfTagAddedImpactsSearch(int tagId);
void reloadIfTagRemovedImpactsSearch(int tagId);
void showNewestItem();
};
#endif // FILEBROWSER_H