Skip to content
Snippets Groups Projects
Commit b5c1676f authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

QDS-11882 Add clear feedback when receiving a new project from the Design Studio

parent 426e9ac5
No related branches found
No related tags found
1 merge request!34QDS-11882 Add clear feedback when receiving a new project from the Design Studio
Pipeline #67004 passed
......@@ -288,9 +288,6 @@ void Backend::openCamera()
void Backend::initializeProjectManager()
{
if (m_projectManager)
return;
m_projectManager.reset(new ProjectManager(autoScaleProject()));
connect(m_projectManager.data(), &ProjectManager::closingProject, this, [&] {
emit popupClose();
......@@ -307,6 +304,13 @@ void Backend::initDesignStudioConnector()
this,
&Backend::networkUpdated);
connect(m_designStudioConnector.data(), &DesignStudioConnector::projectIncoming, this, [&] {
qDebug() << "Project incoming from Design Studio";
m_projectManager.reset();
emit popupOpen();
updatePopup("Receiving project...");
});
connect(m_designStudioConnector.data(),
&DesignStudioConnector::projectReceived,
this,
......@@ -336,6 +340,7 @@ void Backend::initDesignStudioConnector()
}
emit popupClose();
m_designStudioConnector->sendProjectReceived();
});
qDebug() << "Design Studio Connector is initialized";
......
......@@ -42,6 +42,7 @@ void DesignStudioConnector::receiveProject()
m_projectData.clear();
m_projectData.append(data);
m_receivingData = true;
emit projectIncoming();
} else if (m_receivingData) {
if (data.contains("::qmlrc-end::")) {
qDebug() << "TCP:: Received project end delimeter";
......@@ -111,3 +112,14 @@ void DesignStudioConnector::updateIpv4Addr()
emit networkStatusUpdated("\nLocal IP: " + m_ipv4Addr
+ "\nWaiting for Design Studio to connect...");
}
void DesignStudioConnector::sendProjectReceived()
{
if (!m_tcpSocket) {
qDebug() << "TCP:: Socket is not connected";
return;
}
m_tcpSocket->write("::qmlrc-received::");
m_tcpSocket->flush();
}
......@@ -38,6 +38,8 @@ class DesignStudioConnector : public QObject
public:
explicit DesignStudioConnector(QObject *parent = nullptr);
void sendProjectReceived();
private:
// Tcp connection members
QTcpServer m_tcpServer;
......@@ -60,6 +62,7 @@ private:
signals:
void networkStatusUpdated(QString);
void projectReceived(QByteArray);
void projectIncoming();
};
#endif // DSCONNECTOR_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment