Files
voice-cat/clients/windows/VoiceCat.App/Forms/AddServerDialog.Designer.cs
Talon 63b241cc2e feat(M4): Windows WinForms client, TOFU identity pinning, VAD threshold + always-on mode
Core ABI extensions (voicecat.h):
- vc_list_channels / vc_list_users / vc_list_user_streams — pull-based snapshot getters
  for the channel-tree and user-list UI; session_model_mu_ guards cross-thread reads
- VC_EVENT_JOIN_RESULT / vc_join_channel — channel join with optional password
- VC_EVENT_SERVER_IDENTITY + vc_confirm_server_identity — TOFU gate that blocks io_thread_
  until the UI approves or rejects; pins TLS leaf-cert SHA-256 (not declared Ed25519)
- vc_get_server_identity_display — Ed25519 fingerprint for human-readable display only
- VC_INPUT_ALWAYS_ON = 2 in vc_input_mode — transmit unconditionally, no VAD gate
- vc_set_vad_threshold — live RMS threshold update (0.0–1.0); EnergyVadProcessor stores
  it atomically so the audio RT path reads without a lock

C++ implementation:
- SessionModel::apply_snapshot / apply_channel_event fixed to populate parent_id,
  password_protected, and max_users (were permanently zeroed)
- TlsContext::peer_cert_fingerprint — SHA-256 of peer leaf cert DER via mbedTLS
- TofuStore split into peek (read-only) + pin (write) so first-connect only persists
  after user approval; tofu_store_path in vc_config for per-user pin file location
- TcpAcceptor uses dual-stack IPv6+IPv4 fallback (fixes localhost → ::1 on Windows)
- windows-client CMake preset: Release shared DLL, static MinGW runtime, no tools/tests
- New C++ tests: test_channel_user_list_abi, test_tofu_flow (14/14 green)

Windows client (clients/windows/ — .NET 10 WinForms):
- VoiceCat.Interop: LibraryImport P/Invoke surface, UnmanagedCallersOnly callbacks,
  Channel<VoiceCatEvent> event delivery drained by 30ms WinForms Timer
- VoiceCat.App: ConnectDialog (saved servers, DPAPI password storage), ServerIdentity-
  Dialog (TOFU first-connect / mismatch warning), MainForm (channel TreeView, user
  ListBox, RichTextBox chat, voice controls, device pickers, VAD/PTT/always-on mode,
  per-user gain/mute/NR tuning, VAD sensitivity TrackBar, level meter ProgressBar)
- PttKeyCaptureDialog — focus-scoped PTT key capture (documented limitation)
- PerUserTuningDialog — real-time gain/mute/NR applied to all of a user's streams
- Accessibility: explicit AccessibleName/Description on every control, & mnemonics,
  Activity log ListBox as durable screen-reader record, AutomationNotification for
  curated live announcements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 00:35:16 +02:00

188 lines
6.5 KiB
C#

