From 7576b1f8189134782e2efd2e14ff87b78ab0f54a Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Mon, 10 Sep 2012 01:54:36 +0300 Subject: [PATCH] Show an error if we fail to start the camera pipeline --- qml/main.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qml/main.qml b/qml/main.qml index b3f0829..c5ab62a 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -1,6 +1,7 @@ // -*- qml -*- import QtQuick 1.1 import com.nokia.meego 1.1 +import com.nokia.extras 1.1 import QtCamera 1.0 import CameraPlus 1.0 @@ -32,6 +33,15 @@ PageStackWindow { } } + function showError(msg) { + error.text = msg; + error.show(); + } + + InfoBanner { + id: error + } + Settings { id: settings } @@ -74,7 +84,9 @@ PageStackWindow { target: platformWindow onActiveChanged: { if (platformWindow.active) { - cam.start(); + if (!cam.start()) { + showError("Camera failed to start. Please restart the camera."); + } } else { // This is a noop if camera is not idle so calling it will not hurt -- 2.25.1