diff options
author | Arno <arno@disconnect.de> | 2016-08-20 17:04:58 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-08-20 17:04:58 +0200 |
commit | 96c798d4e9ca91cade25aa6d38176714979685bc (patch) | |
tree | 0a9293bd203e68faeb28e668fe5e8ab32ec5c1b5 /torrentwidget.h | |
parent | ddd1616f5c310c94214e0ba2629f174c4cf768f3 (diff) | |
download | ShemovCleaner-96c798d4e9ca91cade25aa6d38176714979685bc.tar.gz ShemovCleaner-96c798d4e9ca91cade25aa6d38176714979685bc.tar.bz2 ShemovCleaner-96c798d4e9ca91cade25aa6d38176714979685bc.zip |
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!
Diffstat (limited to 'torrentwidget.h')
-rw-r--r-- | torrentwidget.h | 64 |
1 files changed, 64 insertions, 0 deletions
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 <QMainWindow> +#include <QItemSelection> +#include <QString> +#include <QContextMenuEvent> + +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 |