blob: 0e1f9f76aec663dcfc7304a3144abfa1c5754161 (
plain)
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
|
#ifndef FSWIDGET_H
#define FSWIDGET_H
#include <QWidget>
#include <QSqlQuery>
#include <QMediaPlayer>
class QComboBox;
class QTreeView;
class QStandardItemModel;
class QSortFilterProxyModel;
class QContextMenuEvent;
class QAction;
class QProcess;
class QDir;
class NewMovieWizard;
class NewPicsDialog;
class Viewer;
class FSProxy;
class SmView;
class VideoViewer;
class FSWidget : public QWidget {
Q_OBJECT
public:
enum CustomRoles { FullPathRole = Qt::UserRole + 1, DurationRole = Qt::UserRole + 2, SizeRole = Qt::UserRole + 3, MimeRole = Qt::UserRole + 4, DupDataRole = Qt::UserRole + 5 };
explicit FSWidget(QWidget *parent = nullptr);
QString wTitle;
~FSWidget();
public slots:
void readSettings();
void writeSettings();
void refresh();
private slots:
void insertItem(QComboBox *cb, const QString &text);
void removeItem(QComboBox *cb);
void gatherData(const QString &curDir);
void deleteFiles();
void archiveMovie();
void archivePics();
void advanceDir(int by);
int queryCount(QSqlQuery &q, const QString &arg);
void filterMime(const QString &mime);
void unpack();
void doubleClicked(const QModelIndex &idx);
void preview();
void comparePics();
void playSelected(int count, QString player);
void doPlay();
void selectFilter();
void calculateSelectionChanged();
void playerStateChanged(QMediaPlayer::State s);
signals:
void message(QString msg);
void selectionChanged(int count, qint64 size, qint64 duration);
void needRefreshFs();
void needConfig();
void needTitleChange(QString msg);
private:
void setupWidget();
const QStringList readDescript(const QDir &dir);
const QString guessSubject(const QStringList &subjects, const QString &fn);
QComboBox *mDirCB;
QComboBox *mFilterCB;
QProcess *mPlayer;
QStringList mPlayerArgs;
QStringList mPlaylist;
SmView *mFileView;
QStandardItemModel *mModel;
FSProxy *mProxy;
NewMovieWizard *mMovieWizard;
NewPicsDialog *mNewPicsDlg;
Viewer *mViewer;
VideoViewer *mVideoViewer;
int mQueryCount;
QAction *mPlayWithA;
};
#endif // FSWIDGET_H
|