From 96c798d4e9ca91cade25aa6d38176714979685bc Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 20 Aug 2016 17:04:58 +0200 Subject: Revamped ShemovCleaner to a QTabWidget It's a rather large commit. After renaming ShemovCleaner to TorrentWidget, I had to recreate ShemovCleaner as MainWindow with a single Tab. Then I created QActions for everything, including a QToolBar, a QMenu and a contetext Menu. For that the button bar at the bottom had to go. Oh, and I added some icons for the actions! --- shemovcleaner.h | 53 +++++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 36 deletions(-) (limited to 'shemovcleaner.h') diff --git a/shemovcleaner.h b/shemovcleaner.h index 80ccddb..93b1581 100644 --- a/shemovcleaner.h +++ b/shemovcleaner.h @@ -2,52 +2,33 @@ #define SHEMOVCLEANER_H #include -#include -#include -class QPushButton; -class QLineEdit; -class QTreeView; -class QStandardItemModel; +class QTabWidget; +class TorrentWidget; class QLabel; -class FileSorter; -class TorrentDisplay; +class QAction; class ShemovCleaner : public QMainWindow { Q_OBJECT public: - ShemovCleaner(QWidget *parent = 0); - ~ShemovCleaner(); + ShemovCleaner(QWidget *parent = 0, Qt::WindowFlags f = 0); - private slots: - void selectDir(); - void fileSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); - void gatherData(); - void deleteFiles(); - void moveFiles(); - void torrentInfo(); - void searchFile(); + public slots: + void statusBarMessage(const QString &msg); + void setSelectionCount(const QString &msg); private: - void setupGui(); - void createStatusbar(); - void readHeaderData(); - void writeHeaderData(); - void readSettings(); - void writeSettings(); - QLineEdit *mDir; - QPushButton *mSelDir; - QLineEdit *mSearchTorrents; - QPushButton *mDoSearchTorrents; - QPushButton *mMove; - QPushButton *mDelete; - QPushButton *mInfo; - QString mExt; + void createStatusBar(); + void createActions(); + QAction *createSeparator(); QLabel *mSelected; - QStandardItemModel *mModel; - FileSorter *mProxy; - QTreeView *mFileView; - TorrentDisplay *mTorrentDisplay; + QTabWidget *mTab; + TorrentWidget *mTorrentTab; + QAction *mTorRefreshA; + QAction *mTorDeleteA; + QAction *mTorMoveA; + QAction *mTorInfoA; + QAction *mTorDirA; }; #endif // SHEMOVCLEANER_H -- cgit v1.2.3-70-g09d2