mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-22 03:49:10 +02:00
Fixed undefined error when displaying from the dictionary
This commit is contained in:
parent
2b4dd327ec
commit
189809dc2c
3 changed files with 24 additions and 41 deletions
|
@ -146,8 +146,8 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
onFeaturePermissionRequested: {
|
onFeaturePermissionRequested: {
|
||||||
permissionPopupBackground.permissionsOptions.securityOrigin = securityOrigin;
|
permissionPopupBackground.securityOrigin = securityOrigin;
|
||||||
permissionPopupBackground.permissionsOptions.feature = feature;
|
permissionPopupBackground.feature = feature;
|
||||||
|
|
||||||
permissionPopupBackground.visible = true;
|
permissionPopupBackground.visible = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,31 +9,25 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
width: 600
|
width: 600
|
||||||
height: 200
|
height: 200
|
||||||
|
z:100
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
z:100
|
readonly property var permissionLanguage: ({
|
||||||
property var permissionLanguage: {
|
[WebEngineView.MediaAudioCapture]: "access an audio input device",
|
||||||
"test": "test"
|
[WebEngineView.MediaVideoCapture]: "access a video device, like your webcam",
|
||||||
}
|
[WebEngineView.MediaAudioVideoCapture]: "access an audio input device and video device",
|
||||||
property int currentRequestedPermission
|
[WebEngineView.Geolocation]: "access your location",
|
||||||
|
[WebEngineView.DesktopVideoCapture]: "capture video from your desktop",
|
||||||
|
[WebEngineView.DesktopAudioVideoCapture]: "capture audio and video from your desktop"
|
||||||
|
})
|
||||||
|
property string currentRequestedPermission
|
||||||
signal permissionButtonPressed(real buttonNumber)
|
signal permissionButtonPressed(real buttonNumber)
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log("loaded component");
|
|
||||||
// console.log("\n\n TESTING!! \n\n")
|
|
||||||
console.log("WebEngineView.MediaAudioCapture", WebEngineView.MediaAudioCapture)
|
|
||||||
// root.permissionLanguage["test"] = "test"
|
|
||||||
root.permissionLanguage[WebEngineView.MediaAudioCapture] = "access an audio input device";
|
|
||||||
root.permissionLanguage[WebEngineView.MediaVideoCapture] = "access a video device, like your webcam";
|
|
||||||
root.permissionLanguage[WebEngineView.MediaAudioVideoCapture] = "access an audio input device and video device";
|
|
||||||
root.permissionLanguage[WebEngineView.Geolocation] = "access your location";
|
|
||||||
root.permissionLanguage[WebEngineView.DesktopVideoCapture] = "capture video from your desktop";
|
|
||||||
root.permissionLanguage[WebEngineView.DesktopAudioVideoCapture] = "capture audio and video from your desktop";
|
|
||||||
console.log(JSON.stringify(root.permissionLanguage))
|
console.log(JSON.stringify(root.permissionLanguage))
|
||||||
|
console.log("\n\n\n\n\n current permission:" + root.currentRequestedPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
// anchors.top: buttons.bottom
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: mainContainer
|
id: mainContainer
|
||||||
width: root.width
|
width: root.width
|
||||||
|
@ -86,11 +80,9 @@ Item {
|
||||||
|
|
||||||
text: "Yes allow access"
|
text: "Yes allow access"
|
||||||
color: hifi.buttons.blue
|
color: hifi.buttons.blue
|
||||||
// colorScheme: root.colorScheme
|
|
||||||
enabled: true
|
enabled: true
|
||||||
width: 155
|
width: 155
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("\n\n JUST CLICKED BUTTON 0, GOING TO SEND SIGNAL!")
|
|
||||||
root.permissionButtonPressed(0)
|
root.permissionButtonPressed(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,10 +92,8 @@ Item {
|
||||||
anchors.leftMargin: permissionsButtonRow.space
|
anchors.leftMargin: permissionsButtonRow.space
|
||||||
text: "Don't Allow"
|
text: "Don't Allow"
|
||||||
color: hifi.buttons.red
|
color: hifi.buttons.red
|
||||||
// colorScheme: root.colorScheme
|
|
||||||
enabled: true
|
enabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("\n\n JUST CLICKED BUTTON 1, GOING TO SEND SIGNAL!")
|
|
||||||
root.permissionButtonPressed(1)
|
root.permissionButtonPressed(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,34 +8,27 @@ Rectangle {
|
||||||
id: root
|
id: root
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(0, 0, 0, 0.5);
|
color: Qt.rgba(0, 0, 0, 0.5);
|
||||||
HifiConstants { id: hifi }
|
|
||||||
visible: false
|
visible: false
|
||||||
property variant permissionsOptions: {'securityOrigin':'none','feature': -1}
|
property var permissionsOptions: ({'securityOrigin':'none','feature': 'none'})
|
||||||
signal sendPermission(string securityOrigin, int feature, bool shouldGivePermission)
|
property string securityOrigin: 'none'
|
||||||
|
property string feature: 'none'
|
||||||
|
signal sendPermission(string securityOrigin, string feature, bool shouldGivePermission)
|
||||||
|
|
||||||
Component.onCompleted: {
|
onFeatureChanged: {
|
||||||
console.log("loaded component");
|
permissionPopupItem.currentRequestedPermission = feature;
|
||||||
// console.log("\n\n TESTING!! \n\n")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PermissionPopup {
|
PermissionPopup {
|
||||||
id: permissionPopupItem
|
id: permissionPopupItem
|
||||||
Component.onCompleted: {
|
|
||||||
permissionPopupItem.currentRequestedPermission = permissionsOptions.feature;
|
|
||||||
console.log("test");
|
|
||||||
// console.log("\n\n TESTING!! \n\n")
|
|
||||||
}
|
|
||||||
onPermissionButtonPressed: {
|
onPermissionButtonPressed: {
|
||||||
console.log("JUST MADE IT TO ON PERMISSIONS PRESSEED!");
|
|
||||||
console.log(buttonNumber);
|
|
||||||
if (buttonNumber === 0) {
|
if (buttonNumber === 0) {
|
||||||
root.sendPermission(permissionsOptions.securityOrigin, permissionsOptions.feature, true)
|
root.sendPermission(securityOrigin, feature, true)
|
||||||
} else {
|
} else {
|
||||||
root.sendPermission(permissionsOptions.securityOrigin, permissionsOptions.feature, false)
|
root.sendPermission(securityOrigin, feature, false)
|
||||||
}
|
}
|
||||||
root.visible = false;
|
root.visible = false;
|
||||||
permissionsOptions.securityOrigin = "none";
|
securityOrigin = 'none';
|
||||||
permissionsOptions.feature = -1;
|
feature = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue