Solus promptly pops up a notification every time new software updates are available. This is a great future, but the "Open Software Center" button inside the notification doesn't work, no matter how many times I click on it, so I have to open the Software Center manually.
Description
Event Timeline
I have also noticed when I open Software Centre and manually check for updates and some are available, a notification is shown even though the updates list is visible.
While that may be a minor irritations, it's not a bug. The update checker is a separate process, which is independent of the Software Center.
Software Centre not updating when clicking the button "Open Software Centre" button in the pop-up is surely a bug though :) It's the same on my machine, clicking the button does nothing.
@DataDrake : From a usability point of view it is a bug: if there is a button "Open Software Center" in the notification, it should open it. Also from a technical point of view, I don't understand it either: even if the update checker and the software center are independent processes, in all cases the button should open the Software center just like when the user clicks on the Software center icon (regardless if there are updates or not).
Apologies. I was responding to @mate-user 's comment about the notification firing off even though SC was open.
Actually, there isn't a mainloop, neither Gtk nor GLib.
For a notification to actually "fire" callbacks, you'll need a mainloop. Could be solved by adding
GLib.MainLoop().run()
after 314
self.notification.show()
Not sure if that's the "ikey" way to solve it, but it works ;-).
Does this break the GApplication integration? like will it still quit when told, retain single instance, etc.
quick&dirty example on mainloop + mainloop quit (should give you a better idea)
Yes, it retains single instance etc, does not break GApplication integration to my knowledge.
You'll want to get the MainLoop() into a variable though, and you'll want to quit it to avoid "hanging" in the background ;-). It will block until the Popen is through though (not when SC quits, but when the command was actually fired by Popen).
(time import is unnecessary, was for quick&dirty testing)
On a 2nd thought, we need a timeout callback because otherwise if the user does not click, we'll run into the issue that we're blocking solus_update.
<removed> test+patch
[edit] I can not test if it actually would close GApplication main loop, even if I don't think so, I'll need a package update to know for sure :D. I didn't find a way to simulate that though.
Thanks to the update in the repos, I could do a real world test, and it showed that there's just a one-line issue:
~/solus/solus-sc $ ./solus-update-checker
TypeError: action_show_updates() takes exactly 4 arguments (3 given)
The issue:
self.notification.add_action("open-sc", _("Open Software Center"),
self.action_show_updates)The solution:
self.notification.add_action("open-sc", _("Open Software Center"),
self.action_show_updates, None)Resolved in unstable as of https://git.solus-project.com/packages/solus-sc/commit/?id=e520ec78cfc613ddc91d270893f681cafdb7434a
Thanks @STiAT for the patch, much appreciated!