Commit 885c16f9 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(scripts/utils.js): fix indentation

parent 09b43034
......@@ -10,44 +10,44 @@
//
// If exitHandler is used, window must implement exitStatus signal.
function openWindow (window, parent, options) {
var object
var object
if (options && options.isString) {
object = Qt.createQmlObject(window, parent)
} else {
var component = Qt.createComponent(
'qrc:/ui/views/' + window + '.qml'
)
if (component.status !== Component.Ready) {
console.debug('Window not ready.')
if(component.status === Component.Error) {
console.debug('Error:' + component.errorString())
}
return // Error.
}
if (options && options.isString) {
object = Qt.createQmlObject(window, parent)
} else {
var component = Qt.createComponent(
'qrc:/ui/views/' + window + '.qml'
)
object = component.createObject(parent)
if (component.status !== Component.Ready) {
console.debug('Window not ready.')
if(component.status === Component.Error) {
console.debug('Error:' + component.errorString())
}
return // Error.
}
console.debug('Open window.')
object = component.createObject(parent)
}
object.closing.connect(function () {
console.debug('Destroy window.')
object.destroy()
})
object.exitStatus.connect(function (status) {
console.debug('Exit status: ' + status)
})
console.debug('Open window.')
if (options && options.exitHandler) {
object.exitStatus.connect(
// Bind to access parent properties.
options.exitHandler.bind(parent)
)
}
object.closing.connect(function () {
console.debug('Destroy window.')
object.destroy()
})
object.exitStatus.connect(function (status) {
console.debug('Exit status: ' + status)
})
object.show()
if (options && options.exitHandler) {
object.exitStatus.connect(
// Bind to access parent properties.
options.exitHandler.bind(parent)
)
}
object.show()
}
// -------------------------------------------------------------------
......@@ -55,24 +55,24 @@ function openWindow (window, parent, options) {
// Display a simple ConfirmDialog component.
// Wrap the openWindow function.
function openConfirmDialog (parent, options) {
openWindow(
'import QtQuick 2.7;' +
'import \'qrc:/ui/Linphone/Dialog\';' +
'ConfirmDialog {' +
'descriptionText: \'' + options.descriptionText + '\';' +
'title: \'' + options.title + '\'' +
'}',
parent, {
isString: true,
exitHandler: options.exitHandler
}
)
openWindow(
'import QtQuick 2.7;' +
'import \'qrc:/ui/modules/Linphone/Dialog\';' +
'ConfirmDialog {' +
'descriptionText: \'' + options.descriptionText + '\';' +
'title: \'' + options.title + '\'' +
'}',
parent, {
isString: true,
exitHandler: options.exitHandler
}
)
}
// -------------------------------------------------------------------
function snakeToCamel (s) {
return s.replace(/(\_\w)/g, function (matches) {
return matches[1].toUpperCase()
})
return s.replace(/(\_\w)/g, function (matches) {
return matches[1].toUpperCase()
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment