Improve notifications for GNOME 46
This commit is contained in:
@@ -201,12 +201,15 @@ class CartridgesApplication(Adw.Application):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
self.register()
|
self.register()
|
||||||
notification = Gio.Notification.new(_("Cartridges"))
|
|
||||||
notification.set_body(_("{} launched").format(name))
|
|
||||||
self.send_notification(
|
self.send_notification(
|
||||||
"launch",
|
"launch", Gio.Notification.new(_("{} launched").format(name))
|
||||||
notification,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Sleep for 6 seconds before withdrawing the notification
|
||||||
|
# The amount a notification stays up is ~5, so leave an extra second for the animation
|
||||||
|
GLib.usleep(6000000)
|
||||||
|
self.withdraw_notification("launch")
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user