mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-03-14 09:42:28 +01:00
qt: Update moderation UI visibility in chat room
This commit is contained in:
parent
c14206640b
commit
d63c7948ba
@ -459,12 +459,15 @@ void ChatRoom::PopupContextMenu(const QPoint& menu_location) {
|
||||
});
|
||||
}
|
||||
|
||||
if (has_mod_perms && nickname != cur_nickname) { // You can't kick or ban yourself
|
||||
if (nickname != cur_nickname) { // You can't kick or ban yourself
|
||||
context_menu.addSeparator();
|
||||
|
||||
QAction* kick_action = context_menu.addAction(tr("Kick"));
|
||||
QAction* ban_action = context_menu.addAction(tr("Ban"));
|
||||
|
||||
kick_action->setEnabled(has_mod_perms);
|
||||
ban_action->setEnabled(has_mod_perms);
|
||||
|
||||
connect(kick_action, &QAction::triggered, [this, nickname] {
|
||||
QMessageBox::StandardButton result =
|
||||
QMessageBox::question(this, tr("Kick Player"),
|
||||
|
@ -47,8 +47,6 @@ ClientRoomWindow::ClientRoomWindow(QWidget* parent)
|
||||
ModerationDialog dialog(this);
|
||||
dialog.exec();
|
||||
});
|
||||
ui->moderation->setDefault(false);
|
||||
ui->moderation->setAutoDefault(false);
|
||||
connect(ui->chat, &ChatRoom::UserPinged, this, &ClientRoomWindow::ShowNotification);
|
||||
UpdateView();
|
||||
}
|
||||
@ -57,9 +55,7 @@ ClientRoomWindow::~ClientRoomWindow() = default;
|
||||
|
||||
void ClientRoomWindow::SetModPerms(bool is_mod) {
|
||||
ui->chat->SetModPerms(is_mod);
|
||||
ui->moderation->setVisible(is_mod);
|
||||
ui->moderation->setDefault(false);
|
||||
ui->moderation->setAutoDefault(false);
|
||||
ui->moderation->setEnabled(is_mod);
|
||||
}
|
||||
|
||||
void ClientRoomWindow::RetranslateUi() {
|
||||
|
@ -47,7 +47,7 @@
|
||||
<string>Moderation...</string>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user