Add Set Server/Channel Group context menus and dialog

Lets moderators assign or revoke server and channel groups for a
client directly from its context menu, with per-group checkboxes
gated by the client's actual TS3 permissions (i_group_needed_member_
add/remove_power vs. each group's n_member_addp/removep, including
TS3's -1 "unlimited" sentinel). A "Server Groups Dialog..." entry
shows every server group, graying out ones the client can't touch.

Group membership changes now update ClientEntry locally instead of
only logging them, so the checkboxes and dialog reflect a change
immediately instead of needing a reconnect. The server's default
channel group (e.g. "Guest") is hidden from the channel-group menu
since it's not something you assign directly.
This commit is contained in:
2026-08-18 15:07:38 +00:00
parent e5b607fc29
commit acf0221837
11 changed files with 415 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package com.ts3client.ui;
import com.ts3client.net.ChannelNode;
import com.ts3client.net.ClientEntry;
import com.ts3client.net.Group;
import com.ts3client.net.ServerModel;
import javax.swing.DropMode;
@@ -71,6 +72,15 @@ public final class ServerTreePanel extends JScrollPane {
* siblings, or 0 to place it first
*/
void moveChannel(ChannelNode channel, int newParentId, int orderPredecessorId);
/** Assigns or removes a server group for a client. */
void setClientServerGroup(ClientEntry client, Group group, boolean assign);
/** Assigns a channel group for a client in its current channel. */
void setClientChannelGroup(ClientEntry client, Group group);
/** Opens the full server-groups list dialog for a client. */
void showServerGroupsDialog(ClientEntry client);
}
private final DropIndicatorTree tree;
@@ -187,7 +197,7 @@ public final class ServerTreePanel extends JScrollPane {
}
private void showClientMenu(ClientEntry client, MouseEvent e) {
ClientMenu.build(client, client.id == selfClientId, actions).show(tree, e.getX(), e.getY());
ClientMenu.build(client, client.id == selfClientId, model, groupIcons, actions).show(tree, e.getX(), e.getY());
}
private void showChannelMenu(ChannelNode channel, MouseEvent e) {