forked from qt-creator/qt-creator
QmlDesigner: Allow user to download multiple textures at once
Task-number: QDS-9224 Change-Id: Ia1ec8f8b0951e8dd31d47f64509d39137cdeaa41 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -147,9 +147,6 @@ Item {
|
||||
if (root.downloadState !== "" && root.downloadState !== "failed")
|
||||
return
|
||||
|
||||
if (!ContentLibraryBackend.rootView.markTextureDownloading())
|
||||
return
|
||||
|
||||
progressBar.visible = true
|
||||
tooltip.visible = false
|
||||
root.progressText = qsTr("Downloading...")
|
||||
@@ -223,14 +220,10 @@ Item {
|
||||
root.progressValue = 0
|
||||
|
||||
root.downloadState = ""
|
||||
|
||||
ContentLibraryBackend.rootView.markNoTextureDownloading()
|
||||
}
|
||||
|
||||
onDownloadFailed: {
|
||||
root.downloadState = "failed"
|
||||
|
||||
ContentLibraryBackend.rootView.markNoTextureDownloading()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,8 +237,6 @@ Item {
|
||||
onFinishedChanged: {
|
||||
modelData.setDownloaded()
|
||||
root.downloadState = modelData.isDownloaded() ? "downloaded" : "failed"
|
||||
|
||||
ContentLibraryBackend.rootView.markNoTextureDownloading()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,18 +436,4 @@ QPointer<ContentLibraryTexturesModel> ContentLibraryWidget::environmentsModel()
|
||||
return m_environmentsModel;
|
||||
}
|
||||
|
||||
bool ContentLibraryWidget::markTextureDownloading()
|
||||
{
|
||||
if (m_anyTextureBeingDownloaded)
|
||||
return false;
|
||||
|
||||
m_anyTextureBeingDownloaded = true;
|
||||
return true; // let the caller know it can begin download
|
||||
}
|
||||
|
||||
void ContentLibraryWidget::markNoTextureDownloading()
|
||||
{
|
||||
m_anyTextureBeingDownloaded = false; // allow other textures to be downloaded
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -61,8 +61,6 @@ public:
|
||||
Q_INVOKABLE void addTexture(QmlDesigner::ContentLibraryTexture *tex);
|
||||
Q_INVOKABLE void addLightProbe(QmlDesigner::ContentLibraryTexture *tex);
|
||||
Q_INVOKABLE void updateSceneEnvState();
|
||||
Q_INVOKABLE bool markTextureDownloading();
|
||||
Q_INVOKABLE void markNoTextureDownloading();
|
||||
|
||||
signals:
|
||||
void bundleMaterialDragStarted(QmlDesigner::ContentLibraryMaterial *bundleMat);
|
||||
@@ -102,7 +100,6 @@ private:
|
||||
bool m_hasMaterialLibrary = false;
|
||||
bool m_hasQuick3DImport = false;
|
||||
bool m_isDragging = false;
|
||||
bool m_anyTextureBeingDownloaded = false;
|
||||
QString m_baseUrl;
|
||||
QString m_texturesUrl;
|
||||
QString m_environmentsUrl;
|
||||
|
||||
Reference in New Issue
Block a user