namespace VoiceCat.App.Forms;
partial class AddServerDialog
{
private System.ComponentModel.IContainer components = null!;
private Label lblDisplayName = null!;
private TextBox txtDisplayName = null!;
private Label lblHost = null!;
private TextBox txtHost = null!;
private Label lblPort = null!;
private NumericUpDown numPort = null!;
private GroupBox grpAuth = null!;
private RadioButton radioGuest = null!;
private RadioButton radioPassword = null!;
private Label lblNickname = null!;
private TextBox txtNickname = null!;
private Label lblUsername = null!;
private TextBox txtUsername = null!;
private Label lblPassword = null!;
private TextBox txtPassword = null!;
private CheckBox chkRememberPassword = null!;
private Button btnOk = null!;
private Button btnCancel = null!;
protected override void Dispose(bool disposing)
{
if (disposing) components?.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
lblDisplayName = new Label();
txtDisplayName = new TextBox();
lblHost = new Label();
txtHost = new TextBox();
lblPort = new Label();
numPort = new NumericUpDown();
grpAuth = new GroupBox();
radioGuest = new RadioButton();
radioPassword = new RadioButton();
lblNickname = new Label();
txtNickname = new TextBox();
lblUsername = new Label();
txtUsername = new TextBox();
lblPassword = new Label();
txtPassword = new TextBox();
chkRememberPassword = new CheckBox();
btnOk = new Button();
btnCancel = new Button();
int y = 12;
const int rowH = 30;
lblDisplayName.Text = "&Display name:";
lblDisplayName.AutoSize = true;
lblDisplayName.Location = new Point(12, y + 3);
lblDisplayName.TabIndex = 0;
txtDisplayName.AccessibleName = "Display name";
txtDisplayName.Location = new Point(140, y);
txtDisplayName.Size = new Size(280, 23);
txtDisplayName.TabIndex = 1;
y += rowH;
lblHost.Text = "&Host:";
lblHost.AutoSize = true;
lblHost.Location = new Point(12, y + 3);
lblHost.TabIndex = 2;
txtHost.AccessibleName = "Host";
txtHost.Location = new Point(140, y);
txtHost.Size = new Size(200, 23);
txtHost.TabIndex = 3;
txtHost.PlaceholderText = "127.0.0.1";
y += rowH;
lblPort.Text = "&Port:";
lblPort.AutoSize = true;
lblPort.Location = new Point(12, y + 3);
lblPort.TabIndex = 4;
numPort.AccessibleName = "Port";
numPort.Location = new Point(140, y);
numPort.Size = new Size(100, 23);
numPort.Minimum = 1;
numPort.Maximum = 65535;
numPort.Value = 8384;
numPort.TabIndex = 5;
y += rowH;
grpAuth.Text = "Authentication";
grpAuth.Location = new Point(12, y);
grpAuth.Size = new Size(408, 140);
grpAuth.TabIndex = 6;
radioGuest.Text = "Connect as &guest";
radioGuest.AutoSize = true;
radioGuest.Location = new Point(12, 24);
radioGuest.Checked = true;
radioGuest.TabIndex = 0;
lblNickname.Text = "&Nickname:";
lblNickname.AutoSize = true;
lblNickname.Location = new Point(30, 50);
lblNickname.TabIndex = 1;
txtNickname.AccessibleName = "Guest nickname";
txtNickname.Location = new Point(140, 47);
txtNickname.Size = new Size(240, 23);
txtNickname.TabIndex = 2;
radioPassword.Text = "Use a &saved account";
radioPassword.AutoSize = true;
radioPassword.Location = new Point(12, 76);
radioPassword.TabIndex = 3;
lblUsername.Text = "&Username:";
lblUsername.AutoSize = true;
lblUsername.Location = new Point(30, 102);
lblUsername.TabIndex = 4;
txtUsername.AccessibleName = "Username";
txtUsername.Location = new Point(140, 99);
txtUsername.Size = new Size(240, 23);
txtUsername.TabIndex = 5;
lblPassword.Text = "Pass&word:";
lblPassword.AutoSize = true;
lblPassword.Location = new Point(30, 132);
lblPassword.TabIndex = 6;
txtPassword.AccessibleName = "Password";
txtPassword.Location = new Point(140, 129);
txtPassword.Size = new Size(240, 23);
txtPassword.UseSystemPasswordChar = true;
txtPassword.TabIndex = 7;
grpAuth.Controls.Add(radioGuest);
grpAuth.Controls.Add(lblNickname);
grpAuth.Controls.Add(txtNickname);
grpAuth.Controls.Add(radioPassword);
grpAuth.Controls.Add(lblUsername);
grpAuth.Controls.Add(txtUsername);
grpAuth.Controls.Add(lblPassword);
grpAuth.Controls.Add(txtPassword);
y += 148;
chkRememberPassword.Text = "&Remember my password on this computer";
chkRememberPassword.AutoSize = true;
chkRememberPassword.AccessibleDescription =
"Stores the password protected by Windows Data Protection (DPAPI), decryptable " +
"only by your Windows account on this machine. Leave unchecked to be prompted " +
"for the password every time.";
chkRememberPassword.Location = new Point(12, y);
chkRememberPassword.TabIndex = 7;
y += rowH;
btnOk.Text = "&OK";
btnOk.DialogResult = DialogResult.OK;
btnOk.Location = new Point(264, y);
btnOk.Size = new Size(75, 27);
btnOk.TabIndex = 8;
btnCancel.Text = "&Cancel";
btnCancel.DialogResult = DialogResult.Cancel;
btnCancel.Location = new Point(345, y);
btnCancel.Size = new Size(75, 27);
btnCancel.TabIndex = 9;
y += rowH + 12;
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(432, y);
Controls.Add(lblDisplayName);
Controls.Add(txtDisplayName);
Controls.Add(lblHost);
Controls.Add(txtHost);
Controls.Add(lblPort);
Controls.Add(numPort);
Controls.Add(grpAuth);
Controls.Add(chkRememberPassword);
Controls.Add(btnOk);
Controls.Add(btnCancel);
AcceptButton = btnOk;
CancelButton = btnCancel;
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
StartPosition = FormStartPosition.CenterParent;
Text = "Add server";
}
}