Skip to content
Permalink
Browse files

Merge pull request #5952 from borysiasty/plugin-notification

[Plugin installer][needs-docs] Display notifications as an icon rather than a text
  • Loading branch information
borysiasty committed Dec 28, 2017
2 parents a650a03 + 671b772 commit 4783af674ef5792f87ee61c917913eb69119b452
@@ -458,6 +458,8 @@
<file>themes/default/pin.svg</file>
<file>themes/default/pluginExperimental.png</file>
<file>themes/default/pluginDeprecated.png</file>
<file>themes/default/pluginNew.svg</file>
<file>themes/default/pluginUpgrade.svg</file>
<file>themes/default/propertyicons/action.svg</file>
<file>themes/default/propertyicons/attributes.png</file>
<file>themes/default/propertyicons/CRS.svg</file>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M9.47 3.913a2.5 2.5 0 0 0-2.5 2.5c0 .36.364.69.5 1h-5v5c.31-.137.64-.5 1-.5a2.5 2.5 0 1 1 0 5c-.36 0-.69-.364-1-.5v5h14v-5c.31.136.64.5 1 .5a2.5 2.5 0 1 0 0-5c-.36 0-.69.363-1 .5v-5h-5c.137-.31.5-.64.5-1a2.5 2.5 0 0 0-2.5-2.5z" overflow="visible" fill="#afafaf" stroke="#3c3c3c" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.47 10.413v-2h3" overflow="visible" fill="#afafaf" stroke="#fff" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.47 20.413v-2m8-10h3" overflow="visible" fill="#e8e8e8" stroke="#fff" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/><path overflow="visible" d="M18.864 10.614l-2.358-2.688-3.552.42 1.828-3.075-1.497-3.248 3.489.788L19.4.384l.329 3.56 3.12 1.749-3.287 1.414z" fill="#fafafa" stroke="#3c3c3c" stroke-width=".75" stroke-linecap="round" stroke-linejoin="round"/></svg>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M17.5 7.5c3-3 5 0 5 3v-5c0-2-3-2-5-1v3z" stroke-linejoin="round" stroke-linecap="round" stroke-width=".75" stroke="#3c3c3c" fill="#cdcdcd"/><path d="M8.5 3A2.5 2.5 0 0 0 6 5.5c0 .36.363.69.5 1h-5v5c.31-.137.64-.5 1-.5a2.5 2.5 0 1 1 0 5c-.36 0-.69-.363-1-.5v5h14v-5c.31.137.64.5 1 .5a2.5 2.5 0 1 0 0-5c-.36 0-.69.363-1 .5v-5h-5c.137-.31.5-.64.5-1A2.5 2.5 0 0 0 8.5 3z" overflow="visible" stroke-linejoin="round" stroke-linecap="round" stroke-width=".75" stroke="#3c3c3c" fill="#afafaf"/><path d="M2.5 9.5v-2h3" overflow="visible" stroke-linejoin="round" stroke-linecap="round" stroke-width=".75" stroke="#fff" fill="#afafaf"/><path d="M2.5 19.5v-2m8-10h3" overflow="visible" stroke-linejoin="round" stroke-linecap="round" stroke-width=".75" stroke="#fff" fill="#dcdcdc"/><path d="M22.5 11.5c-.91 4.526-4.508 5.134-9 5v3l-7-6 7-6v3c3.716.064 8.055.517 9-4v5z" stroke-linejoin="round" stroke-linecap="round" stroke-width=".75" stroke="#3c3c3c" fill="#ebebeb"/></svg>
@@ -71,8 +71,8 @@ def __init__(self):

if repositories.checkingOnStart() and repositories.timeForChecking() and repositories.allEnabled():
# start fetching repositories
self.statusLabel = QLabel(self.tr("Looking for new plugins...") + " ", iface.mainWindow().statusBar())
iface.mainWindow().statusBar().insertPermanentWidget(0, self.statusLabel)
self.statusLabel = QLabel(iface.mainWindow().statusBar())
iface.mainWindow().statusBar().addPermanentWidget(self.statusLabel)
self.statusLabel.linkActivated.connect(self.showPluginManagerWhenReady)
repositories.checkingDone.connect(self.checkingDone)
for key in repositories.allEnabled():
@@ -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 = "pluginNew.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 = "pluginUpgrade.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/%s"></a>' % (tabIndex, icon))
self.statusLabel.setToolTip(status)
else:
iface.mainWindow().statusBar().removeWidget(self.statusLabel)
self.statusLabel = None

0 comments on commit 4783af6

Please sign in to comment.
You can’t perform that action at this time.