Add default channel to bookmarks

Bookmarks can store a channel to join on connect, given either as a
"/"-separated path or a channel id, plus an optional channel password.
"Add bookmark" offers to remember the channel you are currently in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 13:49:54 +00:00
parent 17ad6cde1c
commit a69b7bde74
6 changed files with 183 additions and 10 deletions

View File

@@ -124,6 +124,10 @@ public final class BookmarksDialog extends JDialog {
JTextField port = new JTextField(Integer.toString(b.port));
JTextField nick = new JTextField(b.nickname == null ? "" : b.nickname);
JPasswordField password = new JPasswordField(b.password == null ? "" : b.password);
JTextField channel = new JTextField(b.channel == null ? "" : b.channel);
channel.setToolTipText("Channel path, e.g. \"Lobby/Games\", or a channel id. "
+ "Leave empty for the server's default channel.");
JPasswordField channelPassword = new JPasswordField(b.channelPassword == null ? "" : b.channelPassword);
IdentityChooser identity = new IdentityChooser(identities, true, b.identityId);
JPanel form = new JPanel(new GridLayout(0, 1, 0, 2));
@@ -137,6 +141,10 @@ public final class BookmarksDialog extends JDialog {
form.add(nick);
form.add(new JLabel("Password (optional):"));
form.add(password);
form.add(new JLabel("Default channel (path or id, optional):"));
form.add(channel);
form.add(new JLabel("Channel password (optional):"));
form.add(channelPassword);
form.add(new JLabel("Identity:"));
form.add(identity);
@@ -157,6 +165,8 @@ public final class BookmarksDialog extends JDialog {
}
b.nickname = nick.getText().trim();
b.password = new String(password.getPassword());
b.channel = channel.getText().trim();
b.channelPassword = new String(channelPassword.getPassword());
b.identityId = identity.getSelectedIdentityId();
return true;
}