Simplify UI labels and dialogs: drop clutter, show Sonic as connected/not connected.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-31 08:19:15 +02:00
co-authored by Cursor
parent f98daec656
commit d20e0df618
8 changed files with 97 additions and 222 deletions
@@ -23,7 +23,6 @@ public sealed class SetupWizardForm : Form
private Label _lblCertificate = null!;
private Label _lblDatabase = null!;
private Label _lblSelection = null!;
private Label _lblEnvironmentBadge = null!;
private ListView _lvSystems = null!;
private ListView _lvContainers = null!;
@@ -105,20 +104,8 @@ public sealed class SetupWizardForm : Form
Font = new Font("Segoe UI Semibold", 20f, FontStyle.Bold)
};
_lblEnvironmentBadge = new Label
{
Text = _coordinator.Settings.EnvironmentCode,
Location = new Point(22, 95),
AutoSize = true,
Padding = new Padding(10, 4, 10, 4),
BackColor = Color.FromArgb(40, 208, 171, 57),
ForeColor = SettingsUi.Gold,
Font = new Font("Segoe UI Semibold", 9f, FontStyle.Bold)
};
_sidebar.Controls.Add(brand);
_sidebar.Controls.Add(brandSub);
_sidebar.Controls.Add(_lblEnvironmentBadge);
string[] navItems =
[
@@ -129,7 +116,7 @@ public sealed class SetupWizardForm : Form
"Profile"
];
int y = 150;
int y = 120;
foreach (string item in navItems)
{
@@ -692,7 +679,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst einen Zertifikat-Pfad in der Liste wählen.",
"Bitte auswählen.",
"Pfad prüfen",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -715,7 +702,7 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
result.Message + "\n\n" + target.FullTargetPath,
result.Success ? "Pfad OK." : "Prüfung fehlgeschlagen.",
"Pfad prüfen",
MessageBoxButtons.OK,
icon);
@@ -799,7 +786,7 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterSystemSavedAsync(createdId, created: true);
await AfterSystemSavedAsync(createdId);
}
private async Task EditSelectedSystemAsync()
@@ -809,7 +796,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst ein Sonic-System in der Liste wählen.",
"Bitte auswählen.",
"System bearbeiten",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -824,7 +811,7 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterSystemSavedAsync(savedId, created: false);
await AfterSystemSavedAsync(savedId);
}
private async Task DeleteSelectedSystemAsync()
@@ -834,7 +821,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst ein Sonic-System in der Liste wählen.",
"Bitte auswählen.",
"System löschen",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -843,11 +830,7 @@ public sealed class SetupWizardForm : Form
DialogResult confirm = MessageBox.Show(
this,
"Sonic-System wirklich aus der Konfiguration entfernen?\n\n"
+ $"{system.ConnectionName}\n"
+ $"{system.ConnectionUrl}\n\n"
+ "Zugehörige Container und Pfade verschwinden aus den Listen. "
+ "Der Eintrag wird in SQL nur deaktiviert (IsActive=0).",
"System entfernen?",
"System löschen",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning);
@@ -870,7 +853,7 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
$"System Id {system.SonicConnectionId} wurde deaktiviert.",
"Entfernt.",
"System gelöscht",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -881,7 +864,7 @@ public sealed class SetupWizardForm : Form
}
}
private async Task AfterSystemSavedAsync(int systemId, bool created)
private async Task AfterSystemSavedAsync(int systemId)
{
await LoadSystemsListAsync();
await LoadSystemsAsync();
@@ -895,9 +878,7 @@ public sealed class SetupWizardForm : Form
if (!visible)
{
ShowError(
$"{(created ? "Anlage" : "Update")}-Prüfung fehlgeschlagen: "
+ $"System-Id {systemId} ist nach dem Speichern nicht in der Liste.");
ShowError("Speichern fehlgeschlagen.");
return;
}
@@ -909,10 +890,8 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
created
? $"System wurde gespeichert und geprüft (Id {systemId})."
: $"System wurde aktualisiert und geprüft (Id {systemId}).",
"Prüfung OK",
"Gespeichert.",
"OK",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
@@ -935,7 +914,7 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterContainerSavedAsync(createdId, created: true);
await AfterContainerSavedAsync(createdId);
}
private async Task EditSelectedContainerAsync()
@@ -945,7 +924,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst einen Container in der Liste wählen.",
"Bitte auswählen.",
"Container bearbeiten",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -963,7 +942,7 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterContainerSavedAsync(savedId, created: false);
await AfterContainerSavedAsync(savedId);
}
private async Task DeleteSelectedContainerAsync()
@@ -973,25 +952,16 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst einen Container in der Liste wählen.",
"Bitte auswählen.",
"Container löschen",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
return;
}
string display =
string.IsNullOrWhiteSpace(container.ContainerDisplayName)
? container.ContainerName
: container.ContainerDisplayName;
DialogResult confirm = MessageBox.Show(
this,
"Container wirklich aus der Konfiguration entfernen?\n\n"
+ $"{container.CompanyCode} / {display}\n"
+ $"System: {container.ConnectionName}\n\n"
+ "Zugehörige Zertifikat-Pfade verschwinden aus der Liste. "
+ "Der Eintrag wird in SQL nur deaktiviert (IsActive=0).",
"Container entfernen?",
"Container löschen",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning);
@@ -1012,7 +982,7 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
$"Container Id {container.SonicContainerId} wurde deaktiviert.",
"Entfernt.",
"Container gelöscht",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -1023,7 +993,7 @@ public sealed class SetupWizardForm : Form
}
}
private async Task AfterContainerSavedAsync(int containerId, bool created)
private async Task AfterContainerSavedAsync(int containerId)
{
await LoadContainersListAsync();
await LoadSystemsListAsync();
@@ -1037,9 +1007,7 @@ public sealed class SetupWizardForm : Form
if (!visible)
{
ShowError(
$"{(created ? "Anlage" : "Update")}-Prüfung fehlgeschlagen: "
+ $"Container-Id {containerId} ist nach dem Speichern nicht in der Liste.");
ShowError("Speichern fehlgeschlagen.");
return;
}
@@ -1051,10 +1019,8 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
created
? $"Container wurde gespeichert und geprüft (Id {containerId})."
: $"Container wurde aktualisiert und geprüft (Id {containerId}).",
"Prüfung OK",
"Gespeichert.",
"OK",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
@@ -1077,7 +1043,7 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterPathSavedAsync(createdId, created: true);
await AfterPathSavedAsync(createdId);
}
private async Task EditSelectedPathAsync()
@@ -1087,7 +1053,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst einen Zertifikat-Pfad in der Liste wählen.",
"Bitte auswählen.",
"Pfad bearbeiten",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -1105,10 +1071,10 @@ public sealed class SetupWizardForm : Form
return;
}
await AfterPathSavedAsync(savedId, created: false);
await AfterPathSavedAsync(savedId);
}
private async Task AfterPathSavedAsync(int pathId, bool created)
private async Task AfterPathSavedAsync(int pathId)
{
await LoadPathsListAsync();
await RefreshAllAsync();
@@ -1121,9 +1087,7 @@ public sealed class SetupWizardForm : Form
if (!visible)
{
ShowError(
$"{(created ? "Anlage" : "Update")}-Prüfung fehlgeschlagen: "
+ $"Pfad-Id {pathId} ist nach dem Speichern nicht in der Liste.");
ShowError("Speichern fehlgeschlagen.");
return;
}
@@ -1135,10 +1099,8 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
created
? $"Zertifikat-Pfad wurde gespeichert und geprüft (Id {pathId})."
: $"Zertifikat-Pfad wurde aktualisiert und geprüft (Id {pathId}).",
"Prüfung OK",
"Gespeichert.",
"OK",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
@@ -1150,7 +1112,7 @@ public sealed class SetupWizardForm : Form
{
MessageBox.Show(
this,
"Bitte zuerst einen Zertifikat-Pfad in der Liste wählen.",
"Bitte auswählen.",
"Pfad löschen",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -1159,10 +1121,7 @@ public sealed class SetupWizardForm : Form
DialogResult confirm = MessageBox.Show(
this,
"Zertifikat-Pfad wirklich aus der Konfiguration entfernen?\n\n"
+ $"{target.FullTargetPath}\n\n"
+ "Die Datei auf dem Server bleibt unverändert. "
+ "Der Eintrag wird in SQL nur deaktiviert (IsActive=0).",
"Pfad entfernen?",
"Pfad löschen",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning);
@@ -1182,7 +1141,7 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
$"Pfad Id {target.CertificateTargetId} wurde deaktiviert.",
"Entfernt.",
"Pfad gelöscht",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -1255,7 +1214,7 @@ public sealed class SetupWizardForm : Form
{
if (_cmbSystem.SelectedItem is not SonicSystemOption system)
{
ShowWarning("Bitte zuerst ein Sonic-System auswählen.");
ShowWarning("Bitte auswählen.");
return;
}
@@ -1281,9 +1240,9 @@ public sealed class SetupWizardForm : Form
}
}
MessageBox.Show(
MessageBox.Show(
this,
"Profil geladen. Jetzt „Auswahl übernehmen“ klicken.",
"Profil geladen.",
"Benutzerprofil",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
@@ -1352,13 +1311,13 @@ public sealed class SetupWizardForm : Form
{
if (_cmbSystem.SelectedItem is not SonicSystemOption system)
{
ShowWarning("Bitte ein Sonic-System auswählen.");
ShowWarning("Bitte System wählen.");
return;
}
if (_cmbCredential.SelectedItem is not SonicCredentialProfile profile)
{
ShowWarning("Bitte ein Benutzerprofil auswählen.");
ShowWarning("Bitte Profil wählen.");
return;
}
@@ -1366,7 +1325,7 @@ public sealed class SetupWizardForm : Form
MessageBox.Show(
this,
"Auswahl gespeichert.",
"Gespeichert.",
"Einstellungen",
MessageBoxButtons.OK,
MessageBoxIcon.Information);