Display a warning popup prior to launching a remote provisionning on an app that already has one or more accounts

This commit is contained in:
Christophe Deschamps 2023-10-16 08:16:04 +02:00
parent 98406ef7e0
commit a63348993d
20 changed files with 147 additions and 7 deletions

View file

@ -1506,6 +1506,11 @@ Adresa URL není nakonfigurována.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Je nutné aplikaci restartovat. Chcete ji nyní restartovat?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ Server url ikke konfigureret.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Det er nødvendigt at genstarte applikationen. Vil du gøre det nu?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ Server URL ist nicht konfiguriert.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Ein Neustart der Anwendung ist notwendig. Möchten Sie die Anwendung jetzt neu starten?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,10 @@ Server URL not configured.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>It is necessary to restart the application. Do you want to restart now?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<translation>An account is already provisioned. This action will erase the existing account.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ URL del servidor no configurada.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Es necesario reiniciar la aplicación. ¿Desea reiniciarla ahora?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,10 @@ URL du serveur non configurée.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Voulez-vous redémarrer maintenant pour prendre en compte ces modifications ?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<translation>Un compte est déjà configuré. Cette action effacera le compte existant.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1484,6 +1484,11 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Az alkalmazás újraindítása szükséges. Szeretné most újraindítani?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ URL del server non configurato.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>È necessario riavviare l&apos;applicazione. Vuoi riavviare ora?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1484,6 +1484,11 @@
<source>remoteProvisioningUpdateDescription</source>
<translation></translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1362,6 +1362,11 @@
<source>remoteProvisioningUpdateDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1507,6 +1507,11 @@ Nesukonfigūruotas serverio url.</translation>
<translation>Yra būtina paleisti programą naujo. Ar norite tai atlikti dabar?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>
<translation type="unfinished"></translation>

View file

@ -1087,6 +1087,11 @@
<source>remoteProvisioningUpdateDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ URL do servidor não configurado.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>É necessário reiniciar o aplicativo. Deseja reiniciar agora?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1506,6 +1506,11 @@
<source>remoteProvisioningUpdateDescription</source>
<translation>Требуется перезапустить приложение. Хотите перезапустить сейчас?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1495,6 +1495,11 @@ Serverwebbadressen är inte konfigurerad.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Det är nödvändigt att starta om programmet. Vill du starta om nu?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1484,6 +1484,11 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<source>remoteProvisioningUpdateDescription</source>
<translation>Uygulamanın yeniden başlaması gerekiyor. Şimdi yeniden başlatmak ister misiniz?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1506,6 +1506,10 @@
<source>remoteProvisioningUpdateDescription</source>
<translation>Потрібно перезапустити застосунок. Бажаєте перезапустити зараз?</translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<translation>An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -1484,6 +1484,11 @@
<source>remoteProvisioningUpdateDescription</source>
<translation></translation>
</message>
<message>
<source>remoteProvisioningWarnAccountOverwrite</source>
<extracomment>&apos;An account is already provisioned. This action will erase the existing account. : Warn user about it.</extracomment>
<translation type="unfinished">An account is already provisioned. This action will erase the existing account. : Warn user about it.</translation>
</message>
<message>
<source>lastProvisioningFailed</source>
<extracomment>&apos;Last remote provisioning failed&apos; : Test to warn the user that the last fetch of remote provisioning has failed.</extracomment>

View file

@ -46,10 +46,28 @@ import App.Styles 1.0
onOauth2StatusChanged: requestBlock.setText(status)
onOauth2RequestFailed: requestBlock.stop(error)
onOauth2AuthenticationGranted: requestBlock.stop('')
onProvisioningTokenReceived: {url.text = token
SettingsModel.remoteProvisioning = url.text
assistantModel.qrcode = ''
requestBlock.stop('')}
onProvisioningTokenReceived: {
if (AccountSettingsModel.accounts.length <= ((SettingsModel.showLocalSipAccount ? 1 : 0))) {
url.text = token
SettingsModel.remoteProvisioning = url.text
assistantModel.qrcode = ''
requestBlock.stop('')
} else {
window.detachVirtualWindow()
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
descriptionText: qsTr('remoteProvisioningWarnAccountOverwrite'),
}, function (confirm) {
if (confirm) {
url.text = token
SettingsModel.remoteProvisioning = url.text
assistantModel.qrcode = ''
requestBlock.stop('')
} else {
window.setView('Home')
}
})
}
}
onQRCodeAttached: requestBlock.stop('Attached')
onQRCodeNotAttached: requestBlock.stop(message)
@ -97,8 +115,22 @@ import App.Styles 1.0
Layout.preferredHeight: fitHeight
addHeight: 15
onClicked: SettingsModel.remoteProvisioning = url.text
onClicked:{
if (AccountSettingsModel.accounts.length <= ((SettingsModel.showLocalSipAccount ? 1 : 0))) {
SettingsModel.remoteProvisioning = url.text
} else {
window.detachVirtualWindow()
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
descriptionText: qsTr('remoteProvisioningWarnAccountOverwrite'),
}, function (confirm) {
if (confirm) {
SettingsModel.remoteProvisioning = url.text
} else {
window.setView('Home')
}
})
}
}
text: qsTr('confirmAction')
enabled: url.text.length > 0
}

View file

@ -432,7 +432,8 @@ ApplicationWindow {
Connections{
target: App
onRequestFetchConfig: {
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
if (AccountSettingsModel.accounts.length <= ((SettingsModel.showLocalSipAccount ? 1 : 0))) {
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
flat: true,
//: 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL
descriptionText: '<b>'+qsTr('confirmFetchUri')
@ -442,6 +443,26 @@ ApplicationWindow {
App.setFetchConfig(filePath)
}
})
} else {
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
descriptionText: qsTr('remoteProvisioningWarnAccountOverwrite'),
}, function (confirm) {
if (confirm) {
window.attachVirtualWindow(Utils.buildCommonDialogUri('ConfirmDialog'), {
flat: true,
//: 'Do you want to download and apply configuration from this URL?' : text to confirm to fetch a specified URL
descriptionText: '<b>'+qsTr('confirmFetchUri')
+'</b><br/><br/>'+filePath,
}, function (status) {
if (status) {
App.setFetchConfig(filePath)
}
})
} else {
window.setView('Home')
}
})
}
}
}
}