Popup when remote configuration failed + update remote configuration failed error message (Expiration or used) in en & fr

This commit is contained in:
Christophe Deschamps 2023-10-17 20:32:15 +00:00
parent 222c70e7c8
commit e31d0b3763
7 changed files with 32 additions and 9 deletions

View file

@ -1502,7 +1502,7 @@ Server URL not configured.</translation>
<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>Last remote provisioning failed</translation>
<translation>Remote provisioning failed. The link might be used or expired. If it was provided to you, please contact your administrator.</translation>
</message>
<message>
<source>generateLabel</source>

View file

@ -1502,7 +1502,7 @@ URL du serveur non configurée.</translation>
<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>La dernière configuration n&apos;a pas pu être récupérée</translation>
<translation>Erreur de récupération de la configuration distante. Le lien de configuration a peut-être déjà é utilisé ou a expiré. Merci de contacter un administrateur si ce lien vous a é fourni.</translation>
</message>
<message>
<source>generateLabel</source>

View file

@ -464,6 +464,8 @@ QString CoreManager::getDownloadUrl () {
void CoreManager::setLastRemoteProvisioningState(const linphone::Config::ConfiguringState& state){
mLastRemoteProvisioningState = state;
if (state == linphone::Config::ConfiguringState::Failed)
emit remoteProvisioningFailed();
}
bool CoreManager::isLastRemoteProvisioningGood(){

View file

@ -192,6 +192,7 @@ signals:
void eventCountChanged ();
void callLogsCountChanged();
void remoteProvisioningFailed();
private:
CoreManager (QObject *parent, const QString &configPath);

View file

@ -728,3 +728,11 @@ function printObject(o) {
else
return out;
}
function infoDialog(window, message) {
window.attachVirtualWindow(buildCommonDialogUri('ConfirmDialog'), {
buttonTexts : ['',qsTr('okButton')],
descriptionText: message,
showButtonOnly: 1
}, function (status) {})
}

View file

@ -116,3 +116,9 @@ function handleAuthenticationRequested (authInfo, realm, sipAddress, userId) {
virtualWindowHash:Qt.md5('Dialogs/AuthenticationRequest.qml'+realm+sipAddress+userId)
})
}
// -----------------------------------------------------------------------------
function warnProvisioningFailed(window) {
Utils.infoDialog(window, qsTr('lastProvisioningFailed'))
}

View file

@ -56,6 +56,7 @@ ApplicationWindow {
Connections {
target: CoreManager
onCoreManagerInitialized: mainLoader.active = true
onRemoteProvisioningFailed: if(mainLoader.active) Logic.warnProvisioningFailed(window)
}
Shortcut {
@ -70,13 +71,18 @@ ApplicationWindow {
active: false
anchors.fill: parent
onLoaded: switch(SettingsModel.getShowDefaultPage()) {
case 1 : window.setView('Calls'); break;
case 2 : window.setView('Conversations'); break;
case 3 : ContactsListModel.update(); window.setView('Contacts'); break;
case 4 : window.setView('Conferences'); break;
default:{}
}
onLoaded: {
if(!CoreManager.isLastRemoteProvisioningGood()) {
Logic.warnProvisioningFailed(window)
}
switch(SettingsModel.getShowDefaultPage()) {
case 1 : window.setView('Calls'); break;
case 2 : window.setView('Conversations'); break;
case 3 : ContactsListModel.update(); window.setView('Contacts'); break;
case 4 : window.setView('Conferences'); break;
default:{}
}
}
sourceComponent: ColumnLayout {
// Workaround to get these properties in `MainWindow.js`.