mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-30 16:06:24 +00:00
Fix SIP settings :
- Deletion of account where registration has not been enabled. - Crash on new account. - Route error message on creation.
This commit is contained in:
parent
4682ace15d
commit
479369bab0
4 changed files with 30 additions and 24 deletions
|
|
@ -231,8 +231,10 @@ void AccountSettingsModel::removeProxyConfig (const shared_ptr<linphone::ProxyCo
|
|||
if (proxyConfig->done() == -1) {
|
||||
qWarning() << QStringLiteral("Unable to reset message-expiry property before removing proxy config: `%1`.")
|
||||
.arg(QString::fromStdString(proxyConfig->getIdentityAddress()->asString()));
|
||||
}else { // Wait for update
|
||||
}else if(proxyConfig->registerEnabled()) { // Wait for update
|
||||
mRemovingProxies.push_back(proxyConfig);
|
||||
}else{// Registration is not enabled : Removing without wait.
|
||||
CoreManager::getInstance()->getCore()->removeProxyConfig(proxyConfig);
|
||||
}
|
||||
|
||||
emit accountSettingsUpdated();
|
||||
|
|
@ -504,8 +506,9 @@ void AccountSettingsModel::handleRegistrationStateChanged (
|
|||
coreManager->getSettingsModel()->configureRlsUri();
|
||||
}else if(mRemovingProxies.contains(proxy)){
|
||||
mRemovingProxies.removeAll(proxy);
|
||||
QTimer::singleShot(100, [proxy](){// removeProxyConfig cannot be called from callback
|
||||
QTimer::singleShot(100, [proxy, this](){// removeProxyConfig cannot be called from callback
|
||||
CoreManager::getInstance()->getCore()->removeProxyConfig(proxy);
|
||||
emit accountSettingsUpdated();
|
||||
});
|
||||
}
|
||||
if(defaultProxyConfig == proxy)
|
||||
|
|
|
|||
|
|
@ -76,25 +76,28 @@ function formIsValid () {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
function validProxyConfig () {
|
||||
if (Linphone.AccountSettingsModel.addOrUpdateProxyConfig(proxyConfig, {
|
||||
sipAddress: sipAddress.text,
|
||||
serverAddress: serverAddress.text,
|
||||
registrationDuration: registrationDuration.text,
|
||||
transport: transport.currentText,
|
||||
route: route.text,
|
||||
conferenceUri: conferenceUri.text,
|
||||
contactParams: contactParams.text,
|
||||
avpfInterval: avpfInterval.text,
|
||||
registerEnabled: registerEnabled.checked,
|
||||
publishPresence: publishPresence.checked,
|
||||
avpfEnabled: avpfEnabled.checked,
|
||||
iceEnabled: iceEnabled.checked,
|
||||
turnEnabled: turnEnabled.checked,
|
||||
stunServer: stunServer.text,
|
||||
turnUser: turnUser.text,
|
||||
turnPassword: turnPassword.text
|
||||
})) {
|
||||
function validProxyConfig (proxyConfig) {
|
||||
var data = {
|
||||
sipAddress: sipAddress.text,
|
||||
serverAddress: serverAddress.text,
|
||||
registrationDuration: registrationDuration.text,
|
||||
transport: transport.currentText,
|
||||
route: route.text,
|
||||
conferenceUri: conferenceUri.text,
|
||||
contactParams: contactParams.text,
|
||||
avpfInterval: avpfInterval.text,
|
||||
registerEnabled: registerEnabled.checked,
|
||||
publishPresence: publishPresence.checked,
|
||||
avpfEnabled: avpfEnabled.checked,
|
||||
iceEnabled: iceEnabled.checked,
|
||||
turnEnabled: turnEnabled.checked,
|
||||
stunServer: stunServer.text,
|
||||
turnUser: turnUser.text,
|
||||
turnPassword: turnPassword.text
|
||||
}
|
||||
|
||||
if (proxyConfig && Linphone.AccountSettingsModel.addOrUpdateProxyConfig(proxyConfig, data)
|
||||
|| !proxyConfig && Linphone.AccountSettingsModel.addOrUpdateProxyConfig(data)) {
|
||||
dialog.exit(1)
|
||||
} else {
|
||||
// TODO: Display errors on the form (if necessary).
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ DialogPlus {
|
|||
|
||||
property bool _sipAddressOk: false
|
||||
property bool _serverAddressOk: false
|
||||
property bool _routeOk: false
|
||||
property bool _routeOk: true
|
||||
property bool _conferenceUriOk: true
|
||||
|
||||
buttons: [
|
||||
|
|
@ -28,7 +28,7 @@ DialogPlus {
|
|||
enabled: Logic.formIsValid()
|
||||
text: qsTr('confirm')
|
||||
|
||||
onClicked: Logic.validProxyConfig()
|
||||
onClicked: Logic.validProxyConfig(dialog.account ? dialog.account.proxyConfig : null)
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ TabContainer {
|
|||
TextButtonB {
|
||||
text: qsTr('addAccount')
|
||||
|
||||
onClicked: Logic.editAccount()
|
||||
onClicked: Logic.editAccount(null)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue