-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileManagerWindow.h
More file actions
99 lines (82 loc) · 2.19 KB
/
FileManagerWindow.h
File metadata and controls
99 lines (82 loc) · 2.19 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
#ifndef FILEMANAGERWINDOW_H
#define FILEMANAGERWINDOW_H
#include <QFileInfo>
#include <QFileSystemWatcher>
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QMutex>
#include <QPushButton>
#include <QSettings>
#include <QTimer>
#include <QToolButton>
#include <QVBoxLayout>
#include <QWidget>
#include "MyListWidget.h"
#include "VirtualKeyboardWidget.h"
enum class SortMode { Name, Time, Size, Type };
class FileManagerWindow : public QWidget {
Q_OBJECT
public:
explicit FileManagerWindow(QWidget *parent = nullptr);
private slots:
void goBack();
void onItemClicked(QListWidgetItem *item);
void startRename();
void finishRename();
void startDelete();
void confirmDelete();
void cancelDelete();
void showSettingsMenu();
void onSettingsLongPress();
void directoryChanged(const QString &path);
private:
void loadFileItems(const QString &path);
void updateBreadcrumbForItem(QWidget *breadcrumbBar);
QString formatDisplayPath(const QString &path);
void showDeleteConfirmationDialog(int itemIndex);
void hideDeleteConfirmationDialog();
void showSettingsDialog();
void loadSettings();
void saveSettings();
bool eventFilter(QObject *watched, QEvent *event) override;
void setupDirectoryWatcher();
// 左侧按钮栏
QPushButton *btnBack;
QPushButton *btnSettings;
QPushButton *btnEdit;
QPushButton *btnDelete;
// 文件列表与路径数据
MyListWidget *fileList;
QList<QFileInfo> fileInfoList;
QString currentPath;
SortMode sortMode;
// 隐藏设置
bool hideMatchingLrcFiles;
bool showHiddenFiles;
QTimer *settingsLongPressTimer;
// 排序设置
bool reverseSortOrder;
// 重命名功能
bool isRenameMode;
QLineEdit *renameEdit;
VirtualKeyboardWidget *keyboard;
int renameIndex;
// 删除功能
bool isDeleteMode;
int deleteIndex;
QWidget *deleteDialog;
QPushButton *deleteConfirmButton;
QPushButton *deleteCancelButton;
// 分批加载控制
bool loadingCancelled;
QMutex loadingMutex;
// 加载指示器
QLabel *loadingIndicator;
bool isLoading;
// 文件夹监测器
QFileSystemWatcher *dirWatcher;
QTimer *dirChangeTimer;
};
#endif // FILEMANAGERWINDOW_H