diff --git a/src/StarfaceOutlookSync/UI/MainForm.cs b/src/StarfaceOutlookSync/UI/MainForm.cs index 15778e24..86e36c55 100644 --- a/src/StarfaceOutlookSync/UI/MainForm.cs +++ b/src/StarfaceOutlookSync/UI/MainForm.cs @@ -124,10 +124,26 @@ namespace StarfaceOutlookSync.UI private void SetupTrayIcon() { _trayMenu = new ContextMenuStrip(); + + _trayIcon = new NotifyIcon + { + Text = "Starface Kontakt-Sync", + Icon = SystemIcons.Application, + ContextMenuStrip = _trayMenu, + Visible = true + }; + + _trayIcon.DoubleClick += (s, e) => ShowMainWindow(); + + UpdateTrayMenu(); + } + + private void UpdateTrayMenu() + { + _trayMenu.Items.Clear(); _trayMenu.Items.Add("Oeffnen", null, (s, e) => ShowMainWindow()); _trayMenu.Items.Add("-"); - // Schnell-Sync fuer jedes Profil var profiles = _profileManager.GetProfiles(); foreach (var p in profiles.Where(p => p.Enabled)) { @@ -142,16 +158,6 @@ namespace StarfaceOutlookSync.UI _trayMenu.Items.Add("-"); _trayMenu.Items.Add("Beenden", null, (s, e) => ExitApplication()); - - _trayIcon = new NotifyIcon - { - Text = "Starface Kontakt-Sync", - Icon = SystemIcons.Application, // Placeholder, wird durch eigenes Icon ersetzt - ContextMenuStrip = _trayMenu, - Visible = true - }; - - _trayIcon.DoubleClick += (s, e) => ShowMainWindow(); } private void SetupAutoSync() @@ -219,7 +225,7 @@ namespace StarfaceOutlookSync.UI } // Tray-Menu aktualisieren - SetupTrayIcon(); + UpdateTrayMenu(); } private void NewProfile()