-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreviewselectdialog.h
64 lines (49 loc) · 1.47 KB
/
previewselectdialog.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
#pragma once
#ifndef PREVIEWSELECTDIALOG_H
#define PREVIEWSELECTDIALOG_H
#include <QDialog>
#include <QPointer>
#include <QtSql/QSqlRecord>
class PreviewListDelegate;
class QStandardItemModel;
namespace Ui
{
class PreviewSelectDialog;
}
class PreviewSelectDialog final : public QDialog
{
Q_OBJECT
Q_DISABLE_COPY(PreviewSelectDialog)
public:
enum PreviewColumn
{
TR_NAME,
TR_SIZE,
TR_PROGRESS,
TR_FILE_INDEX,
NB_COLUMNS
};
/*! Contructor. */
PreviewSelectDialog(QWidget *parent, const QSqlRecord &torrent,
const QSharedPointer<const QVector<QSqlRecord>> &torrentFiles);
/*! Virtual destructor. */
inline ~PreviewSelectDialog() final = default;
/*! Assemble absolute file path for torrent file. */
inline QString getTorrentFileFilePathAbs(const QString &relativePath) const;
signals:
void readyToPreviewFile(const QString &filePath);
protected:
void showEvent(QShowEvent *event) final;
private:
void populatePreviewListModel() const;
const QSqlRecord m_torrent;
const QSharedPointer<const QVector<QSqlRecord>> m_torrentFiles;
bool m_showEventInitialized = false;
std::unique_ptr<Ui::PreviewSelectDialog> m_ui;
QPointer<QStandardItemModel> m_previewListModel;
QPointer<PreviewListDelegate> m_listDelegate;
// NOLINTNEXTLINE(readability-redundant-access-specifiers)
private slots:
void previewButtonClicked();
};
#endif // PREVIEWSELECTDIALOG_H