mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-28 17:29:19 +00:00
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
// =============================================================================
|
|
// `SettingsUi.qml` Logic.
|
|
// =============================================================================
|
|
|
|
.import Linphone 1.0 as Linphone
|
|
|
|
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
|
|
|
|
// =============================================================================
|
|
|
|
function cleanAvatars () {
|
|
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
|
|
descriptionText: qsTr('cleanAvatarsDescription'),
|
|
}, function (status) {
|
|
if (status) {
|
|
Linphone.ContactsListModel.cleanAvatars()
|
|
}
|
|
})
|
|
}
|
|
|
|
function getAvailableLocales () {
|
|
var locales = []
|
|
|
|
Linphone.App.availableLocales.forEach(function (locale) {
|
|
locales.push({
|
|
key: Utils.capitalizeFirstLetter(locale.nativeLanguageName),
|
|
value: locale.name
|
|
})
|
|
})
|
|
|
|
return [{
|
|
key: qsTr('systemLocale'),
|
|
value: ''
|
|
}].concat(locales.sort(function (a, b) {
|
|
return a > b
|
|
}))
|
|
}
|
|
|
|
function setLocale (locale) {
|
|
var App = Linphone.App
|
|
App.configLocale = locale
|
|
|
|
window.detachVirtualWindow()
|
|
window.attachVirtualWindow(Utils.buildDialogUri('ConfirmDialog'), {
|
|
descriptionText: qsTr('setLocaleDescription'),
|
|
}, function (status) {
|
|
if (status) {
|
|
App.restart()
|
|
}
|
|
})
|
|
}
|