Commit 33c02535 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Update status checkbox

parent db5bb66b
Pipeline #64875 passed with stage
in 42 minutes and 11 seconds
......@@ -168,6 +168,7 @@ void Widget::slotActivateFilter(Filter *f)
setFilter(f);
d->quickSearchLine->searchEdit()->setText(f->searchString());
d->quickSearchLine->setSearchOptions(f->currentOptions());
d->quickSearchLine->setFilterMessageStatus(f->status());
}
void Widget::slotSaveFilter(const QString &filterName)
......
......@@ -134,6 +134,12 @@ void QuickSearchLine::slotFilterActionChanged(const QVector<Akonadi::MessageStat
Q_EMIT statusButtonsClicked();
}
void QuickSearchLine::setFilterMessageStatus(const QVector<Akonadi::MessageStatus> &newLstStatus)
{
mLstStatus = newLstStatus;
mSearchEdit->setFilterMessageStatus(mLstStatus);
}
QVector<Akonadi::MessageStatus> QuickSearchLine::status() const
{
return mLstStatus;
......
......@@ -60,6 +60,8 @@ public:
void addCompletionItem(const QString &str);
void setSearchOptions(QuickSearchLine::SearchOptions opts);
void setFilterMessageStatus(const QVector<Akonadi::MessageStatus> &newLstStatus);
Q_SIGNALS:
void clearButtonClicked();
void searchEditTextEdited(const QString &);
......
......@@ -374,6 +374,23 @@ void SearchLineStatus::setSearchOptions(QuickSearchLine::SearchOptions opts)
}
}
void SearchLineStatus::setFilterMessageStatus(const QVector<Akonadi::MessageStatus> &newLstStatus)
{
clearFilterAction();
clearFilterByAction();
// TODO unchecked all checkbox
for (const Akonadi::MessageStatus &status : newLstStatus) {
for (QAction *act : qAsConst(mFilterListActions)) {
if (static_cast<qint32>(act->data().toInt()) == status.toQInt32()) {
act->setChecked(true);
mHasFilter = true;
break;
}
}
}
updateFilterActionIcon();
}
void SearchLineStatus::slotFilterActionClicked(QAction *act)
{
Q_UNUSED(act)
......
......@@ -33,6 +33,7 @@ public:
Q_REQUIRED_RESULT bool containsOutboundMessages() const;
Q_REQUIRED_RESULT QuickSearchLine::SearchOptions searchOptions() const;
void setSearchOptions(QuickSearchLine::SearchOptions opts);
void setFilterMessageStatus(const QVector<Akonadi::MessageStatus> &newLstStatus);
void addCompletionItem(const QString &str);
void slotClearHistory();
void clearFilterButtonClicked();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment