From 2ff5b0b3cc402ceb639cd4cfc129ae34fd095140 Mon Sep 17 00:00:00 2001 From: halo Date: Sun, 27 Oct 2024 08:49:15 +0100 Subject: [PATCH] Inline auto-connect menu item Removes the dedicated "Always auto connect" menu item and replaces it with "Always Connect Example". This is more consistent with the menu items "Connect Example" and it also saves space. --- VPNStatus/AppDelegate.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/VPNStatus/AppDelegate.m b/VPNStatus/AppDelegate.m index eeb204b..6e9f396 100644 --- a/VPNStatus/AppDelegate.m +++ b/VPNStatus/AppDelegate.m @@ -226,12 +226,7 @@ -(void)refreshMenu [menu addItem:[NSMenuItem separatorItem]]; } - [menu addItem:[[NSMenuItem alloc] initWithTitle:neService.name action:nil keyEquivalent:@""]]; - - // Update the information - [menu addItem:[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ (%@)", [neService serverAddress], [neService protocol]] action:nil keyEquivalent:@""]]; - - NSMenuItem *alwaysAutoConnectMenuItem = [[NSMenuItem alloc] initWithTitle:@"Always auto connect" action:@selector(alwaysAutoConnect:) keyEquivalent:@""]; + NSMenuItem *alwaysAutoConnectMenuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Always Connect %@", neService.name] action:@selector(alwaysAutoConnect:) keyEquivalent:@""]; [alwaysAutoConnectMenuItem setTag:neServiceIndex]; NSArray*alwaysConnectedServices = [[ACPreferences sharedPreferences] alwaysConnectedServicesIdentifiers]; if([alwaysConnectedServices containsObject:[neService.configuration.identifier UUIDString]]) @@ -244,6 +239,10 @@ -(void)refreshMenu } [menu addItem:alwaysAutoConnectMenuItem]; + + // Update the information + [menu addItem:[[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ (%@)", [neService serverAddress], [neService protocol]] action:nil keyEquivalent:@""]]; + neServiceIndex++; }