diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2018-03-14 11:30:21 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2018-03-14 10:37:01 +0000 |
commit | e9de65f8f2bd9bac8a72badc879d2e03618bc3c7 (patch) | |
tree | bfac82450d42b6bc621c0377b9330874db8b5b5a | |
parent | c56df4ada0db4fc0487cccc309fef3f3e2554e6e (diff) |
Add remote preview toolbar button
Task-number: QT3DS-1287
Change-Id: I301aef4c89a9a034ce4f6f08e41c2eee2bf7dd8e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/MainFrm.cpp | 17 | ||||
-rw-r--r-- | src/Authoring/Studio/MainFrm.h | 3 | ||||
-rw-r--r-- | src/Authoring/Studio/MainFrm.ui | 14 | ||||
-rw-r--r-- | src/Authoring/Studio/images.qrc | 4 | ||||
-rw-r--r-- | src/Authoring/Studio/images/remote-disabled.png | bin | 0 -> 660 bytes | |||
-rw-r--r-- | src/Authoring/Studio/images/remote-disabled@2x.png | bin | 0 -> 974 bytes | |||
-rw-r--r-- | src/Authoring/Studio/images/remote.png | bin | 0 -> 660 bytes | |||
-rw-r--r-- | src/Authoring/Studio/images/remote@2x.png | bin | 0 -> 965 bytes |
8 files changed, 32 insertions, 6 deletions
diff --git a/src/Authoring/Studio/MainFrm.cpp b/src/Authoring/Studio/MainFrm.cpp index 9eb5da56..b777d71e 100644 --- a/src/Authoring/Studio/MainFrm.cpp +++ b/src/Authoring/Studio/MainFrm.cpp @@ -101,8 +101,6 @@ CMainFrame::CMainFrame() connect(m_ui->action_Connect_to_Device, &QAction::triggered, this, &CMainFrame::OnFileConnectToDevice); connect(m_remoteDeploymentSender, &RemoteDeploymentSender::connectionChanged, - m_ui->action_Connect_to_Device, &QAction::setChecked); - connect(m_remoteDeploymentSender, &RemoteDeploymentSender::connectionChanged, this, &CMainFrame::OnConnectionChanged); connect(m_ui->action_Exit, &QAction::triggered, this, &CMainFrame::close); @@ -170,6 +168,8 @@ CMainFrame::CMainFrame() // Playback toolbar connect(m_ui->actionPreview, &QAction::triggered, this, &CMainFrame::OnPlaybackPreviewRuntime1); + connect(m_ui->actionRemote_Preview, &QAction::triggered, + this, &CMainFrame::OnPlaybackPreviewRemote); // Only show runtime2 preview if we have appropriate viewer if (CPreviewHelper::viewerExists(QStringLiteral("q3dsviewer"))) { @@ -334,6 +334,7 @@ void CMainFrame::OnCreate() m_ui->action_Connect_to_Device->setEnabled(false); m_ui->action_Revert->setEnabled(false); m_ui->actionImportAssets->setEnabled(false); + m_ui->actionRemote_Preview->setEnabled(false); setCentralWidget(m_SceneView); } @@ -972,9 +973,9 @@ void CMainFrame::OnPlaybackStop() /** * Handles pressing the preview button. */ -void CMainFrame::OnPlaybackPreview(const QString &viewerExeName) +void CMainFrame::OnPlaybackPreview(const QString &viewerExeName, bool remote) { - if (m_remoteDeploymentSender->isConnected()) { + if (remote && m_remoteDeploymentSender->isConnected()) { g_StudioApp.GetCore()->GetDispatch()->FireOnProgressBegin( Q3DStudio::CString::fromQString(QObject::tr("Deploying to remote device...")), ""); @@ -995,6 +996,11 @@ void CMainFrame::OnPlaybackPreviewRuntime2() OnPlaybackPreview(QStringLiteral("q3dsviewer")); } +void CMainFrame::OnPlaybackPreviewRemote() +{ + OnPlaybackPreview(QStringLiteral("Qt3DViewer"), true); +} + //============================================================================== /** * Handles the update ui message for the preview button. @@ -1798,8 +1804,9 @@ void CMainFrame::OnShowInspector() void CMainFrame::OnConnectionChanged(bool connected) { - Q_UNUSED(connected) g_StudioApp.GetCore()->GetDispatch()->FireOnProgressEnd(); + m_ui->action_Connect_to_Device->setChecked(connected); + m_ui->actionRemote_Preview->setEnabled(connected); } CTimelineControl *CMainFrame::GetTimelineControl() diff --git a/src/Authoring/Studio/MainFrm.h b/src/Authoring/Studio/MainFrm.h index 188551c0..8f3dba5f 100644 --- a/src/Authoring/Studio/MainFrm.h +++ b/src/Authoring/Studio/MainFrm.h @@ -151,9 +151,10 @@ public: void OnUpdatePlaybackRewind(); void OnPlaybackStop(); void OnUpdatePlaybackStop(); - void OnPlaybackPreview(const QString &viewerExeName); + void OnPlaybackPreview(const QString &viewerExeName, bool remote = false); void OnPlaybackPreviewRuntime1(); void OnPlaybackPreviewRuntime2(); + void OnPlaybackPreviewRemote(); void OnUpdatePlaybackPreview(); void OnUpdateToolMove(); void OnUpdateToolRotate(); diff --git a/src/Authoring/Studio/MainFrm.ui b/src/Authoring/Studio/MainFrm.ui index 9e2227d1..aae7cad0 100644 --- a/src/Authoring/Studio/MainFrm.ui +++ b/src/Authoring/Studio/MainFrm.ui @@ -207,6 +207,7 @@ <bool>false</bool> </attribute> <addaction name="actionPreview"/> + <addaction name="actionRemote_Preview"/> <addaction name="actionPreviewRuntime2"/> </widget> <action name="action_Reference_Manual"> @@ -797,6 +798,19 @@ <string>Data Inputs...</string> </property> </action> + <action name="actionRemote_Preview"> + <property name="icon"> + <iconset> + <normalon>:/images/remote.png</normalon> + </iconset> + </property> + <property name="text"> + <string>Remote Preview</string> + </property> + <property name="toolTip"> + <string>Preview on Remote Device</string> + </property> + </action> </widget> <customwidgets> <customwidget> diff --git a/src/Authoring/Studio/images.qrc b/src/Authoring/Studio/images.qrc index e034c4a3..5ab332e1 100644 --- a/src/Authoring/Studio/images.qrc +++ b/src/Authoring/Studio/images.qrc @@ -269,6 +269,10 @@ <file>images/Tutorial/screens/2x/5.png</file> <file>images/Tutorial/screens/2x/6.png</file> <file>images/Tutorial/screens/2x/7.png</file> + <file>images/remote.png</file> + <file>images/remote@2x.png</file> + <file>images/remote-disabled.png</file> + <file>images/remote-disabled@2x.png</file> </qresource> <qresource prefix="/startup"> <file alias="open_dialog.png">images/open_dialog.png</file> diff --git a/src/Authoring/Studio/images/remote-disabled.png b/src/Authoring/Studio/images/remote-disabled.png Binary files differnew file mode 100644 index 00000000..a5d7553c --- /dev/null +++ b/src/Authoring/Studio/images/remote-disabled.png diff --git a/src/Authoring/Studio/images/remote-disabled@2x.png b/src/Authoring/Studio/images/remote-disabled@2x.png Binary files differnew file mode 100644 index 00000000..b7d95c41 --- /dev/null +++ b/src/Authoring/Studio/images/remote-disabled@2x.png diff --git a/src/Authoring/Studio/images/remote.png b/src/Authoring/Studio/images/remote.png Binary files differnew file mode 100644 index 00000000..83b44b84 --- /dev/null +++ b/src/Authoring/Studio/images/remote.png diff --git a/src/Authoring/Studio/images/remote@2x.png b/src/Authoring/Studio/images/remote@2x.png Binary files differnew file mode 100644 index 00000000..fd06be49 --- /dev/null +++ b/src/Authoring/Studio/images/remote@2x.png |