Skip to content

Commit

Permalink
Fix camera action: show correctly camera view
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Mar 25, 2024
1 parent 6f2ef9f commit 89d5823
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
8 changes: 0 additions & 8 deletions qml/desktop/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,4 @@ Window {
ScreenSuspend {
id: screenSuspend
}

Connections {
target: cameraModel

function onActionViewCamera() {
AppActions.openCameraSingleView(camModel)
}
}
}
6 changes: 4 additions & 2 deletions src/CameraModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ void CameraModel::eventTouchscreenCamera(QString cameraId)
if (cam && cam->get_cameraId() == cameraId)
{
//Wake up screen
QFAppDispatcher *appDispatcher = QFAppDispatcher::instance(engine);

#ifdef CALAOS_DESKTOP
ScreenManager::Instance().wakeupScreen();

//Also tell ScreenSuspend.qml to wake up
QFAppDispatcher *appDispatcher = QFAppDispatcher::instance(engine);
appDispatcher->dispatch("wakeupScreen");
#endif
emit actionViewCamera(getItemModel(i));
QVariantMap m = {{ "camModel", QVariant::fromValue(getItemModel(i)) }};
appDispatcher->dispatch("openCameraSingleView", m);
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/CameraModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class CameraModel: public QStandardItemModel
Q_INVOKABLE QObject *getItemModel(int idx);
Q_INVOKABLE int cameraCount() { return rowCount(); }

signals:
void actionViewCamera(QObject *camModel);

private slots:
void eventTouchscreenCamera(QString cameraId);

Expand Down

0 comments on commit 89d5823

Please sign in to comment.