From 3fc5767c0f66408df0dcf8b33c7db8e1604aeb5f Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 5 Jun 2023 16:50:19 +0200 Subject: [PATCH] Fixes: - Couldn't select the default account without selecting another one before. - Display a message about not having a configured account instead of displaying the local one. Local address can still be accessible from settings if activated. - Display Assistant at home if no account has been set. --- CHANGELOG.md | 3 +++ linphone-app/assets/languages/cs.ts | 8 ++++++++ linphone-app/assets/languages/da.ts | 8 ++++++++ linphone-app/assets/languages/de.ts | 8 ++++++++ linphone-app/assets/languages/en.ts | 8 ++++++++ linphone-app/assets/languages/es.ts | 8 ++++++++ linphone-app/assets/languages/fr_FR.ts | 8 ++++++++ linphone-app/assets/languages/hu.ts | 8 ++++++++ linphone-app/assets/languages/it.ts | 8 ++++++++ linphone-app/assets/languages/ja.ts | 8 ++++++++ linphone-app/assets/languages/lt.ts | 8 ++++++++ linphone-app/assets/languages/pt_BR.ts | 8 ++++++++ linphone-app/assets/languages/ru.ts | 8 ++++++++ linphone-app/assets/languages/sv.ts | 8 ++++++++ linphone-app/assets/languages/tr.ts | 8 ++++++++ linphone-app/assets/languages/uk.ts | 8 ++++++++ linphone-app/assets/languages/zh_CN.ts | 8 ++++++++ .../components/settings/AccountSettingsModel.cpp | 1 + .../ui/modules/Linphone/Account/AccountStatus.qml | 14 ++++++++++---- linphone-app/ui/views/App/Main/MainWindow.qml | 2 +- .../ui/views/App/Settings/SettingsSipAccounts.qml | 3 +++ 21 files changed, 146 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 978597847..e992a1d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Section date timezone and conferences timezone. +- Couldn't select the default account without selecting another one before. +- Display a message about not having a configured account instead of displaying the local one. Local address can still be accessible from settings if activated. +- Display Assistant at home if no account has been set. - Update SDK to 5.2.67 (Mac crash on resources) ## 5.0.16 - 2023-05-12 diff --git a/linphone-app/assets/languages/cs.ts b/linphone-app/assets/languages/cs.ts index 71f94406b..2c0684480 100644 --- a/linphone-app/assets/languages/cs.ts +++ b/linphone-app/assets/languages/cs.ts @@ -13,6 +13,14 @@ Pomozte nám přeložit %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index c6ffac901..ce471871f 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -13,6 +13,14 @@ Hjælp os at oversætte %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index 64937557a..ef46d724d 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -13,6 +13,14 @@ Helfen Sie uns zu %1 übersetzen + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index aef8ea8f9..d2ce23caf 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -13,6 +13,14 @@ Help us translate %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + No account configured + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index c8793c950..6135219ec 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -13,6 +13,14 @@ Ayúdanos a traducir %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index 6ce26ae27..a0bae6fac 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -13,6 +13,14 @@ Contribuer aux traductions de %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + Aucun compte de configuré + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index b58e14287..d14c4a481 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -13,6 +13,14 @@ + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index a8f77ee36..bdbd96a55 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -13,6 +13,14 @@ Aiutaci a tradurre %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index 59351ef33..9dfd636b0 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -13,6 +13,14 @@ %1 の翻訳に協力する + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index 3b3c3c3f6..8cbc3caa1 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -13,6 +13,14 @@ + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index ae16e7c12..ce3851a4c 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -13,6 +13,14 @@ Nos ajude a traduzir %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index 3de2b8c42..b5a57f92e 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -13,6 +13,14 @@ Помогите нам перевести %1 + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index ef7774b76..9fb36ceea 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -13,6 +13,14 @@ + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 787e7b333..8906850e2 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -13,6 +13,14 @@ %s'u çevirmemize yardım et + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 3e2a5e93e..2b6651f9a 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -13,6 +13,14 @@ + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index bd5884806..18979edd1 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -13,6 +13,14 @@ + + AccountStatus + + noAccount + 'No account configured' : Status text when there is no configured account. + + + ActivateAppSipAccountWithEmail diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index 07c42b52b..b36a2b43f 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -75,6 +75,7 @@ AccountSettingsModel::AccountSettingsModel (QObject *parent) : QObject(parent) { QObject::connect(this, &AccountSettingsModel::accountSettingsUpdated, this, &AccountSettingsModel::primaryUsernameChanged); QObject::connect(this, &AccountSettingsModel::accountSettingsUpdated, this, &AccountSettingsModel::primarySipAddressChanged); QObject::connect(this, &AccountSettingsModel::accountSettingsUpdated, this, &AccountSettingsModel::accountsChanged); + mSelectedAccount = coreManager->getCore()->getDefaultAccount(); } // ----------------------------------------------------------------------------- diff --git a/linphone-app/ui/modules/Linphone/Account/AccountStatus.qml b/linphone-app/ui/modules/Linphone/Account/AccountStatus.qml index a3931e9d5..12c107cfc 100644 --- a/linphone-app/ui/modules/Linphone/Account/AccountStatus.qml +++ b/linphone-app/ui/modules/Linphone/Account/AccountStatus.qml @@ -18,6 +18,7 @@ Item { signal clicked property alias cursorShape:mouseArea.cursorShape property alias betterIcon : presenceLevel.betterIcon + property bool noAccountConfigured: AccountSettingsModel.accounts.length <= ((SettingsModel.showLocalSipAccount ? 1 : 0)) // --------------------------------------------------------------------------- MouseArea { @@ -42,7 +43,7 @@ Item { Layout.bottomMargin: AccountStatusStyle.presenceLevel.bottomMargin Layout.preferredHeight: AccountStatusStyle.presenceLevel.size Layout.preferredWidth: AccountStatusStyle.presenceLevel.size - + visible: !accountStatus.noAccountConfigured PresenceLevel { id:presenceLevel anchors.fill:parent @@ -68,20 +69,24 @@ Item { Text { id:username - Layout.alignment: Qt.AlignBottom | Qt.AlignLeft + Layout.fillWidth: true + Layout.alignment: accountStatus.noAccountConfigured ? Qt.AlignVCenter | Qt.AlignLeft: Qt.AlignBottom | Qt.AlignLeft color: AccountStatusStyle.username.colorModel.color elide: Text.ElideRight font.bold: true font.pointSize: AccountStatusStyle.username.pointSize - text: UtilsCpp.encodeTextToQmlRichFormat(AccountSettingsModel.username) - textFormat: Text.RichText + //: 'No account configured' : Status text when there is no configured account. + text: accountStatus.noAccountConfigured ? qsTr('noAccount'): AccountSettingsModel.username verticalAlignment: Text.AlignBottom + wrapMode: Text.WordWrap + maximumLineCount: 3 } Item { Layout.alignment: Qt.AlignBottom | Qt.AlignLeft Layout.bottomMargin: 5 Layout.preferredHeight: AccountStatusStyle.presenceLevel.size Layout.preferredWidth: AccountStatusStyle.presenceLevel.size + visible: !accountStatus.noAccountConfigured MessageCounter { id: messageCounter anchors.fill: parent @@ -101,6 +106,7 @@ Item { Text { Layout.preferredHeight:parent.height / 2 Layout.preferredWidth:parent.width + visible: !accountStatus.noAccountConfigured color: AccountStatusStyle.sipAddress.colorModel.color elide: Text.ElideRight font.pointSize: AccountStatusStyle.sipAddress.pointSize diff --git a/linphone-app/ui/views/App/Main/MainWindow.qml b/linphone-app/ui/views/App/Main/MainWindow.qml index 259ac1aec..e1af52017 100644 --- a/linphone-app/ui/views/App/Main/MainWindow.qml +++ b/linphone-app/ui/views/App/Main/MainWindow.qml @@ -401,7 +401,7 @@ ApplicationWindow { anchors.fill: parent source: 'Home.qml' - Component.onCompleted: if (AccountSettingsModel.accounts.length < 2) source= 'Assistant.qml' // default proxy = 1. Do not use this set diretly in source because of bindings that will override next setSource + Component.onCompleted: if(accountStatus.noAccountConfigured) source= 'Assistant.qml' // default proxy = 1. Do not use this set diretly in source because of bindings that will override next setSource } TelKeypad { anchors.right: parent.right diff --git a/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml b/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml index 011db4733..5b41d4a12 100644 --- a/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml +++ b/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml @@ -24,6 +24,7 @@ TabContainer { width: parent.width FormLine { + visible: SettingsModel.showLocalSipAccount FormGroup { label: qsTr('defaultDisplayNameLabel') @@ -36,6 +37,7 @@ TabContainer { } FormLine { + visible: SettingsModel.showLocalSipAccount FormGroup { label: qsTr('defaultUsernameLabel') @@ -48,6 +50,7 @@ TabContainer { } FormLine { + visible: SettingsModel.showLocalSipAccount FormGroup { label: qsTr('defaultSipAddressLabel')