mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Add a way to cancel a download
and cancel download when closing the window
This commit is contained in:
parent
6b05bd21fb
commit
6503b87a3a
2 changed files with 49 additions and 4 deletions
|
@ -141,6 +141,17 @@ class PluginBrowser(QObject, Extension):
|
|||
self.setIsDownloading(True)
|
||||
self._download_plugin_reply.downloadProgress.connect(self._onDownloadPluginProgress)
|
||||
|
||||
@pyqtSlot()
|
||||
def cancelDownload(self):
|
||||
Logger.log("i", "user cancelled the download of a plugin")
|
||||
self._download_plugin_reply.abort()
|
||||
self._download_plugin_reply.downloadProgress.disconnect(self._onDownloadPluginProgress)
|
||||
self._download_plugin_reply = None
|
||||
self._download_plugin_request = None
|
||||
|
||||
self.setDownloadProgress(0)
|
||||
self.setIsDownloading(False)
|
||||
|
||||
@pyqtProperty(QObject, notify=pluginsMetadataChanged)
|
||||
def pluginsModel(self):
|
||||
if self._plugins_model is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue