-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Simplify Raven notification group #452
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built-in theme needs a style update to coincide with this, the new notification items look off with the existing styling.
@serebit Could you clarify what styling changes you are referring to?
It looks identical to me, but I do need to get my eyes checked sooooo. |
This does a couple things. First, when constructing a notification group, just get the image directly from our Notification object. We did all the work to get the correct image, let's actually use it. Secondly, remove our HashTable mapping application name to notification group. We don't need it; anything it was used for we can get from the ListBox. This avoids having to keep track of groups in multiple data structures (the table and the list box). This makes the code easier to maintain, and slightly more memory effecient. Lastly, switch to `ngettext` to build the text for the notification view header instead of an if/elseif chain. Fixes #450 Signed-off-by: Evan Maddock <[email protected]>
…and fix notification counting Signed-off-by: Evan Maddock <[email protected]>
- rename app_icon to notification_icon since it is not necessarily the one for the app - implemented an app_image that will be prefered over image (from notification not app) for Raven. notification popups will use one or the other depending on what is provided. - broken notification grouping as it was assuming an app_name which can technically be empty when the application only supplies a desktop-entry for app info. use notification's app name otherwise try with the app id. - missing application name when application only supplies desktop-entry - incorrect image for some applications such as discord. it would use the Discord message sender's avatar rather than discord icon - spotify reports as com.spotify.Client and not Spotify nowadays, so added that to list of spam-apps to prevent Raven noise - missing printf on ngettext for header resulting in number not being added - missing use_markup on notification title resulting in ampersands not being parsed. noticable in song titles on spotify where many use & instead of "feat."
850dbac
to
bad102c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Description
This does a couple of things. First, when constructing a notification group, just get the image directly from our Notification object. We did all the work to get the correct image, let's actually use it.
Secondly, remove our HashTable mapping application name to notification group. We don't need it; anything it was used for we can get from the ListBox. This avoids having to keep track of groups in multiple data structures (the table and the list box). This makes the code easier to maintain, and slightly more memory efficient.
The NotificationGroup widget has been changed to a
Gtk.ListBoxRow
to make it easier to find and remove groups from the view.Lastly, switch to
ngettext
to build the text for the notification view header instead of an if/elseif chain.Fixes #450
Submitter Checklist
git rebase -i
(if needed)