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

fix(scripts/utils.js): fix indentation

parent 09b43034
...@@ -10,44 +10,44 @@ ...@@ -10,44 +10,44 @@
// //
// If exitHandler is used, window must implement exitStatus signal. // If exitHandler is used, window must implement exitStatus signal.
function openWindow (window, parent, options) { function openWindow (window, parent, options) {
var object var object
if (options && options.isString) { if (options && options.isString) {
object = Qt.createQmlObject(window, parent) object = Qt.createQmlObject(window, parent)
} else { } else {
var component = Qt.createComponent( var component = Qt.createComponent(
'qrc:/ui/views/' + window + '.qml' '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.
}
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('Open window.')
console.debug('Destroy window.')
object.destroy()
})
object.exitStatus.connect(function (status) {
console.debug('Exit status: ' + status)
})
if (options && options.exitHandler) { object.closing.connect(function () {
object.exitStatus.connect( console.debug('Destroy window.')
// Bind to access parent properties. object.destroy()
options.exitHandler.bind(parent) })
) 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) { ...@@ -55,24 +55,24 @@ function openWindow (window, parent, options) {
// Display a simple ConfirmDialog component. // Display a simple ConfirmDialog component.
// Wrap the openWindow function. // Wrap the openWindow function.
function openConfirmDialog (parent, options) { function openConfirmDialog (parent, options) {
openWindow( openWindow(
'import QtQuick 2.7;' + 'import QtQuick 2.7;' +
'import \'qrc:/ui/Linphone/Dialog\';' + 'import \'qrc:/ui/modules/Linphone/Dialog\';' +
'ConfirmDialog {' + 'ConfirmDialog {' +
'descriptionText: \'' + options.descriptionText + '\';' + 'descriptionText: \'' + options.descriptionText + '\';' +
'title: \'' + options.title + '\'' + 'title: \'' + options.title + '\'' +
'}', '}',
parent, { parent, {
isString: true, isString: true,
exitHandler: options.exitHandler exitHandler: options.exitHandler
} }
) )
} }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
function snakeToCamel (s) { function snakeToCamel (s) {
return s.replace(/(\_\w)/g, function (matches) { return s.replace(/(\_\w)/g, function (matches) {
return matches[1].toUpperCase() 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