telephant/qml/componentCreator.js
2020-02-28 05:36:47 +01:00

71 lines
1.7 KiB
JavaScript

function createMessagePopup(parent, model) {
var component = Qt.createComponent("MessagePopup.qml")
var popup = component.createObject(parent, {
"message": model
})
accountBridge.attachments.clear()
if (popup == null) {
console.log("Error creating MessagePopup")
}
return popup
}
function createSharePopup(parent, model) {
var component = Qt.createComponent("SharePopup.qml")
var popup = component.createObject(parent, {
"message": model
})
if (popup == null) {
console.log("Error creating SharePopup")
}
return popup
}
function createDeletePopup(parent, model) {
var component = Qt.createComponent("DeletePopup.qml")
var popup = component.createObject(parent, {
"message": model
})
if (popup == null) {
console.log("Error creating DeletePopup")
}
return popup
}
function createConversationPopup(parent, model) {
var component = Qt.createComponent("ConversationPopup.qml")
var popup = component.createObject(parent, {
"message": model
})
if (popup == null) {
console.log("Error creating ConversationPopup")
}
return popup
}
function createAccountPopup(parent) {
var component = Qt.createComponent("AccountPopup.qml")
var popup = component.createObject(parent, {})
if (popup == null) {
console.log("Error creating AccountPopup")
}
return popup
}
function createMediaPopup(parent, model) {
var component = Qt.createComponent("MediaPopup.qml")
var popup = component.createObject(parent, {
"url": model
})
if (popup == null) {
console.log("Error creating MediaPopup")
}
return popup
}