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

Ask to receive distributed notifications immediately, and an easier way to get into the preferences #9

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion Spotify Notifications/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification{
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(eventOccured:)
name:@"com.spotify.client.PlaybackStateChanged"
object:nil];
object:nil
suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];

[self setIcon];

Expand Down Expand Up @@ -84,6 +85,16 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification{

}

- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag{
if (!flag) {
// This makes it so you can open the preferences by reopning the app
// This way you can get to the preferences even when the status item is hidden
[self showPrefences:nil];
}

return YES;
}

- (IBAction)showSource:(id)sender{
[[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString:@"http://github.com/citruspi/Spotify-Notifications"]];
}
Expand Down