From e4000b197969bfd11ce41ba93752da6e2dcbb5a7 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 1 Oct 2019 11:06:54 -0300 Subject: [PATCH] update notifications by type only when several types are among the updates --- CHANGELOG.md | 2 +- bauh/view/qt/systray.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d9b174..b698f512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.6.2] 2019-09- ### Improvements -- Update notifications showing the number of updates by type as well +- Update notifications showing the number of updates by type as well ( if there are from more than one packaging type ) - AUR: - Installed files available in the Info window - Improving Arch distro checking diff --git a/bauh/view/qt/systray.py b/bauh/view/qt/systray.py index a3c6ce91..f2d90bc7 100755 --- a/bauh/view/qt/systray.py +++ b/bauh/view/qt/systray.py @@ -108,8 +108,9 @@ class TrayIcon(QSystemTrayIcon): msg = StringIO() msg.write(self.i18n['notification.update{}'.format('' if n_updates == 1 else 's')].format(n_updates)) - for ptype, count in ups_by_type.items(): - msg.write('\n * {} ( {} )'.format(ptype.capitalize(), count)) + if len(ups_by_type) > 1: + for ptype, count in ups_by_type.items(): + msg.write('\n * {} ( {} )'.format(ptype.capitalize(), count)) msg.seek(0) msg = msg.read()