Show result message after installing / upgrading plugin with the browser

CURA-3856
This commit is contained in:
Jaime van Kessel 2017-06-23 13:51:13 +02:00
parent 867dd04681
commit 37162683e5

View file

@ -100,13 +100,14 @@ class PluginBrowser(QObject, Extension):
self._download_plugin_reply.downloadProgress.disconnect(self._onDownloadPluginProgress)
self._temp_plugin_file = tempfile.NamedTemporaryFile(suffix = ".curaplugin")
self._temp_plugin_file.write(self._download_plugin_reply.readAll())
result = PluginRegistry.getInstance().installPlugin("file://" + self._temp_plugin_file.name)
if result["status"] == "ok":
self._newly_installed_plugin_ids.append(result["id"])
self.pluginsMetadataChanged.emit()
else:
# TODO; Handle cases where, for some reason, we could not install the plugin
pass
self._newly_installed_plugin_ids.append(result["id"])
self.pluginsMetadataChanged.emit()
Application.getInstance().messageBox(i18n_catalog.i18nc("@window:title", "Plugin browser"), result["message"])
self._temp_plugin_file.close() # Plugin was installed, delete temp file
@pyqtProperty(int, notify = onDownloadProgressChanged)