diff options
| author | Arno <arno@disconnect.de> | 2016-11-10 05:02:44 +0100 |
|---|---|---|
| committer | Arno <arno@disconnect.de> | 2016-11-10 05:02:44 +0100 |
| commit | 5cde173217fd8cb1dbc21f3ac54f18e8234e709b (patch) | |
| tree | 309980ee31734db8ca154694137c54a831f3e01a /filewidget.h | |
| parent | 1d05ace3bdd9cd07012116b48f847b4a118e1af9 (diff) | |
| download | ShemovCleaner-5cde173217fd8cb1dbc21f3ac54f18e8234e709b.tar.gz ShemovCleaner-5cde173217fd8cb1dbc21f3ac54f18e8234e709b.tar.bz2 ShemovCleaner-5cde173217fd8cb1dbc21f3ac54f18e8234e709b.zip | |
New feature: Add Origin
Since SheMov now displays origin files (i.e. source files for a
reencode), add an option here to add origin files for already archived
movies.
We guess the archived movie from the filename by cutting off the
extension and look it up in the files table.
If we find an archived movie with that filename, mark the source blue.
Deactive "Add" if we don't find one or if we already have an origin.
Diffstat (limited to 'filewidget.h')
| -rw-r--r-- | filewidget.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/filewidget.h b/filewidget.h index b9133e2..ef18603 100644 --- a/filewidget.h +++ b/filewidget.h @@ -18,12 +18,12 @@ class QAction; class QMimeData; class VideoSorter; class FileDisplay; - +class OriginDialog; class FileWidget : public QWidget { Q_OBJECT public: - enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4 }; + enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4, Origin = 5 }; 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 }; @@ -56,6 +56,7 @@ class FileWidget : public QWidget { void cut(); void paste(); void selectFirst(); + void addAsOrigin(); protected: virtual void keyPressEvent(QKeyEvent *e); @@ -66,6 +67,7 @@ class FileWidget : public QWidget { void createActions(); void fileData(const QString &fullPath, const QString &md5); int md5Count(const QString &md5); + bool haveOrigin(const QString filename); void readHeaderData(); void writeHeaderData(); void readSettings(); @@ -84,6 +86,7 @@ class FileWidget : public QWidget { QSqlDatabase mDb; QSqlQuery mQOrigin; QSqlQuery mQFiles; + QSqlQuery mQSimilar; QMimeData *mMimeData; QAction *mSelDirA; QAction *mRefreshA; @@ -94,8 +97,10 @@ class FileWidget : public QWidget { QAction *mCutA; QAction *mPasteA; QAction *mDeleteA; + QAction *mAddAsOriginA; FileDisplay *mFileDisplay; VideoSorter *mProxy; + OriginDialog *mOrignDlg; int mFileAction; }; |
