Move a client into your own channel from its context menu
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,12 @@ final class ClientMenu {
|
|||||||
JMenuItem info = new JMenuItem("Connection Info", Icons.of("INFO"));
|
JMenuItem info = new JMenuItem("Connection Info", Icons.of("INFO"));
|
||||||
info.addActionListener(a -> actions.showConnectionInfo(client));
|
info.addActionListener(a -> actions.showConnectionInfo(client));
|
||||||
menu.add(info);
|
menu.add(info);
|
||||||
|
if (!self) {
|
||||||
|
menu.addSeparator();
|
||||||
|
JMenuItem moveHere = new JMenuItem("Move Client to own Channel", Icons.of("MOVE_CLIENT_TO_OWN_CHANNEL"));
|
||||||
|
moveHere.addActionListener(a -> actions.moveClientToOwnChannel(client));
|
||||||
|
menu.add(moveHere);
|
||||||
|
}
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,6 +380,13 @@ final class ServerTab implements ConnectionListener, ServerTreePanel.Actions {
|
|||||||
new ConnectionInfoDialog(host, conn, client.id, client.nickname).setVisible(true);
|
new ConnectionInfoDialog(host, conn, client.id, client.nickname).setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveClientToOwnChannel(ClientEntry client) {
|
||||||
|
if (!conn.isConnected() || client.id == conn.getSelfClientId()) return;
|
||||||
|
ClientEntry self = conn.getModel().getClient(conn.getSelfClientId());
|
||||||
|
if (self != null) conn.moveClient(client.id, self.channelId, null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setChannelSubscribed(ChannelNode channel, boolean family, boolean subscribed) {
|
public void setChannelSubscribed(ChannelNode channel, boolean family, boolean subscribed) {
|
||||||
if (conn.isConnected()) conn.setChannelsSubscribed(channel.familyIds(family), subscribed);
|
if (conn.isConnected()) conn.setChannelsSubscribed(channel.familyIds(family), subscribed);
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ public final class ServerTreePanel extends JScrollPane {
|
|||||||
|
|
||||||
void showConnectionInfo(ClientEntry client);
|
void showConnectionInfo(ClientEntry client);
|
||||||
|
|
||||||
|
/** Moves a client into the channel we are currently in. */
|
||||||
|
void moveClientToOwnChannel(ClientEntry client);
|
||||||
|
|
||||||
/** Open the file repository browser for a channel. */
|
/** Open the file repository browser for a channel. */
|
||||||
void browseFiles(ChannelNode channel);
|
void browseFiles(ChannelNode channel);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user