Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline "Auto Connect" menu item #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions VPNStatus/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString *>*alwaysConnectedServices = [[ACPreferences sharedPreferences] alwaysConnectedServicesIdentifiers];
if([alwaysConnectedServices containsObject:[neService.configuration.identifier UUIDString]])
Expand All @@ -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++;
}

Expand Down