diff --git a/Linphone/GeneratedGit.swift b/Linphone/GeneratedGit.swift index 4d93f7b95..621628206 100644 --- a/Linphone/GeneratedGit.swift +++ b/Linphone/GeneratedGit.swift @@ -2,6 +2,6 @@ import Foundation public enum AppGitInfo { public static let branch = "master" - public static let commit = "0f6d8b129" + public static let commit = "f08bb865a" public static let tag = "6.1.0-alpha" } diff --git a/Linphone/Localizable/en.lproj/Localizable.strings b/Linphone/Localizable/en.lproj/Localizable.strings index 6683c717d..f4b9030b4 100644 --- a/Linphone/Localizable/en.lproj/Localizable.strings +++ b/Linphone/Localizable/en.lproj/Localizable.strings @@ -364,6 +364,7 @@ "Interoperable mode" = "Interoperable mode"; "list_filter_no_result_found" = "No result found…"; "manage_account_add_picture" = "Add a picture"; + "manage_account_delete" = "Sign out"; "manage_account_details_title" = "Details"; "manage_account_device_last_connection" = "Last connection:"; @@ -372,6 +373,8 @@ "manage_account_dialog_international_prefix_help_message" = "Pick your country to allow Linphone to match your contacts."; "manage_account_dialog_remove_account_message" = "If you wish to delete your account permanently, go to: https://sip.linphone.org"; "manage_account_dialog_remove_account_title" = "Sign out of your account?"; +"manage_account_outbound_proxy" = "Outbound SIP Proxy"; +"manage_account_dialog_outbound_proxy_help_message" = "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it."; "manage_account_edit_picture" = "Edit picture"; "manage_account_international_prefix" = "International Prefix"; "manage_account_no_device" = "No device found…"; diff --git a/Linphone/Localizable/fr.lproj/Localizable.strings b/Linphone/Localizable/fr.lproj/Localizable.strings index efcaf761b..b5072c4a5 100644 --- a/Linphone/Localizable/fr.lproj/Localizable.strings +++ b/Linphone/Localizable/fr.lproj/Localizable.strings @@ -372,6 +372,8 @@ "manage_account_dialog_international_prefix_help_message" = "Choisissez votre pays pour permettre à Linphone de faire le lien avec vos contacts."; "manage_account_dialog_remove_account_message" = "Si vous souhaitez supprimer définitivement votre compte rendez-vous sur : https://sip.linphone.org"; "manage_account_dialog_remove_account_title" = "Se déconnecter du compte ?"; +"manage_account_outbound_proxy" = "Proxy SIP sortant"; +"manage_account_dialog_outbound_proxy_help_message" = "Si ce champ est rempli, l'outbound proxy sera activé automatiquement. Laissez-le vide pour le désactiver."; "manage_account_edit_picture" = "Modifier"; "manage_account_international_prefix" = "Indicatif international"; "manage_account_no_device" = "Aucun appareil n'a été trouvé…"; diff --git a/Linphone/UI/Assistant/Fragments/ThirdPartySipAccountLoginFragment.swift b/Linphone/UI/Assistant/Fragments/ThirdPartySipAccountLoginFragment.swift index 336c0a0a5..61f9f149b 100644 --- a/Linphone/UI/Assistant/Fragments/ThirdPartySipAccountLoginFragment.swift +++ b/Linphone/UI/Assistant/Fragments/ThirdPartySipAccountLoginFragment.swift @@ -28,8 +28,9 @@ struct ThirdPartySipAccountLoginFragment: View { @Environment(\.dismiss) var dismiss - @State private var isSecured: Bool = true - @State private var advancedSettingsIsOpen: Bool = false + @State private var isSecured = true + @State private var advancedSettingsIsOpen = false + @State private var isShowOutboundProxyPopup = false @FocusState var isNameFocused: Bool @FocusState var isPasswordFocused: Bool @@ -42,41 +43,63 @@ struct ThirdPartySipAccountLoginFragment: View { var body: some View { GeometryReader { geometry in ScrollViewReader { proxy in - if #available(iOS 16.4, *) { - ScrollView(.vertical) { - innerScrollView(geometry: geometry) - } - .scrollBounceBehavior(.basedOnSize) - .onChange(of: isAuthIdFocused) { field in - if field { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { - proxy.scrollTo(2, anchor: .top) + ZStack { + if #available(iOS 16.4, *) { + ScrollView(.vertical) { + innerScrollView(geometry: geometry) + } + .scrollBounceBehavior(.basedOnSize) + .onChange(of: isAuthIdFocused) { field in + if field { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + proxy.scrollTo(2, anchor: .top) + } + } + } + .onChange(of: isOutboundProxyFocused) { field in + if field { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + proxy.scrollTo(2, anchor: .top) + } + } + } + } else { + ScrollView(.vertical) { + innerScrollView(geometry: geometry) + } + .onChange(of: isAuthIdFocused) { field in + if field { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + proxy.scrollTo(2, anchor: .top) + } + } + } + .onChange(of: isOutboundProxyFocused) { field in + if field { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + proxy.scrollTo(2, anchor: .top) + } } } } - .onChange(of: isOutboundProxyFocused) { field in - if field { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { - proxy.scrollTo(2, anchor: .top) - } - } - } - } else { - ScrollView(.vertical) { - innerScrollView(geometry: geometry) - } - .onChange(of: isAuthIdFocused) { field in - if field { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { - proxy.scrollTo(2, anchor: .top) - } - } - } - .onChange(of: isOutboundProxyFocused) { field in - if field { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { - proxy.scrollTo(2, anchor: .top) - } + + if isShowOutboundProxyPopup { + PopupView( + isShowPopup: $isShowOutboundProxyPopup, + title: Text("manage_account_outbound_proxy"), + content: Text("manage_account_dialog_outbound_proxy_help_message"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_understood"), + actionSecondButton: { self.isShowOutboundProxyPopup.toggle() }, + titleThirdButton: nil, + actionThirdButton: {} + ) + .padding(.bottom, keyboard.currentHeight) + .background(.black.opacity(0.65)) + .zIndex(3) + .onTapGesture { + self.isShowOutboundProxyPopup.toggle() } } } @@ -314,9 +337,24 @@ struct ThirdPartySipAccountLoginFragment: View { .padding(.bottom) VStack(alignment: .leading) { - Text("account_settings_outbound_proxy_title") - .default_text_style_700(styleSize: 15) - .padding(.bottom, -5) + HStack { + Text("account_settings_outbound_proxy_title") + .default_text_style_700(styleSize: 15) + .padding(.bottom, -5) + .frame(maxWidth: .infinity, alignment: .leading) + + Button(action: { + self.isShowOutboundProxyPopup = true + }, label: { + Image("info") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.grayMain2c500) + .frame(width: 25, height: 25) + }) + .padding(.trailing, 10) + } + .padding(.bottom, -5) TextField("account_settings_outbound_proxy_title", text: $accountLoginViewModel.outboundProxy) .id(3) diff --git a/Linphone/UI/Main/Settings/Fragments/AccountSettingsFragment.swift b/Linphone/UI/Main/Settings/Fragments/AccountSettingsFragment.swift index 6b0e596e3..d36a1b301 100644 --- a/Linphone/UI/Main/Settings/Fragments/AccountSettingsFragment.swift +++ b/Linphone/UI/Main/Settings/Fragments/AccountSettingsFragment.swift @@ -26,9 +26,10 @@ struct AccountSettingsFragment: View { @Environment(\.dismiss) var dismiss - @State var natPolicySettingsIsOpen: Bool = false - @State var advancedSettingsIsOpen: Bool = false - @State var isSecured: Bool = true + @State private var isSecured = true + @State private var advancedSettingsIsOpen = false + @State private var natPolicySettingsIsOpen = false + @State private var isShowOutboundProxyPopup = false @FocusState var isVoicemailUriFocused: Bool @FocusState var isMwiUriFocused: Bool @@ -356,9 +357,23 @@ struct AccountSettingsFragment: View { } VStack(alignment: .leading) { - Text("account_settings_outbound_proxy_title") - .default_text_style_700(styleSize: 15) - .padding(.bottom, -5) + HStack { + Text("account_settings_outbound_proxy_title") + .default_text_style_700(styleSize: 15) + .padding(.bottom, -5) + .frame(maxWidth: .infinity, alignment: .leading) + + Button(action: { + self.isShowOutboundProxyPopup = true + }, label: { + Image("info") + .renderingMode(.template) + .resizable() + .foregroundStyle(Color.grayMain2c500) + .frame(width: 25, height: 25) + }) + } + .padding(.bottom, -5) TextField("account_settings_outbound_proxy_title", text: $accountSettingsViewModel.outboundProxy) .default_text_style(styleSize: 15) @@ -511,6 +526,25 @@ struct AccountSettingsFragment: View { .background(Color.gray100) } .background(Color.gray100) + + if isShowOutboundProxyPopup { + PopupView( + isShowPopup: $isShowOutboundProxyPopup, + title: Text("manage_account_outbound_proxy"), + content: Text("manage_account_dialog_outbound_proxy_help_message"), + titleFirstButton: nil, + actionFirstButton: {}, + titleSecondButton: Text("dialog_understood"), + actionSecondButton: { self.isShowOutboundProxyPopup.toggle() }, + titleThirdButton: nil, + actionThirdButton: {} + ) + .background(.black.opacity(0.65)) + .zIndex(3) + .onTapGesture { + self.isShowOutboundProxyPopup.toggle() + } + } } .navigationTitle("") .navigationBarHidden(true)