Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Qt UI Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Design Studio
QML Viewer Projects
Qt UI Viewer
Merge requests
!30
fix: issue while disconnecting the app
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
fix: issue while disconnecting the app
QDS-11655/implement-drawer-menu
into
master
Overview
0
Commits
1
Pipelines
2
Changes
6
Merged
Burak Hançerli
requested to merge
QDS-11655/implement-drawer-menu
into
master
1 year ago
Overview
0
Commits
1
Pipelines
2
Changes
6
Expand
This MR brings the following features;
Move the bottom menu to a new drawer menu
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
9ed7ee34
1 commit,
1 year ago
6 files
+
80
−
164
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/backend.cpp
+
40
−
78
Options
@@ -46,6 +46,12 @@ Backend::Backend(QObject *parent)
// This will allow us to open the app with the QR code
QDesktopServices
::
setUrlHandler
(
"qtdesignviewer"
,
this
,
"parseDesignViewerUrl"
);
QDesktopServices
::
setUrlHandler
(
"https"
,
this
,
"parseDesignViewerUrl"
);
connect
(
&
m_dsConnectorThread
,
&
QThread
::
started
,
this
,
&
Backend
::
initDesignStudioConnector
,
Qt
::
DirectConnection
);
m_dsConnectorThread
.
start
();
}
void
Backend
::
initialize
()
@@ -198,91 +204,47 @@ void Backend::initializeProjectManager()
&
Backend
::
downloadProgress
);
}
bool
Backend
::
connec
tDesignStudio
()
void
Backend
::
ini
tDesignStudio
Connector
()
{
if
(
m_designStudioConnector
)
{
qDebug
()
<<
"Design Studio Connector is already initialized"
;
return
true
;
}
qDebug
()
<<
"Initializing Design Studio Connector"
;
connect
(
&
m_dsConnectorThread
,
&
QThread
::
started
,
this
,
[
&
]
{
m_designStudioConnector
.
reset
(
new
DesignStudioConnector
);
connect
(
m_designStudioConnector
.
data
(),
&
DesignStudioConnector
::
networkStatusUpdated
,
this
,
&
Backend
::
networkUpdated
);
connect
(
m_designStudioConnector
.
data
(),
&
DesignStudioConnector
::
projectReceived
,
this
,
[
this
](
const
QByteArray
&
projectData
)
{
qDebug
()
<<
"Project received from Design Studio"
;
initializeProjectManager
();
emit
popupOpen
();
updatePopup
(
"Unpacking project..."
);
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 "
"information."
;
emit
popupClose
();
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
();
});
if
(
!
m_designStudioConnector
->
initialize
())
{
qCritical
()
<<
"Could initialize server. Please check the logs for more information."
;
m_designStudioConnector
.
reset
();
}
},
Qt
::
DirectConnection
);
m_designStudioConnector
.
reset
(
new
DesignStudioConnector
);
m_dsConnectorThread
.
start
();
connect
(
m_designStudioConnector
.
data
(),
&
DesignStudioConnector
::
networkStatusUpdated
,
this
,
&
Backend
::
networkUpdated
);
qDebug
()
<<
"Design Studio Connector is initialized"
;
return
true
;
}
connect
(
m_designStudioConnector
.
data
(),
&
DesignStudioConnector
::
projectReceived
,
this
,
[
this
](
const
QByteArray
&
projectData
)
{
qDebug
()
<<
"Project received from Design Studio"
;
initializeProjectManager
();
emit
popupOpen
();
updatePopup
(
"Unpacking project..."
);
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 "
"information."
;
emit
popupClose
();
return
;
}
void
Backend
::
disconnectDesignStudio
()
{
if
(
!
m_designStudioConnector
)
{
qDebug
()
<<
"Design Studio Connector is not initialized"
;
return
;
}
qDebug
()
<<
"Project unpacked to "
<<
projectPath
;
updatePopup
(
"Running project..."
);
qDebug
()
<<
"Disconnecting from Design Studio"
;
if
(
!
m_projectManager
->
runProject
(
projectPath
))
{
qCritical
()
<<
"Could not run project. Please check the logs for more "
"information."
;
}
else
{
m_projectManager
->
showAppWindow
();
}
connect
(
&
m_dsConnectorThread
,
&
QThread
::
finished
,
this
,
[
&
]
{
qDebug
()
<<
"Design Studio Connector is disconnected"
;
m_designStudioConnector
.
reset
();
},
Qt
::
DirectConnection
);
emit
popupClose
();
});
m_dsConnectorThread
.
quit
();
m_dsConnectorThread
.
wait
();
qDebug
()
<<
"Design Studio Connector is initialized"
;
}
void
Backend
::
runDemoProject
(
const
QString
&
projectName
)
Loading