Devtools Improvements

- Now has tabs setup as more features are added
- First extra tab has basic server info
- Use mobileform to make it look nicer
- For the room data tab allow the room to be changed from within devtools
- For the room data tab allow m.room.member events to be filtered out so other event types can be found easily
- For the room data tab allow viewing room account data

network/neochat#557
This commit is contained in:
James Graham
2023-04-29 15:20:51 +00:00
committed by Tobias Fella
parent ca805917de
commit 85b40ca536
14 changed files with 347 additions and 23 deletions

View File

@@ -0,0 +1,32 @@
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include "statefiltermodel.h"
#include "statemodel.h"
bool StateFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
Q_UNUSED(sourceParent);
// No need to run the check if there are no items in m_stateEventTypesFiltered.
if (m_stateEventTypesFiltered.empty()) {
return true;
}
return !m_stateEventTypesFiltered.contains(sourceModel()->data(sourceModel()->index(sourceRow, 0), StateModel::TypeRole).toString());
}
void StateFilterModel::addStateEventTypeFiltered(const QString &stateEventType)
{
if (!m_stateEventTypesFiltered.contains(stateEventType)) {
m_stateEventTypesFiltered.append(stateEventType);
invalidateFilter();
}
}
void StateFilterModel::removeStateEventTypeFiltered(const QString &stateEventType)
{
if (m_stateEventTypesFiltered.contains(stateEventType)) {
m_stateEventTypesFiltered.removeAll(stateEventType);
invalidateFilter();
}
}