From 8945f641f468e373b4d8d907bcc2f5be2922962e Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 4 Sep 2016 03:32:56 +0200 Subject: Display duration and num. of selected Files When selecting files in FileWidget, calculate the total duration and display it in the status bar. Also count the selected Files and show them. Update status bar on changing tabs. --- filewidget.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'filewidget.h') diff --git a/filewidget.h b/filewidget.h index 385eeff..7726230 100644 --- a/filewidget.h +++ b/filewidget.h @@ -4,6 +4,7 @@ #include #include #include +#include class QLineEdit; class QPushButton; @@ -16,12 +17,20 @@ class FileWidget : public QWidget { Q_OBJECT public: enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4 }; - enum CustomRoles { AttrsRole = Qt::UserRole + 1, FullPathRole = Qt::UserRole + 2, MD5SumRole = Qt::UserRole + 3 }; - enum { ColumnCount = 4 }; - enum Columns { IconColumn = 0, NameColumn = 1, MimeColumn = 2, Md5Column = 3 }; + enum CustomRoles { AttrsRole = Qt::UserRole + 1, FullPathRole = Qt::UserRole + 2, DurationRole = Qt::UserRole + 3, MD5SumRole = Qt::UserRole + 4, SecondsRole = Qt::UserRole + 5 }; + enum { ColumnCount = 5 }; + enum Columns { IconColumn = 0, NameColumn = 1, MimeColumn = 2, DurationColumn = 3, Md5Column = 4 }; explicit FileWidget(QWidget *parent = 0); ~FileWidget(); + signals: + void statusMessage(const QString &msg); + void selectionCountChanged(const QString &msg); + void durationChanged(const QString &duration); + + public slots: + void fileSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + private slots: void gatherData(); void selectDir(); -- cgit v1.2.3-70-g09d2