yhkylin-backup-tools/kybackup/backuppointlistdialog.h

66 lines
1.6 KiB
C
Raw Normal View History

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 16:57:11 +08:00
#include <QLabel>
2021-12-06 14:55:00 +08:00
#include "../backup-daemon/parsebackuplist.h"
2022-03-02 11:24:54 +08:00
#include "module/udiskdetector.h"
#include "component/pixmaplabel.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,
2021-12-06 16:57:11 +08:00
Backup_Size,
2022-01-18 17:35:26 +08:00
Backup_Device, // 即备份位置Position
2021-12-06 14:55:00 +08:00
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-26 18:15:21 +08:00
void setIsOnlyShowLocal(bool onlyShowLocal) { m_onlyShowLocal = onlyShowLocal; }
2021-12-06 14:55:00 +08:00
bool isOnlyShowLocal() const { return m_onlyShowLocal; }
2022-02-21 17:16:27 +08:00
void paintEvent(QPaintEvent *event);
2021-12-06 14:55:00 +08:00
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);
2022-03-09 15:02:01 +08:00
void setItem(int row, int column, const QString& text, int alignFlag = Qt::AlignCenter);
2021-12-06 14:55:00 +08:00
QString text(int row, int column);
QTableWidget *m_tableWidget;
2021-12-01 15:12:38 +08:00
QHBoxLayout *m_bottomLayout = nullptr;
2022-03-02 11:24:54 +08:00
PixmapLabel *m_labelEmpty; // 空记录图片
2021-12-06 16:57:11 +08:00
QLabel *m_labelEmptyText; // 空记录文本
2021-12-01 15:12:38 +08:00
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