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

Rewrite NotificationsMonitor #266

Merged
merged 6 commits into from
Aug 29, 2023
Merged

Rewrite NotificationsMonitor #266

merged 6 commits into from
Aug 29, 2023

Conversation

Marukesu
Copy link
Contributor

@Marukesu Marukesu commented Jul 28, 2023

Cleanup the class and make the filter simple.

Depends on elementary/notifications#211.
Closes #9.

Signed-off-by: Gustavo Marques <[email protected]>
@Marukesu Marukesu requested a review from a team July 28, 2023 20:16
GLib.DBusProxy cannot be used to emit signals in the bus.

Signed-off-by: Gustavo Marques <[email protected]>
the [SingleInstance] attribute deal with making the class a singleton
and forcing a unique instance is created and referenced everytime the
constructor method is called, sealed mark the class as non-derivable.

while here fix the class name to match the file name.

Signed-off-by: Gustavo Marques <[email protected]>
rather than calling initialize() in the construct block
make it public and let the Indicator decides when to initalize
the monitor.

Signed-off-by: Gustavo Marques <[email protected]>
use a generic match for method calls and signal emissions for the
org.freedesktop.Notifications interface, restrict the method_return
and error ones to the org.freedesktop.Notifications name.

Signed-off-by: Gustavo Marques <[email protected]>
rewrite the switch statement to check member_name instead of message_type, this
allow to mege the CloseNotification and NotificationClosed cases. the case of
the notify call beeing successfull or not is also merged.

the monitor signals are now emitted before the next Gtk redraw cycle, making
sure that the tray got updated in the current cycle.

Signed-off-by: Gustavo Marques <[email protected]>
Copy link

@zeebok zeebok left a comment

Choose a reason for hiding this comment

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

I think this looks good from what I understand of how this works. I am not totally sure how to best test this. if you want me to let me know but I trust you enough with this that I am fine with you merging.

@danirabbit
Copy link
Member

This is also working for me and I can confirm replaces are working. Nice work! Way to save 100 lines as well, very cool diff

@danirabbit danirabbit merged commit 40545f6 into master Aug 29, 2023
4 checks passed
@danirabbit danirabbit deleted the maru/notifications-monitor branch August 29, 2023 19:56
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.

Replacing a bubble gives two notification entries
3 participants