-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
75 lines (63 loc) · 1.81 KB
/
mainwindow.h
File metadata and controls
75 lines (63 loc) · 1.81 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMap>
#include <QToolBar>
#include <QAction>
#include "notelistwidget.h"
#include "noteeditwidget.h"
#include "notedatabase.h"
#include "webdavsyncmanager.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void onNoteSelected(const Note ¬e);
void onCreateNewNote();
void onNoteSaved(const Note ¬e);
void onNoteDeleted(int noteId);
void onEditWindowClosed();
void onNoteEditWindowClosed(int noteId);
void closeEvent(QCloseEvent *event) override;
// 新增的导入导出功能
void exportDatabase();
void importDatabase();
// WebDAV同步功能
void showWebDAVConfigDialog();
void manualSync();
// WebDAV同步管理器信号处理槽
void onSyncStatusChanged(WebDAVSyncManager::SyncStatus status);
void onSyncProgress(int percent, const QString &message);
void onSyncFinished(bool success);
void onSyncError(const QString &error);
private:
Ui::MainWindow *ui;
NoteListWidget *m_noteListWidget;
NoteEditWidget *m_noteEditWidget;
NoteDatabase *m_database;
QMap<int, NoteEditWidget*> m_openNoteWindows;
QToolBar *m_toolBar;
QAction *m_exportAction;
QAction *m_importAction;
// WebDAV相关
WebDAVSyncManager *m_webdavSyncManager;
QAction *m_webdavConfigAction;
QAction *m_syncAction;
void setupUI();
void setupConnections();
void setupAppearance();
void setupToolBar();
void setupMessageBoxStyle();
void setupWebDAVSync();
void openOrActivateNoteWindow(const Note ¬e);
void closeAllNoteWindows();
};
#endif // MAINWINDOW_H