Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plugin installer][needs-docs] Display notifications as an icon rather than a text #5952

Merged
merged 4 commits into from Dec 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions images/themes/default/pluginNew.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/themes/default/pluginUpgrade.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions python/pyplugin_installer/installer.py
Expand Up @@ -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():
Expand Down 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 = "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
Expand Down