2021-12-01 15:12:38 +08:00
|
|
|
#ifndef BackupPointListDialog_H
|
|
|
|
#define BackupPointListDialog_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTableWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QVBoxLayout>
|
2021-12-06 14:55:00 +08:00
|
|
|
#include "../backup-daemon/parsebackuplist.h"
|
|
|
|
#include "./module/udiskdetector.h"
|
2021-12-01 15:12:38 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class BackupPointListDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class BackupPointListDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-12-06 14:55:00 +08:00
|
|
|
enum Column_Index {
|
|
|
|
Backup_Name = 0,
|
|
|
|
UUID,
|
|
|
|
Backup_Time,
|
|
|
|
Backup_Device,
|
|
|
|
Backup_State,
|
|
|
|
Prefix_Path
|
|
|
|
};
|
|
|
|
|
|
|
|
explicit BackupPointListDialog(QWidget *parent = nullptr, bool isOnlyShowLocal = false);
|
|
|
|
virtual ~BackupPointListDialog();
|
|
|
|
|
|
|
|
QList<ParseBackupList::BackupPoint> getBackupPointList();
|
2021-12-01 15:12:38 +08:00
|
|
|
|
2021-12-06 14:55:00 +08:00
|
|
|
bool isOnlyShowLocal() const { return m_onlyShowLocal; }
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void udiskChange();
|
|
|
|
void selected(ParseBackupList::BackupPoint);
|
2021-12-01 15:12:38 +08:00
|
|
|
|
|
|
|
protected:
|
2021-12-06 14:55:00 +08:00
|
|
|
void keyPressEvent(QKeyEvent* event);
|
|
|
|
|
|
|
|
void setItem(int row, int column, const QString& text, int alignFlag = Qt::AlignCenter);
|
|
|
|
QString text(int row, int column);
|
|
|
|
|
|
|
|
QTableWidget *m_tableWidget;
|
2021-12-01 15:12:38 +08:00
|
|
|
QHBoxLayout *m_bottomLayout = nullptr;
|
|
|
|
private:
|
|
|
|
Ui::BackupPointListDialog *ui;
|
|
|
|
|
2021-12-06 14:55:00 +08:00
|
|
|
// U盘探测
|
|
|
|
UdiskDetector* m_udector;
|
|
|
|
// U盘挂载路径列表
|
|
|
|
QStringList m_udiskPaths;
|
|
|
|
// 是否只展示本地备份
|
|
|
|
bool m_onlyShowLocal;
|
2021-12-01 15:12:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BackupPointListDialog_H
|