mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Merge pull request #6315 from glassez/cat-tree-state
Fix category filter widget doesn't save on/off state
This commit is contained in:
commit
fa8c69a5e1
@ -78,6 +78,7 @@ CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
|
|||||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
#endif
|
#endif
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
setCurrentIndex(model()->index(0, 0));
|
||||||
|
|
||||||
connect(this, SIGNAL(collapsed(QModelIndex)), SLOT(callUpdateGeometry()));
|
connect(this, SIGNAL(collapsed(QModelIndex)), SLOT(callUpdateGeometry()));
|
||||||
connect(this, SIGNAL(expanded(QModelIndex)), SLOT(callUpdateGeometry()));
|
connect(this, SIGNAL(expanded(QModelIndex)), SLOT(callUpdateGeometry()));
|
||||||
|
@ -580,7 +580,7 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
|
|||||||
, transferList, SLOT(startVisibleTorrents()));
|
, transferList, SLOT(startVisibleTorrents()));
|
||||||
connect(m_categoryFilterWidget, SIGNAL(categoryChanged(QString))
|
connect(m_categoryFilterWidget, SIGNAL(categoryChanged(QString))
|
||||||
, transferList, SLOT(applyCategoryFilter(QString)));
|
, transferList, SLOT(applyCategoryFilter(QString)));
|
||||||
onCategoryFilterStateChanged(pref->getCategoryFilterState());
|
toggleCategoryFilter(pref->getCategoryFilterState());
|
||||||
frameLayout->addWidget(m_categoryFilterWidget);
|
frameLayout->addWidget(m_categoryFilterWidget);
|
||||||
|
|
||||||
QCheckBox *trackerLabel = new QCheckBox(tr("Trackers"), this);
|
QCheckBox *trackerLabel = new QCheckBox(tr("Trackers"), this);
|
||||||
@ -638,6 +638,12 @@ void TransferListFiltersWidget::trackerError(BitTorrent::TorrentHandle *const to
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TransferListFiltersWidget::onCategoryFilterStateChanged(bool enabled)
|
void TransferListFiltersWidget::onCategoryFilterStateChanged(bool enabled)
|
||||||
|
{
|
||||||
|
toggleCategoryFilter(enabled);
|
||||||
|
Preferences::instance()->setCategoryFilterState(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransferListFiltersWidget::toggleCategoryFilter(bool enabled)
|
||||||
{
|
{
|
||||||
m_categoryFilterWidget->setVisible(enabled);
|
m_categoryFilterWidget->setVisible(enabled);
|
||||||
m_transferList->applyCategoryFilter(enabled ? m_categoryFilterWidget->currentCategory() : QString());
|
m_transferList->applyCategoryFilter(enabled ? m_categoryFilterWidget->currentCategory() : QString());
|
||||||
|
@ -162,6 +162,8 @@ private slots:
|
|||||||
void onCategoryFilterStateChanged(bool enabled);
|
void onCategoryFilterStateChanged(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void toggleCategoryFilter(bool enabled);
|
||||||
|
|
||||||
TransferListWidget *m_transferList;
|
TransferListWidget *m_transferList;
|
||||||
TrackerFiltersList *m_trackerFilters;
|
TrackerFiltersList *m_trackerFilters;
|
||||||
CategoryFilterWidget *m_categoryFilterWidget;
|
CategoryFilterWidget *m_categoryFilterWidget;
|
||||||
|
Loading…
Reference in New Issue
Block a user