Skip to content

Commit

Permalink
[Plugin installer][needs-docs] Display an icon rather than a text in …
Browse files Browse the repository at this point in the history
…the status bar when new a plugin or plugin upgrade is available
  • Loading branch information
borysiasty committed Dec 26, 2017
1 parent 9fb386a commit 3a52412
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/pyplugin_installer/installer.py
Expand Up @@ -150,19 +150,23 @@ def checkingDone(self):
# look for news in the repositories
plugins.markNews()
status = ""
icon = ""
# first check for news
for key in plugins.all():
if plugins.all()[key]["status"] == "new":
status = self.tr("There is a new plugin available")
icon = "plugin-new.svg"
tabIndex = 4 # PLUGMAN_TAB_NEW
# then check for updates (and eventually overwrite status)
for key in plugins.all():
if plugins.all()[key]["status"] == "upgradeable":
status = self.tr("There is a plugin update available")
icon = "plugin-upgrade.svg"
tabIndex = 3 # PLUGMAN_TAB_UPGRADEABLE
# finally set the notify label
if status:
self.statusLabel.setText(u' <a href="%d">%s</a> ' % (tabIndex, status))
self.statusLabel.setText(u'<a href="%d"><img src="qrc:/images/themes/default/propertyicons/%s"></a>' % (tabIndex, icon))
self.statusLabel.setToolTip(status)
else:
iface.mainWindow().statusBar().removeWidget(self.statusLabel)
self.statusLabel = None
Expand Down

0 comments on commit 3a52412

Please sign in to comment.