Skip to content
Snippets Groups Projects

QDS-12001 Downloads can be safely interrupted now

Merged Burak Hançerli requested to merge QDS-12001/interrupt-downloads into master
7 files
+ 61
32
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 42
30
@@ -170,37 +170,43 @@ void Backend::initDesignStudioConnector()
@@ -170,37 +170,43 @@ void Backend::initDesignStudioConnector()
updatePopup("Receiving project...");
updatePopup("Receiving project...");
});
});
connect(m_designStudioConnector.data(),
connect(
&DesignStudioConnector::projectReceived,
m_designStudioConnector.data(),
this,
&DesignStudioConnector::projectReceived,
[this](const QByteArray &projectData) {
this,
qDebug() << "Project received from Design Studio";
[this](const QByteArray &projectData) {
initializeProjectManager();
qDebug() << "Project received from Design Studio";
emit popupOpen();
initializeProjectManager();
updatePopup("Unpacking project...");
emit popupOpen();
qDebug() << "Project data size: " << projectData.size();
updatePopup("Unpacking project...");
const QString projectPath = m_projectManager->unpackProject(projectData);
qDebug() << "Project data size: " << projectData.size();
const QString projectPath = m_projectManager->unpackProject(projectData);
if (projectPath.isEmpty()) {
qCritical() << "Could not unpack project. Please check the logs for more "
if (projectPath.isEmpty()) {
"information.";
qCritical() << "Could not unpack project. Please check the logs for more "
emit popupClose();
"information.";
return;
}
qDebug() << "Project unpacked to " << projectPath;
updatePopup("Running project...");
if (!m_projectManager->runProject(projectPath)) {
qCritical() << "Could not run project. Please check the logs for more "
"information.";
} else {
m_projectManager->showAppWindow();
}
emit popupClose();
emit popupClose();
m_designStudioConnector->sendProjectReceived();
return;
});
}
 
 
qDebug() << "Project unpacked to " << projectPath;
 
updatePopup("Running project...");
 
 
qDebug() << "Project received confirmation sent to Design Studio";
 
if (!m_projectManager->runProject(projectPath)) {
 
qCritical() << "Could not run project. Please check the logs for more "
 
"information.";
 
} else {
 
m_projectManager->showAppWindow();
 
}
 
 
QMetaObject::invokeMethod(m_designStudioConnector.data(),
 
"sendProjectReceived",
 
Qt::QueuedConnection);
 
 
emit popupClose();
 
},
 
Qt::QueuedConnection);
qDebug() << "Design Studio Connector is initialized";
qDebug() << "Design Studio Connector is initialized";
}
}
@@ -429,3 +435,9 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
@@ -429,3 +435,9 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
qWarning() << "Unknown QR code data: " << urlData;
qWarning() << "Unknown QR code data: " << urlData;
}
}
}
}
 
 
void Backend::popupInterrupted()
 
{
 
qDebug() << "Popup closed prematurely. Interrupting active downloads (if any)";
 
QMetaObject::invokeMethod(&m_serviceConnector, "interrupted", Qt::QueuedConnection);
 
}
Loading