Skip to content

Notification Center #2104

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

Closed
wants to merge 14 commits into from
Closed

Notification Center #2104

wants to merge 14 commits into from

Conversation

skurfer
Copy link
Member

@skurfer skurfer commented Sep 18, 2015

As described in #1859, this replaces pop-up alerts with Notification Center notifications where appropriate.

I did not convert:

  • older messages that are unlikely to be shown
  • messages that really should interrupt the user or result from explicit user actions
  • messages that are too long to fit in a notification (like those that display localizedDescription)

All subjective, of course, so let me know if I didn’t go far enough (or went too far).

As part of this, I switched the default notification style for the entire application to “alert”. This is necessary to get the action buttons, but it’s probably not appropriate for the places we were previously using Notification Center (where you’d use Growl or the built-in notifier) because now they all have action buttons and require manual dismissal. I don’t see a way around it, so I’m inclined to change the default for those back to the built-in notifier.

Also, all the strings are localized now (as in available to translators but not actually translated), which is an improvement.

This also does the same thing as #2096. You wanted to know if my “interesting” project was small, Paddy? Let’s ask instead if it’s worth it. 😬

fixes #1859
fixes #1669

@tiennou
Copy link
Member

tiennou commented Sep 18, 2015

Here's my take on that : https://github.com/quicksilver/Quicksilver/tree/t/notification-rewrite

It planned to 1) kill deprecated stuff 2) handle OS X versions that don't have Notification Center (but we might be way after that actually) 3) hide the modal/notification choice 4) profit. I think the actual Notification Center thing is actually in a stash somewhere, but if that inspires you...

The only thing I don't like (but that's an "Apple API problem") is how you can't use blocks to handle notification replies and have to go through delegation. So you litter code everywhere.

Also, indentation ;-).

@skurfer
Copy link
Member Author

skurfer commented Sep 25, 2015

Here's my take on that : https://github.com/quicksilver/Quicksilver/tree/t/notification-rewrite

Cool. Want me to merge that into this branch?

The only thing I don't like (but that's an "Apple API problem") is how you can't use blocks to handle notification replies and have to go through delegation. So you litter code everywhere.

Agreed. I tried to have just one class be the delegate to keep it contained, but that’s messy, too.

Also, indentation ;-).

Yeah, OK. Should I do anything about that for this pull? FWIW, I changed my Xcode settings (to tabs) a few days ago.

NSUserNotification *locationAlert = [[NSUserNotification alloc] init];
[locationAlert setIdentifier:QSLocationChangedUserNotification];
[locationAlert setTitle:NSLocalizedString(@"Running from a new location", nil)];
[locationAlert setInformativeText:NSLocalizedString(@"The previous version of Quicksilver was located in America. Would you like to move this new version to that location?", nil)];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

America ? Really ?? 😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! It's just Rob testing our code-review quality I guess :P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! Yeah, uh… I was testing. You passed.

Seriously, no idea what that’s about. Find/Replace gone wrong maybe?

@tiennou
Copy link
Member

tiennou commented Oct 30, 2015

Note, I'm currently working on that one. I'm not fond of the hardcoded delegate stuff, so I'm moving the notification-managing to QSAlertManager, so we can use blocks elsewhere and get a nice "modal" alert if we're frontmost.

@tiennou tiennou mentioned this pull request Oct 30, 2015
As it is not a physical object, it's unlikely that Quicksilver was ever located in America. :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-implement confirmation dialogs using Notification Center Too many dialogs when an update is available.
3 participants