Skip to content

Commit

Permalink
No updates are available if self.availableUpdates == 0 (systray conte…
Browse files Browse the repository at this point in the history
…xt menu)

partial fix to #535
  • Loading branch information
ppvnf authored Dec 28, 2022
1 parent 75329aa commit 4aa210b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wingetui/uiSections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def updatePackageNumber(self, showQueried: bool = False, foundResults: int = 0):
self.availableUpdates += 1
self.countLabel.setText(_("Available updates: {0}").format(self.availableUpdates))
globals.trayIcon.setToolTip("WingetUI" if self.availableUpdates == 0 else (_("WingetUI - 1 update is available") if self.availableUpdates == 1 else _("WingetUI - {0} updates are available").format(self.availableUpdates)) )
globals.trayMenuUpdatesList.menuAction().setText(_("{0} updates were found" if self.availableUpdates!=1 else "{0} update was found").format(self.availableUpdates))
globals.trayMenuUpdatesList.menuAction().setText("1 update was found" if self.availableUpdates == 1 else (_("No updates are available") if self.availableUpdates == 0 else _("{0} updates were found").format(self.availableUpdates)) )
if self.availableUpdates > 0:
self.packageList.label.hide()
self.packageList.label.setText("")
Expand Down

9 comments on commit 4aa210b

@panther7
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, that is better like:
0 = No updates are available
0 < Available updates: {0}

@marticliment @ppvnf

@ppvnf
Copy link
Contributor Author

@ppvnf ppvnf commented on 4aa210b Dec 30, 2022

Choose a reason for hiding this comment

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

I agree. I am still newbie. The correct way to change it would be
globals.trayMenuUpdatesList.menuAction().setText(_("No updates are available" if self.availableUpdates == 0 else "Available updates: {0}").format(self.availableUpdates)) ?
Also, @panther7 should create the commit to have the credit, right?

@panther7
Copy link
Contributor

Choose a reason for hiding this comment

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

Right 👍

@ppvnf
Copy link
Contributor Author

@ppvnf ppvnf commented on 4aa210b Dec 30, 2022

Choose a reason for hiding this comment

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

I've tested it and the only problem with this approach is that it will result in two buttons with almost the same name (not sure it matters tho):

Captura de tela 2022-12-29 224205

@ppvnf
Copy link
Contributor Author

@ppvnf ppvnf commented on 4aa210b Dec 30, 2022

Choose a reason for hiding this comment

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

Captura de tela 2022-12-29 224205

I believe "Available Updates" should be changed to Software Updates to match the main window

@panther7
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so Found updates: {0}? :)

@ppvnf
Copy link
Contributor Author

@ppvnf ppvnf commented on 4aa210b Dec 30, 2022

Choose a reason for hiding this comment

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

Ok, so Found updates: {0}? :)

Yes, that and/or changing "Available Updates" in the context menu to "Software Updates" (while still using Available updates: {0}) so it would match main window:

blacklist

@ppvnf
Copy link
Contributor Author

@ppvnf ppvnf commented on 4aa210b Dec 30, 2022

Choose a reason for hiding this comment

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

See #560

@marticliment
Copy link
Owner

Choose a reason for hiding this comment

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

Yes, way better

Please sign in to comment.