linphone-desktop/linphone-app/ui/views/App/Settings/SettingsUi.js
Julien Wadel 8c9e610107 - Fix crash and leaks on restart/quit.
- Reload conference list when current account change.
- Fix popup design (margins).
- Factorization of message banner (eg. copy text message)
- Factorization of NewConference dialog.
- Fix design on file preview in chat.
- Add participant shortcut in video conference.
- Remove old Linphone-Utils file/scripts.
- Fix avatar image in history view when clicking on username.
2022-05-13 17:38:43 +02:00

72 lines
2.1 KiB
JavaScript

/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// =============================================================================
// `SettingsUi.qml` Logic.
// =============================================================================
.import Linphone 1.0 as Linphone
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
function cleanAvatars () {
window.attachVirtualWindow(Utils.buildCommonDialogUri('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) {
if( a.key < b.key ) return -1;
if( a.key > b.key ) return 1;
return 0;
}))
}
function setLocale (locale) {
var App = Linphone.App
App.configLocale = locale
window.detachVirtualWindow()
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
descriptionText: qsTr('setLocaleDescription'),
}, function (status) {
if (status) {
App.restart()
}
})
}