Advanced channel filters (#1748)

Adds custom channel filters complete with their own mini-language. Filters can be created in settings, and applied by clicking the three dots to open the Split menu and selecting "Set filters".
This commit is contained in:
dnsge
2020-10-18 15:16:56 +02:00
committed by Rasmus Karlsson
parent 812cbdf4f9
commit 4199a01b96
41 changed files with 2189 additions and 43 deletions
+24
View File
@@ -21,6 +21,7 @@
#include "widgets/Window.hpp"
#include "widgets/dialogs/QualityPopup.hpp"
#include "widgets/dialogs/SelectChannelDialog.hpp"
#include "widgets/dialogs/SelectChannelFiltersDialog.hpp"
#include "widgets/dialogs/TextInputDialog.hpp"
#include "widgets/dialogs/UserInfoPopup.hpp"
#include "widgets/helper/ChannelView.hpp"
@@ -749,10 +750,33 @@ void Split::copyToClipboard()
crossPlatformCopy(this->view_->getSelectedText());
}
void Split::setFiltersDialog()
{
SelectChannelFiltersDialog d(this->getFilters(), this);
d.setWindowTitle("Select filters");
if (d.exec() == QDialog::Accepted)
{
this->setFilters(d.getSelection());
}
}
void Split::setFilters(const QList<QUuid> ids)
{
this->view_->setFilters(ids);
this->header_->updateChannelText();
}
const QList<QUuid> Split::getFilters() const
{
return this->view_->getFilterIds();
}
void Split::showSearch()
{
SearchPopup *popup = new SearchPopup();
popup->setChannelFilters(this->view_->getFilterSet());
popup->setAttribute(Qt::WA_DeleteOnClose);
popup->setChannel(this->getChannel());
popup->show();