aboutsummaryrefslogtreecommitdiff
path: root/main.qml
diff options
context:
space:
mode:
authorMoroccanMalinois <MoroccanMalinois@protonmail.com>2017-03-27 17:39:47 +0000
committerMoroccanMalinois <MoroccanMalinois@protonmail.com>2017-03-27 17:39:47 +0000
commitfb3a6182fc7db83ffac04752c37192f3dc1acd5f (patch)
treebcdf4e5bf0b86e53091f5f66e32d02936b7152a9 /main.qml
parent12573652a0a5836938b02a2308098929fdf06ab4 (diff)
downloadmonzero-gui-fb3a6182fc7db83ffac04752c37192f3dc1acd5f.tar.gz
monzero-gui-fb3a6182fc7db83ffac04752c37192f3dc1acd5f.tar.xz
monzero-gui-fb3a6182fc7db83ffac04752c37192f3dc1acd5f.zip
Make QtMultimedia dependency optional
Diffstat (limited to 'main.qml')
-rw-r--r--main.qml21
1 files changed, 14 insertions, 7 deletions
diff --git a/main.qml b/main.qml
index 267461d1..d52d1027 100644
--- a/main.qml
+++ b/main.qml
@@ -32,7 +32,6 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Dialogs 1.2
import Qt.labs.settings 1.0
-import QtMultimedia 5.4
import moneroComponents.Wallet 1.0
import moneroComponents.PendingTransaction 1.0
@@ -65,9 +64,10 @@ ApplicationWindow {
property bool viewOnly: false
property bool foundNewBlock: false
property int timeToUnlock: 0
- property bool qrScannerEnabled: (typeof builtWithScanner != "undefined") && builtWithScanner && (QtMultimedia.availableCameras.length > 0)
+ property bool qrScannerEnabled: (typeof builtWithScanner != "undefined") && builtWithScanner
property int blocksToSync: 1
property var isMobile: (appWindow.width > 700) ? false : true
+ property var cameraUi
// true if wallet ever synchronized
property bool walletInitialized : false
@@ -809,6 +809,18 @@ ApplicationWindow {
// Connect app exit to qml window exit handling
mainApp.closing.connect(appWindow.close);
+ if( appWindow.qrScannerEnabled ){
+ console.log("qrScannerEnabled : load component QRCodeScanner");
+ var component = Qt.createComponent("components/QRCodeScanner.qml");
+ if (component.status == Component.Ready) {
+ console.log("Camera component ready");
+ cameraUi = component.createObject(appWindow);
+ } else {
+ console.log("component not READY !!!");
+ appWindow.qrScannerEnabled = false;
+ }
+ } else console.log("qrScannerEnabled disabled");
+
if(!walletsFound()) {
rootItem.state = "wizard"
} else {
@@ -941,11 +953,6 @@ ApplicationWindow {
messageText: qsTr("Please wait...")
}
- QRCodeScanner {
- id: cameraUi
- visible : false
- }
-
Item {
id: rootItem
anchors.fill: parent