summaryrefslogtreecommitdiffstats
path: root/filewidget.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-09-04 03:32:56 +0200
committerArno <arno@disconnect.de>2016-09-04 03:32:56 +0200
commit8945f641f468e373b4d8d907bcc2f5be2922962e (patch)
tree93b388c81a31abbc9573603e43017098a78853ba /filewidget.h
parente11e257f88726fd04774bf0ca4584d1678bc7f9b (diff)
downloadShemovCleaner-8945f641f468e373b4d8d907bcc2f5be2922962e.tar.gz
ShemovCleaner-8945f641f468e373b4d8d907bcc2f5be2922962e.tar.bz2
ShemovCleaner-8945f641f468e373b4d8d907bcc2f5be2922962e.zip
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.
Diffstat (limited to 'filewidget.h')
-rw-r--r--filewidget.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/filewidget.h b/filewidget.h
index 385eeff..7726230 100644
--- a/filewidget.h
+++ b/filewidget.h
@@ -4,6 +4,7 @@
#include <QWidget>
#include <QSqlDatabase>
#include <QSqlQuery>
+#include <QItemSelection>
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();