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! --- torrentwidget.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 torrentwidget.h (limited to 'torrentwidget.h') diff --git a/torrentwidget.h b/torrentwidget.h new file mode 100644 index 0000000..b1f33bb --- /dev/null +++ b/torrentwidget.h @@ -0,0 +1,64 @@ +#ifndef TORRENTWIDGET_H +#define TORRENTWIDGET_H + +#include +#include +#include +#include + +class QPushButton; +class QLineEdit; +class QTreeView; +class QStandardItemModel; +class QLabel; +class QToolBar; +class QMenuBar; +class FileSorter; +class TorrentDisplay; + +class TorrentWidget : public QWidget { + Q_OBJECT + public: + TorrentWidget(QWidget *parent = 0); + QToolBar *toolBar() { return mToolBar; } + QMenuBar *menuBar() { return mMenuBar; } + ~TorrentWidget(); + + signals: + void statusMessage(const QString &msg); + void selectionCountChanged(const QString &msg); + + public slots: + void selectDir(); + void gatherData(); + void deleteFiles(); + void moveFiles(); + void torrentInfo(); + void searchFile(); + + protected: + virtual void contextMenuEvent(QContextMenuEvent *e); + + private slots: + void fileSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + + private: + void setupGui(); + void readHeaderData(); + void writeHeaderData(); + void readSettings(); + void writeSettings(); + QLineEdit *mDir; + QPushButton *mSelDir; + QLineEdit *mSearchTorrents; + QPushButton *mDoSearchTorrents; + QString mExt; + QStandardItemModel *mModel; + FileSorter *mProxy; + QTreeView *mFileView; + TorrentDisplay *mTorrentDisplay; + QToolBar *mToolBar; + QMenuBar *mMenuBar; +}; + +#endif // TORRENTWIDGET_H -- cgit v1.2.3-70-g09d2