Implement tri-state checkbox action in menu

The new TriStateAction class is an improvement of the old one in the
sense that:
1. Have public method to set states.
2. Can connect to the usual Qt slots.
3. Draws checkbox at the correct offset (where QAction draws) in menu
   and better handling of mouse clicking and keyboard navigating.
This commit is contained in:
Chocobo1
2019-07-07 21:02:13 +08:00
parent 0aa6f39db0
commit b55c6a360a
8 changed files with 396 additions and 188 deletions

View File

@@ -106,9 +106,9 @@ protected slots:
void torrentDoubleClicked();
void displayListMenu(const QPoint &);
void currentChanged(const QModelIndex &current, const QModelIndex&) override;
void toggleSelectedTorrentsSuperSeeding() const;
void toggleSelectedTorrentsSequentialDownload() const;
void toggleSelectedFirstLastPiecePrio() const;
void setSelectedTorrentsSuperSeeding(bool enabled) const;
void setSelectedTorrentsSequentialDownload(bool enabled) const;
void setSelectedFirstLastPiecePrio(bool enabled) const;
void setSelectedAutoTMMEnabled(bool enabled) const;
void askNewCategoryForSelection();
void saveSettings();