Skip to content

Commit

Permalink
Check if we actually managed to toggle AMFI before changing the image…
Browse files Browse the repository at this point in the history
We don't want to give a bad impression...
  • Loading branch information
npyl committed Nov 30, 2018
1 parent 956c32d commit 4c22e3e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions mySIMBL/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -839,13 +839,21 @@ - (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)pr

- (IBAction)toggleAMFI:(id)sender {
SIMBLManager *sim_m = [SIMBLManager sharedInstance];
BOOL amfiStatus = [sim_m AMFI_enabled];

[sim_m AMFI_toggle];

NSImage *on = [NSImage imageNamed:NSImageNameStatusAvailable];
NSImage *off = [NSImage imageNamed:NSImageNameStatusUnavailable];
if (_AMFIStatus.image == on)
[_AMFIStatus setImage:off];
else
[_AMFIStatus setImage:on];

/* if actually toggled, change image */
if (!amfiStatus)
{
if (_AMFIStatus.image == on)
[_AMFIStatus setImage:off];
else
[_AMFIStatus setImage:on];
}
}

- (void)setupSIMBLview {

0 comments on commit 4c22e3e

Please sign in to comment.