mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
fix(scripts/utils.js): fix indentation
This commit is contained in:
parent
09b430340c
commit
885c16f9bd
1 changed files with 46 additions and 46 deletions
|
|
@ -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 (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.
|
||||
}
|
||||
|
||||
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()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue