diff options
author | Arno <arno@disconnect.de> | 2016-09-04 17:06:53 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-09-04 17:06:53 +0200 |
commit | 51b8435880013f1d4533379811a9b89c1ea3173c (patch) | |
tree | ec5642e7b80766af184a9a839c5830ebb40659f7 /filewidget.h | |
parent | c930104f93104649ad4ae5b9e23e65a3fa2c058d (diff) | |
download | ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.tar.gz ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.tar.bz2 ShemovCleaner-51b8435880013f1d4533379811a9b89c1ea3173c.zip |
Make QActions local to FileWidget
Introduce Globals singleton for global actions.
Diffstat (limited to 'filewidget.h')
-rw-r--r-- | filewidget.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/filewidget.h b/filewidget.h index 11be6c0..f4458d5 100644 --- a/filewidget.h +++ b/filewidget.h @@ -13,9 +13,11 @@ class QLineEdit; class QStandardItemModel; class QTreeView; class QProgressBar; +class QKeyEvent; +class QAction; class VideoSorter; class FileDisplay; -class QKeyEvent; + class FileWidget : public QWidget { Q_OBJECT @@ -24,6 +26,7 @@ class FileWidget : public QWidget { 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 }; + enum FileAction { Copy, Paste }; explicit FileWidget(QWidget *parent = 0); QTreeView *fileView() { return mFileView; } QMenuBar *menuBar() { return mMenuBar; } @@ -44,18 +47,20 @@ class FileWidget : public QWidget { void deleteFiles(); void gatherData(); void selectDir(); - - private slots: - void filter(); - void clearFilter(); void properties(); void properties(const QModelIndex &idx); + void filter(); + void clearFilter(); + void copy(); + void cut(); + void paste(); protected: virtual void keyPressEvent(QKeyEvent *e); private: void setupGui(); + void createActions(); void fileData(const QString &fullPath, const QString &md5); int md5Count(const QString &md5); void readHeaderData(); @@ -63,19 +68,30 @@ class FileWidget : public QWidget { void readSettings(); void writeSettings(); void deleteRecursive(const QFileInfo &start); + QAction *createSeparator(); QLineEdit *mDir; QLineEdit *mFilter; QStandardItemModel *mModel; QTreeView *mFileView; - VideoSorter *mProxy; - QSqlDatabase mDb; - QSqlQuery mQOrigin; - QSqlQuery mQFiles; - FileDisplay *mFileDisplay; QMenuBar *mMenuBar; QToolBar *mToolBar; QProgressBar *mProgressBar; QString mLastDir; + QSqlDatabase mDb; + QSqlQuery mQOrigin; + QSqlQuery mQFiles; + QAction *mSelDirA; + QAction *mRefreshA; + QAction *mDirUpA; + QAction *mDirBackA; + QAction *mPropertiesA; + QAction *mCopyA; + QAction *mCutA; + QAction *mPasteA; + QAction *mDeleteA; + FileDisplay *mFileDisplay; + VideoSorter *mProxy; + int mFileAction; }; #endif // FILEWIDGET_H |