diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index 2f608288c..33284f969 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -146,6 +146,11 @@ createAppSipAccount OPRET EN %1 KONTO + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index d9e88d513..dd17cb25d 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -146,6 +146,11 @@ createAppSipAccount %1-KONTO ERSTELLEN + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 66291e80b..57add1415 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -146,6 +146,11 @@ createAppSipAccount CREATE A %1 ACCOUNT + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + I accept %1's %2terms of use%3 and %4privacy policy%5 + AssistantModel diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index c1ff1207e..7180e3972 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -146,6 +146,11 @@ createAppSipAccount CREAR UNA CUENTA %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index 5f579423b..fc68bcf53 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -146,6 +146,11 @@ createAppSipAccount CRÉER UN COMPTE %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + J'accepte %2les conditions d'utilisation%3 et %4la politique de confidentialité%5 de %1 + AssistantModel diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index 865fffc5a..fdc5a3dff 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -146,6 +146,11 @@ createAppSipAccount Készítsen egy %1 fiók + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 9523a6328..6525e0eb8 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -146,6 +146,11 @@ createAppSipAccount CREA UN ACCOUNT %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index ffd90056d..44a2f708e 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -146,6 +146,11 @@ createAppSipAccount %1アカウントを作成する + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index a308aadee..26624c7e5 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -146,6 +146,11 @@ createAppSipAccount SUSIKURTI %1 PASKYRĄ + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index 9e5e396c7..aea4c85a9 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -146,6 +146,11 @@ createAppSipAccount CRIAR UMA CONTA %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index e7eb5370a..f4c2e5b65 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -146,6 +146,11 @@ createAppSipAccount СОЗДАТЬ АККАУНТ %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 15ee30a4d..0aad02719 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -146,6 +146,11 @@ createAppSipAccount SKAPA ETT %1-KONTO + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index fe0251ade..0b79ae8f1 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -146,6 +146,11 @@ createAppSipAccount %1 HESABI OLUŞTUR + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 7c73bfc5c..bf039e169 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -146,6 +146,11 @@ createAppSipAccount СТВОРИТИ ОБЛІКІВКУ %1 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index c95631dad..530ccc237 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -146,6 +146,11 @@ createAppSipAccount 创建一个 %1 账户 + + homeCgu + 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + + AssistantModel diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 59f20c643..8860231d4 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -190,6 +190,15 @@ void SettingsModel::setAssistantLogoutUrl (QString url) { emit assistantLogoutUrlChanged(url); } +bool SettingsModel::isCguAccepted () const{ + return !!mConfig->getInt(UiSection, "read_and_agree_terms_and_privacy", 0); +} + +void SettingsModel::acceptCgu(const bool accept){ + mConfig->setInt(UiSection, "read_and_agree_terms_and_privacy", accept); + emit cguAcceptedChanged(accept); +} + // ============================================================================= // SIP Accounts. // ============================================================================= diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 746377155..d6f4139c3 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -52,6 +52,8 @@ class SettingsModel : public QObject { Q_PROPERTY(QString assistantLoginUrl READ getAssistantLoginUrl WRITE setAssistantLoginUrl NOTIFY assistantLoginUrlChanged) Q_PROPERTY(QString assistantLogoutUrl READ getAssistantLogoutUrl WRITE setAssistantLogoutUrl NOTIFY assistantLogoutUrlChanged) + Q_PROPERTY(bool cguAccepted READ isCguAccepted WRITE acceptCgu NOTIFY cguAcceptedChanged) + // SIP Accounts. ------------------------------------------------------------- Q_PROPERTY(QString deviceName READ getDeviceName WRITE setDeviceName NOTIFY deviceNameChanged) @@ -253,6 +255,9 @@ public: QString getAssistantLogoutUrl () const; void setAssistantLogoutUrl (QString url); + bool isCguAccepted () const; + void acceptCgu(const bool accept); + // SIP Accounts. ------------------------------------------------------------- static QString getDeviceName(const std::shared_ptr& config); @@ -561,6 +566,8 @@ signals: void assistantLoginUrlChanged (QString url); void assistantLogoutUrlChanged (QString url); + void cguAcceptedChanged(bool accepted); + // SIP Accounts. ------------------------------------------------------------- void deviceNameChanged(); diff --git a/linphone-app/src/utils/Constants.cpp b/linphone-app/src/utils/Constants.cpp index 14971cb8f..016bc1319 100644 --- a/linphone-app/src/utils/Constants.cpp +++ b/linphone-app/src/utils/Constants.cpp @@ -107,6 +107,8 @@ constexpr int Constants::DefaultExpires; constexpr char Constants::DownloadUrl[]; constexpr char Constants::VersionCheckUrl[]; constexpr char Constants::PasswordRecoveryUrl[]; +constexpr char Constants::CguUrl[]; +constexpr char Constants::PrivatePolicyUrl[]; constexpr char Constants::LinphoneBZip2_exe[]; diff --git a/linphone-app/src/utils/Constants.hpp b/linphone-app/src/utils/Constants.hpp index 565dae2ae..ba4c7e7a1 100644 --- a/linphone-app/src/utils/Constants.hpp +++ b/linphone-app/src/utils/Constants.hpp @@ -57,6 +57,8 @@ public: static constexpr char DownloadUrl[] = "https://www.linphone.org/technical-corner/linphone"; static constexpr char VersionCheckUrl[] = "https://linphone.org/releases"; static constexpr char PasswordRecoveryUrl[] = "https://subscribe.linphone.org/login"; + static constexpr char CguUrl[] = "https://www.linphone.org/general-terms"; + static constexpr char PrivatePolicyUrl[] = "https://www.linphone.org/privacy-policy"; static constexpr char LinphoneBZip2_exe[] = "http://www.linphone.org/releases/windows/tools/bzip2/bzip2.exe"; static constexpr char LinphoneBZip2_dll[] = "http://www.linphone.org/releases/windows/tools/bzip2/bzip2.dll"; @@ -67,6 +69,8 @@ public: static constexpr char RemoteProvisioningURL[] = "https://subscribe.linphone.org/flexiapi/provisioning"; Q_PROPERTY(QString PasswordRecoveryUrl MEMBER PasswordRecoveryUrl CONSTANT) + Q_PROPERTY(QString CguUrl MEMBER CguUrl CONSTANT) + Q_PROPERTY(QString PrivatePolicyUrl MEMBER PrivatePolicyUrl CONSTANT) static constexpr char DefaultAssistantRegistrationUrl[] = "https://subscribe.linphone.org/register"; static constexpr char DefaultAssistantLoginUrl[] = "https://subscribe.linphone.org/login"; static constexpr char DefaultAssistantLogoutUrl[] = "https://subscribe.linphone.org/logout"; diff --git a/linphone-app/ui/modules/Common/Form/CheckBoxText.qml b/linphone-app/ui/modules/Common/Form/CheckBoxText.qml index da0280341..bb3f05feb 100644 --- a/linphone-app/ui/modules/Common/Form/CheckBoxText.qml +++ b/linphone-app/ui/modules/Common/Form/CheckBoxText.qml @@ -29,6 +29,13 @@ CheckBox { wrapMode: Text.WordWrap verticalAlignment: Text.AlignVCenter + onLinkActivated: Qt.openUrlExternally(link) + MouseArea { + id: mouseArea + anchors.fill: parent + cursorShape: parent.hoveredLink != '' ? Qt.PointingHandCursor : Qt.ArrowCursor + acceptedButtons: Qt.NoButton + } } font.pointSize: CheckBoxTextStyle.pointSize diff --git a/linphone-app/ui/views/App/Main/Assistant/AssistantHome.qml b/linphone-app/ui/views/App/Main/Assistant/AssistantHome.qml index 6986ed202..21e3e8d0e 100644 --- a/linphone-app/ui/views/App/Main/Assistant/AssistantHome.qml +++ b/linphone-app/ui/views/App/Main/Assistant/AssistantHome.qml @@ -3,130 +3,150 @@ import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 +import ConstantsCpp 1.0 import App.Styles 1.0 // ============================================================================= ColumnLayout { - spacing: 0 - - // --------------------------------------------------------------------------- - // Info. - // --------------------------------------------------------------------------- - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - - Column { - anchors.verticalCenter: parent.verticalCenter - spacing: 0 - - height: AssistantHomeStyle.info.height - width: parent.width - - Icon { - anchors.horizontalCenter: parent.horizontalCenter - - icon: 'home_account_assistant' - iconSize: AssistantHomeStyle.info.iconSize - } - - Text { - height: AssistantHomeStyle.info.title.height - width: parent.width - - color: AssistantHomeStyle.info.title.color - elide: Text.ElideRight - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - font { - bold: true - pointSize: AssistantHomeStyle.info.title.pointSize - } - - text: qsTr('homeTitle') - } - - Text { - height: AssistantHomeStyle.info.description.height - width: parent.width - - color: AssistantHomeStyle.info.description.color - elide: Text.ElideRight - font.pointSize: AssistantHomeStyle.info.description.pointSize - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - - text: qsTr('homeDescription') - } - } - } - - // --------------------------------------------------------------------------- - // Buttons. - // --------------------------------------------------------------------------- - - GridView { - id: buttons - - Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - Layout.maximumWidth: AssistantHomeStyle.buttons.maxWidth - Layout.preferredHeight: AssistantHomeStyle.buttons.height - Layout.leftMargin: AssistantStyle.leftMargin - Layout.rightMargin: AssistantStyle.rightMargin - Layout.bottomMargin: AssistantStyle.bottomMargin - - cellHeight: height / 2 - cellWidth: width / 2 - - delegate: Item { - height: buttons.cellHeight - width: buttons.cellWidth - - TextButtonA { - anchors { - fill: parent - margins: AssistantHomeStyle.buttons.spacing - } - - enabled: SettingsModel[$viewType.charAt(0).toLowerCase() + $viewType.slice(1) + "Enabled"] - text: $text.replace('%1', Qt.application.name.toUpperCase()) - - onClicked:{ assistant.pushView($view, $props) } - } - } - - model: ListModel { - Component.onCompleted: { - insert(0, { - $text: qsTr('createAppSipAccount'), - $view: 'CreateAppSipAccount', - $viewType: 'CreateAppSipAccount', - $props:{defaultUrl: SettingsModel.assistantRegistrationUrl, defaultLogoutUrl:SettingsModel.assistantLogoutUrl, configFilename: 'create-app-sip-account.rc'} - }) - append({ - $text: qsTr('useAppSipAccount'), - $view: 'CreateAppSipAccount', - $viewType: 'UseAppSipAccount', - $props:{defaultUrl: SettingsModel.assistantLoginUrl, defaultLogoutUrl:SettingsModel.assistantLogoutUrl, configFilename: 'use-app-sip-account.rc'} - }) - append({ - $text: qsTr('useOtherSipAccount'), - $view: 'UseOtherSipAccount', - $viewType: 'UseOtherSipAccount' - }) - append( { - $text: qsTr('fetchRemoteConfiguration'), - $view: 'FetchRemoteConfiguration', - $viewType: 'FetchRemoteConfiguration' - }) - } - } - - interactive: false - } + spacing: 0 + + // --------------------------------------------------------------------------- + // Info. + // --------------------------------------------------------------------------- + + Item { + id: infoItem + Layout.fillHeight: true + Layout.fillWidth: true + + ColumnLayout { + anchors.verticalCenter: parent.verticalCenter + spacing: 0 + + height: AssistantHomeStyle.info.height + width: parent.width + + Icon { + //anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment: Qt.AlignHCenter + + icon: 'home_account_assistant' + iconSize: AssistantHomeStyle.info.iconSize + } + + Text { + height: AssistantHomeStyle.info.title.height + Layout.fillWidth: true + //width: parent.width + + color: AssistantHomeStyle.info.title.color + elide: Text.ElideRight + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + font { + bold: true + pointSize: AssistantHomeStyle.info.title.pointSize + } + + text: qsTr('homeTitle') + } + + Text { + height: AssistantHomeStyle.info.description.height + Layout.fillWidth: true + //width: parent.width + + color: AssistantHomeStyle.info.description.color + elide: Text.ElideRight + font.pointSize: AssistantHomeStyle.info.description.pointSize + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + text: qsTr('homeDescription') + } + + CheckBoxText{ + id: cguCheckBox + Layout.topMargin: 10 + Layout.maximumWidth: infoItem.width + Layout.alignment: Qt.AlignHCenter + visible: applicationVendor != '' && ConstantsCpp.CguUrl != '' && ConstantsCpp.PrivatePolicyUrl != '' + checked: SettingsModel.cguAccepted + onCheckedChanged: SettingsModel.cguAccepted = checked + + //: 'I accept %1's %2terms of use%3 and %4privacy policy%5' : where %1 is the vendor name and other %n are internal keywords that encapsulate links. + text: qsTr('homeCgu').arg(applicationVendor).arg('< a href="'+ConstantsCpp.CguUrl+'">').arg('').arg('').arg('') + } + } + } + + // --------------------------------------------------------------------------- + // Buttons. + // --------------------------------------------------------------------------- + + GridView { + id: buttons + + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + Layout.maximumWidth: AssistantHomeStyle.buttons.maxWidth + Layout.preferredHeight: AssistantHomeStyle.buttons.height + Layout.leftMargin: AssistantStyle.leftMargin + Layout.rightMargin: AssistantStyle.rightMargin + Layout.bottomMargin: AssistantStyle.bottomMargin + + cellHeight: height / 2 + cellWidth: width / 2 + enabled: cguCheckBox.checked + + delegate: Item { + height: buttons.cellHeight + width: buttons.cellWidth + + TextButtonA { + anchors { + fill: parent + margins: AssistantHomeStyle.buttons.spacing + } + + enabled: cguCheckBox.checked && SettingsModel[$viewType.charAt(0).toLowerCase() + $viewType.slice(1) + "Enabled"] + text: $text.replace('%1', Qt.application.name.toUpperCase()) + + onClicked:{ assistant.pushView($view, $props) } + } + } + + model: ListModel { + Component.onCompleted: { + insert(0, { + $text: qsTr('createAppSipAccount'), + $view: 'CreateAppSipAccount', + $viewType: 'CreateAppSipAccount', + $props:{defaultUrl: SettingsModel.assistantRegistrationUrl, defaultLogoutUrl:SettingsModel.assistantLogoutUrl, configFilename: 'create-app-sip-account.rc'} + }) + append({ + $text: qsTr('useAppSipAccount'), + $view: 'CreateAppSipAccount', + $viewType: 'UseAppSipAccount', + $props:{defaultUrl: SettingsModel.assistantLoginUrl, defaultLogoutUrl:SettingsModel.assistantLogoutUrl, configFilename: 'use-app-sip-account.rc'} + }) + append({ + $text: qsTr('useOtherSipAccount'), + $view: 'UseOtherSipAccount', + $viewType: 'UseOtherSipAccount' + }) + append( { + $text: qsTr('fetchRemoteConfiguration'), + $view: 'FetchRemoteConfiguration', + $viewType: 'FetchRemoteConfiguration' + }) + } + } + + interactive: false + } } diff --git a/linphone-sdk b/linphone-sdk index 9cc416ad8..0a4f40d12 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 9cc416ad81725beb1d04baa9c6e1dc3d23db11ac +Subproject commit 0a4f40d12d3573d0e6b981f637209b23fb11d0a9