mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
Fix remaining review threads on the report queue dashboard
- Read the raw report status from Qt::UserRole in DlgMyReports, so regular users can comment on their own open reports again. - Exclude the server's depth-0 seed row from the related-alt count. - Dim only IP matches shared by more than the pair, not every IP match. - Activate alts rows on double-click or Enter instead of `activated`, which fires on a single click on single-click platforms. - Fold the reported-user bolding pass into the fill loop.
This commit is contained in:
parent
e7b0f397af
commit
fd2858fb53
7 changed files with 80 additions and 9 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_alts.h"
|
||||
|
||||
#include "../utility/epoch_format.h"
|
||||
#include "../utility/table_activation.h"
|
||||
#include "abstract_client.h"
|
||||
#include "libcockatrice/protocol/pb/response.pb.h"
|
||||
#include "libcockatrice/protocol/pb/response_user_alts.pb.h"
|
||||
|
|
@ -135,7 +136,7 @@ TabAlts::TabAlts(TabSupervisor *_tabSupervisor, AbstractClient *_client, const Q
|
|||
|
||||
altsTable = new QTableWidget(0, COL_ALTS_COUNT);
|
||||
configureAltTable(altsTable);
|
||||
connect(altsTable, &QTableWidget::activated, this, [this](const QModelIndex &index) {
|
||||
connectTableActivation(altsTable, this, [this](const QModelIndex &index) {
|
||||
if (!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -393,7 +394,7 @@ void TabAlts::renderTable()
|
|||
altsTable->setItem(row, COL_ALTS_BANS, new QTableWidgetItem(QString::number(alt.ban_count())));
|
||||
altsTable->setItem(row, COL_ALTS_ACTIVE, new QTableWidgetItem(alt.is_active() ? tr("yes") : tr("no")));
|
||||
if (QString::fromStdString(alt.match_reason()).startsWith(QStringLiteral("ip:")) && alt.has_shared_count() &&
|
||||
alt.shared_count() > 1) {
|
||||
alt.shared_count() > 2) {
|
||||
for (int col = 0; col < COL_ALTS_COUNT; ++col) {
|
||||
if (auto *item = altsTable->item(row, col)) {
|
||||
item->setForeground(dimColor);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_moderation.h"
|
||||
|
||||
#include "../utility/epoch_format.h"
|
||||
#include "../utility/table_activation.h"
|
||||
#include "abstract_client.h"
|
||||
#include "libcockatrice/protocol/pb/admin_commands.pb.h"
|
||||
#include "libcockatrice/protocol/pb/response.pb.h"
|
||||
|
|
@ -176,7 +177,7 @@ TabModeration::TabModeration(TabSupervisor *_tabSupervisor, AbstractClient *_cli
|
|||
|
||||
altsTable = new QTableWidget(0, COL_ALTS_COUNT);
|
||||
configureTable(altsTable);
|
||||
connect(altsTable, &QTableWidget::activated, this, [this](const QModelIndex &index) {
|
||||
connectTableActivation(altsTable, this, [this](const QModelIndex &index) {
|
||||
if (!index.isValid()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -456,7 +457,14 @@ void TabModeration::altsResponse(const Response &response)
|
|||
}
|
||||
|
||||
const Response_UserAlts &resp = response.GetExtension(Response_UserAlts::ext);
|
||||
cachedAltsCount = resp.alts_size();
|
||||
// The server always includes the frontier user as a depth-0 seed row.
|
||||
int relatedCount = 0;
|
||||
for (int i = 0; i < resp.alts_size(); ++i) {
|
||||
if (!resp.alts(i).has_depth() || resp.alts(i).depth() > 0) {
|
||||
++relatedCount;
|
||||
}
|
||||
}
|
||||
cachedAltsCount = relatedCount;
|
||||
applyAltsCount();
|
||||
altsTable->setRowCount(resp.alts_size());
|
||||
for (int i = 0; i < resp.alts_size(); ++i) {
|
||||
|
|
|
|||
|
|
@ -471,6 +471,9 @@ void TabReport::applyFilters()
|
|||
table->setSortingEnabled(false);
|
||||
table->setRowCount(filteredReports.size());
|
||||
|
||||
QFont reportedFont = table->font();
|
||||
reportedFont.setBold(true);
|
||||
|
||||
for (int row = 0; row < filteredReports.size(); ++row) {
|
||||
const ServerInfo_Report &r = filteredReports[row];
|
||||
|
||||
|
|
@ -484,11 +487,7 @@ void TabReport::applyFilters()
|
|||
|
||||
table->setItem(row, COL_ROOM,
|
||||
new QTableWidgetItem(r.has_room_id() && r.room_id() > 0 ? QString::number(r.room_id()) : ""));
|
||||
}
|
||||
|
||||
QFont reportedFont = table->font();
|
||||
reportedFont.setBold(true);
|
||||
for (int row = 0; row < filteredReports.size(); ++row) {
|
||||
if (auto *reportedItem = table->item(row, COL_REPORTED)) {
|
||||
reportedItem->setFont(reportedFont);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue