Log what changed; add notification on/off settings

Protokoll:
- SyncResult.Changes erfasst jede tatsaechliche Aenderung (erstellt/aktualisiert/
  geloescht/verknuepft/zusammengefuehrt je Kontakt) per Action()-Helfer.
- Beide Sync-Pfade (Auto/Tray via RunSync UND manueller Sync via
  SyncProgressForm) schreiben Start, Ergebnis, Aenderungen, Konflikte und Fehler
  ins persistente Protokoll.

Benachrichtigungen:
- UserSettings: NotificationsEnabled (allgemein) + NotifyWarningsErrors
  (Konflikte/Fehler), beide in der Einstellungen-Maske als Haken.
- MainForm.Balloon() zeigt Tray-Meldungen nur, wenn der passende Haken aktiv
  ist; Zusammenfassung gilt als Warnung, wenn Fehler/Konflikte auftraten.
- Protokoll wird unabhaengig von den Benachrichtigungs-Einstellungen geschrieben.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 13:35:55 +02:00
parent 96c34e542f
commit 75c0c1126e
7 changed files with 113 additions and 35 deletions
+25 -7
View File
@@ -7,6 +7,7 @@ namespace StarfaceOutlookSync.UI
public class SettingsForm : Form
{
private CheckBox _chkStartMinimized, _chkSyncOnStart, _chkAutoAcceptOutlook;
private CheckBox _chkNotifGeneral, _chkNotifWarn;
private TextBox _txtSharedDir;
private Button _btnBrowseShared;
private Button _btnSave, _btnCancel;
@@ -61,21 +62,35 @@ namespace StarfaceOutlookSync.UI
Font = new Font("Segoe UI", 8)
};
_chkNotifGeneral = new CheckBox
{
Text = "Tray-Benachrichtigungen (allgemein)",
Left = 20, Top = 144, AutoSize = true,
Checked = _settings.NotificationsEnabled
};
_chkNotifWarn = new CheckBox
{
Text = "Benachrichtigungen bei Warnungen/Fehlern (Konflikte, Fehler)",
Left = 20, Top = 170, AutoSize = true,
Checked = _settings.NotifyWarningsErrors
};
var lblShared = new Label
{
Text = "Gemeinsames Verzeichnis fuer Sync-Sperre (Mehrplatz, optional):",
Left = 20, Top = 150, AutoSize = true
Left = 20, Top = 206, AutoSize = true
};
_txtSharedDir = new TextBox
{
Left = 20, Top = 172, Width = 250,
Left = 20, Top = 228, Width = 250,
Text = _settings.SharedDirectory
};
_btnBrowseShared = new Button
{
Text = "...", Left = 274, Top = 171, Width = 36, Height = 24
Text = "...", Left = 274, Top = 227, Width = 36, Height = 24
};
_btnBrowseShared.Click += (s, e) => BrowseSharedDir();
@@ -83,25 +98,26 @@ namespace StarfaceOutlookSync.UI
{
Text = "Netzlaufwerk/UNC, das alle Arbeitsplaetze erreichen. Leer = keine\n" +
"clientuebergreifende Sperre (nur Schutz auf diesem PC).",
Left = 20, Top = 198, Width = 330, Height = 32,
Left = 20, Top = 254, Width = 330, Height = 32,
ForeColor = Color.Gray, Font = new Font("Segoe UI", 8)
};
_btnSave = new Button
{
Text = "Speichern", Left = 95, Top = 240, Width = 85, Height = 28,
Text = "Speichern", Left = 95, Top = 300, Width = 85, Height = 28,
DialogResult = DialogResult.None
};
_btnSave.Click += (s, e) => Save();
_btnCancel = new Button
{
Text = "Abbrechen", Left = 189, Top = 240, Width = 85, Height = 28,
Text = "Abbrechen", Left = 189, Top = 300, Width = 85, Height = 28,
DialogResult = DialogResult.Cancel
};
Size = new Size(380, 330);
Size = new Size(380, 390);
Controls.AddRange(new Control[] { _chkStartMinimized, _chkSyncOnStart, _chkAutoAcceptOutlook, lblHint,
_chkNotifGeneral, _chkNotifWarn,
lblShared, _txtSharedDir, _btnBrowseShared, lblSharedHint, _btnSave, _btnCancel });
AcceptButton = _btnSave;
CancelButton = _btnCancel;
@@ -126,6 +142,8 @@ namespace StarfaceOutlookSync.UI
_settings.StartMinimized = _chkStartMinimized.Checked;
_settings.SyncOnStart = _chkSyncOnStart.Checked;
_settings.AutoAcceptOutlookPrompt = _chkAutoAcceptOutlook.Checked;
_settings.NotificationsEnabled = _chkNotifGeneral.Checked;
_settings.NotifyWarningsErrors = _chkNotifWarn.Checked;
_settings.SharedDirectory = _txtSharedDir.Text.Trim();
_settings.Save();
DialogResult = DialogResult.OK;