Skip to content

Commit

Permalink
Remove Launch At Startup feature temporarly, and explain how to do it…
Browse files Browse the repository at this point in the history
… manually
  • Loading branch information
AnthoPakPak committed Jan 8, 2019
1 parent 40727b2 commit 7cb8b96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion FastFinder/Helper/UserSettingsHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ +(UserSettingsHelper*)getInstance {
}

-(void) setDefaultsSettings {
self.launchOnStartup = YES;
self.launchOnStartup = NO; //should be YES but currently feature isn't working so I disable it
self.animated = YES;
self.animationVelocity = 0.4;
}
Expand All @@ -48,6 +48,7 @@ -(void) setLaunchOnStartup:(BOOL)launchOnStartup {
_launchOnStartup = launchOnStartup;
[[NSUserDefaults standardUserDefaults] setBool:launchOnStartup forKey:kSettingsLaunchOnStartup];

//has to be fixed with : https://theswiftdev.com/2017/10/27/how-to-launch-a-macos-app-at-login/ . for now, please add it manually to login items in System Preferences
SMLoginItemSetEnabled ((__bridge CFStringRef)@"com.acocagne.FastFinder", launchOnStartup); // NO to cancel launch at login
}
}
Expand Down
10 changes: 9 additions & 1 deletion FastFinder/ViewController/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ -(void) restoreSettingsStates {
- (IBAction)didChangeLaunchOnStartup:(NSButton*)button {
NSLog(@"Setting launchOnStartup to %ld", (long)button.state);

[UserSettingsHelper getInstance].launchOnStartup = button.state;
//[UserSettingsHelper getInstance].launchOnStartup = button.state;

NSAlert *alert = [NSAlert new];
[alert setMessageText:@"⚠️ Feature not available currently"];
[alert setInformativeText:@"Sorry, launch at startup isn't supported for now.\n\nFor now, please do it manually by going to System Preferences > Users and groups > Login Items and adding FastFinder there.\n\nThe feature will be available when I'll have time to implement it, or if you have some free time, feel free to make a PR on https://github.com/AnthoPakPak/FastFinder 😉"];
[alert addButtonWithTitle:@"OK"];
[alert runModal];

button.state = NSControlStateValueOff;
}

- (IBAction)didChangeAnimated:(NSButton*)button {
Expand Down

0 comments on commit 7cb8b96

Please sign in to comment.