From d3ab7712840148dc5ed651f086573d2d4c622a3d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 26 Apr 2017 17:18:50 +0200 Subject: [PATCH] chore(assets): provide rc files for assistant --- linphone-desktop/CMakeLists.txt | 13 ++++++++ .../assistant/create-linphone-sip-account.rc | 29 ++++++++++++++++++ .../assistant/use-linphone-sip-account.rc | 30 +++++++++++++++++++ .../assets/assistant/use-other-sip-account.rc | 26 ++++++++++++++++ .../components/assistant/AssistantModel.cpp | 7 +++-- .../CreateLinphoneSipAccountWithEmail.qml | 2 ++ ...reateLinphoneSipAccountWithPhoneNumber.qml | 2 ++ .../Main/Assistant/UseLinphoneSipAccount.qml | 2 ++ 8 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 linphone-desktop/assets/assistant/create-linphone-sip-account.rc create mode 100644 linphone-desktop/assets/assistant/use-linphone-sip-account.rc create mode 100644 linphone-desktop/assets/assistant/use-other-sip-account.rc diff --git a/linphone-desktop/CMakeLists.txt b/linphone-desktop/CMakeLists.txt index 00fcff17b..6a11b0417 100644 --- a/linphone-desktop/CMakeLists.txt +++ b/linphone-desktop/CMakeLists.txt @@ -281,3 +281,16 @@ install(TARGETS ${TARGET_NAME} install(FILES "${ASSETS_DIR}/linphonerc-factory" DESTINATION "${CMAKE_INSTALL_DATADIR}/linphone" ) + +set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant") +set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/assistant") + +install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}/use-other-sip-account.rc" +) +install(FILES "${ASSETS_ASSISTANT_DIR}/create-linphone-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}/create-linphone-sip-account.rc" +) +install(FILES "${ASSETS_ASSISTANT_DIR}/use-linphone-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}/use-linphone-sip-account.rc" +) diff --git a/linphone-desktop/assets/assistant/create-linphone-sip-account.rc b/linphone-desktop/assets/assistant/create-linphone-sip-account.rc new file mode 100644 index 000000000..c8e177d3c --- /dev/null +++ b/linphone-desktop/assets/assistant/create-linphone-sip-account.rc @@ -0,0 +1,29 @@ + + +
+ 1 + 0 + 0 + sip:voip-metrics@sip.linphone.org;transport=tls + 1 + 180 + 31536000 + sip:?@sip.linphone.org + <sip:sip.linphone.org;transport=tls> + 1 + push_notification + sip.linphone.org +
+
+ sips:rls@sip.linphone.org +
+
+ sip.linphone.org + -1 + 1 + -1 + 64 + 1 + ^[a-z0-9+_.\-]*$ +
+
diff --git a/linphone-desktop/assets/assistant/use-linphone-sip-account.rc b/linphone-desktop/assets/assistant/use-linphone-sip-account.rc new file mode 100644 index 000000000..a691ac702 --- /dev/null +++ b/linphone-desktop/assets/assistant/use-linphone-sip-account.rc @@ -0,0 +1,30 @@ + + +
+ 1 + 0 + 0 + sip:voip-metrics@sip.linphone.org;transport=tls + 1 + 180 + 31536000 + sip:?@sip.linphone.org + <sip:sip.linphone.org;transport=tls> + 1 + push_notification + sip.linphone.org +
+
+ sips:rls@sip.linphone.org +
+
+ sip.linphone.org + 34 + 1 + -1 + 64 + 1 + ^[a-z0-9+_.\-]*$ + https://subscribe.linphone.org:444/wizard.php +
+
diff --git a/linphone-desktop/assets/assistant/use-other-sip-account.rc b/linphone-desktop/assets/assistant/use-other-sip-account.rc new file mode 100644 index 000000000..3cb23015b --- /dev/null +++ b/linphone-desktop/assets/assistant/use-other-sip-account.rc @@ -0,0 +1,26 @@ + + +
+ 0 + 0 + 3600 + + + + 1 + + +
+
+ +
+
+ + -1 + -1 + -1 + -1 + 1 + .* +
+
diff --git a/linphone-desktop/src/components/assistant/AssistantModel.cpp b/linphone-desktop/src/components/assistant/AssistantModel.cpp index 29f9bb968..4627291c5 100644 --- a/linphone-desktop/src/components/assistant/AssistantModel.cpp +++ b/linphone-desktop/src/components/assistant/AssistantModel.cpp @@ -62,7 +62,9 @@ private: const string & ) override { if (status == linphone::AccountCreatorStatusAccountExist || status == linphone::AccountCreatorStatusAccountExistWithAlias) { - CoreManager::getInstance()->getCore()->addProxyConfig(creator->configure()); + shared_ptr proxyConfig = creator->createProxyConfig(); + Q_ASSERT(proxyConfig != nullptr); + emit mAssistant->loginStatusChanged(""); } else { if (status == linphone::AccountCreatorStatusRequestFailed) @@ -96,7 +98,8 @@ private: const string & ) override { if (status == linphone::AccountCreatorStatusAccountActivated) { - CoreManager::getInstance()->getAccountSettingsModel()->addOrUpdateProxyConfig(creator->configure()); + shared_ptr proxyConfig = creator->createProxyConfig(); + Q_ASSERT(proxyConfig != nullptr); emit mAssistant->activateStatusChanged(""); } else { diff --git a/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml b/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml index defaea67f..e6478f623 100644 --- a/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml +++ b/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithEmail.qml @@ -115,6 +115,8 @@ AssistantAbstractView { AssistantModel { id: assistantModel + configFilename: 'create-linphone-sip-account.rc' + onEmailChanged: emailError = error onPasswordChanged: passwordError = error onUsernameChanged: usernameError = error diff --git a/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml b/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml index 4253f4d2a..af1e0f773 100644 --- a/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml +++ b/linphone-desktop/ui/views/App/Main/Assistant/CreateLinphoneSipAccountWithPhoneNumber.qml @@ -68,6 +68,8 @@ AssistantAbstractView { AssistantModel { id: assistantModel + configFilename: 'create-linphone-sip-account.rc' + onUsernameChanged: usernameError = error onCreateStatusChanged: { diff --git a/linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml b/linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml index b0e17f90c..adda4d7d3 100644 --- a/linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml +++ b/linphone-desktop/ui/views/App/Main/Assistant/UseLinphoneSipAccount.qml @@ -58,6 +58,8 @@ AssistantAbstractView { AssistantModel { id: assistantModel + configFilename: 'use-linphone-sip-account.rc' + onPasswordChanged: { if (checkBox.checked) { loader.item.passwordError = error