From 20010e77ae9b21cdd52c62fa15b9b5c6b6a21e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Tue, 21 Jan 2025 23:57:58 +0100 Subject: [PATCH] iCloud special imap handling. --- .../Interfaces/IDialogServiceBase.cs | 2 +- ...ialog.cs => IImapAccountCreationDialog.cs} | 2 +- .../ISpecialImapProviderConfigResolver.cs | 10 ++ .../Accounts/AccountCreationDialogResult.cs | 2 +- .../Accounts/SpecialImapProviderDetails.cs | 6 + .../AccountCreationDialogControl.xaml | 132 ++++++++++++++++++ .../AccountCreationDialogControl.xaml.cs | 76 ++++++++++ .../Dialogs/AccountCreationDialog.xaml | 125 ++--------------- .../Dialogs/AccountCreationDialog.xaml.cs | 66 +++++---- .../Dialogs/BaseAccountCreationDialog.cs | 60 -------- Wino.Core.UWP/Dialogs/NewAccountDialog.xaml | 22 ++- .../Dialogs/NewAccountDialog.xaml.cs | 18 ++- Wino.Core.UWP/Services/DialogServiceBase.cs | 2 +- Wino.Core.UWP/Wino.Core.UWP.csproj | 8 +- Wino.Core/Synchronizers/ImapSynchronizer.cs | 8 ++ .../AccountManagementViewModel.cs | 65 ++++++--- Wino.Mail/Dialogs/NewImapSetupDialog.xaml.cs | 5 +- Wino.Mail/Services/DialogService.cs | 22 ++- .../ImapSetup/WelcomeImapSetupPage.xaml.cs | 5 + Wino.Services/ServicesContainerSetup.cs | 1 + .../SpecialImapProviderConfigResolver.cs | 46 ++++++ 21 files changed, 433 insertions(+), 250 deletions(-) rename Wino.Core.Domain/Interfaces/{ICustomServerAccountCreationDialog.cs => IImapAccountCreationDialog.cs} (90%) create mode 100644 Wino.Core.Domain/Interfaces/ISpecialImapProviderConfigResolver.cs create mode 100644 Wino.Core.Domain/Models/Accounts/SpecialImapProviderDetails.cs create mode 100644 Wino.Core.UWP/Controls/AccountCreationDialogControl.xaml create mode 100644 Wino.Core.UWP/Controls/AccountCreationDialogControl.xaml.cs delete mode 100644 Wino.Core.UWP/Dialogs/BaseAccountCreationDialog.cs create mode 100644 Wino.Services/SpecialImapProviderConfigResolver.cs diff --git a/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs b/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs index cb86603e..42789f42 100644 --- a/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs +++ b/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs @@ -27,7 +27,7 @@ namespace Wino.Core.Domain.Interfaces string dontAskAgainConfigurationKey = ""); Task ShowCustomThemeBuilderDialogAsync(); Task ShowAccountProviderSelectionDialogAsync(List availableProviders); - IAccountCreationDialog GetAccountCreationDialog(MailProviderType type); + IAccountCreationDialog GetAccountCreationDialog(AccountCreationDialogResult accountCreationDialogResult); Task> PickFilesAsync(params object[] typeFilters); Task PickFilePathAsync(string saveFileName); } diff --git a/Wino.Core.Domain/Interfaces/ICustomServerAccountCreationDialog.cs b/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs similarity index 90% rename from Wino.Core.Domain/Interfaces/ICustomServerAccountCreationDialog.cs rename to Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs index 2bc7f19f..9230aec0 100644 --- a/Wino.Core.Domain/Interfaces/ICustomServerAccountCreationDialog.cs +++ b/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs @@ -3,7 +3,7 @@ using Wino.Core.Domain.Entities.Shared; namespace Wino.Core.Domain.Interfaces { - public interface ICustomServerAccountCreationDialog : IAccountCreationDialog + public interface IImapAccountCreationDialog : IAccountCreationDialog { /// /// Returns the custom server information from the dialog.. diff --git a/Wino.Core.Domain/Interfaces/ISpecialImapProviderConfigResolver.cs b/Wino.Core.Domain/Interfaces/ISpecialImapProviderConfigResolver.cs new file mode 100644 index 00000000..34c35dbe --- /dev/null +++ b/Wino.Core.Domain/Interfaces/ISpecialImapProviderConfigResolver.cs @@ -0,0 +1,10 @@ +using Wino.Core.Domain.Entities.Shared; +using Wino.Core.Domain.Models.Accounts; + +namespace Wino.Core.Domain.Interfaces +{ + public interface ISpecialImapProviderConfigResolver + { + CustomServerInformation GetServerInformation(MailAccount account, AccountCreationDialogResult dialogResult); + } +} diff --git a/Wino.Core.Domain/Models/Accounts/AccountCreationDialogResult.cs b/Wino.Core.Domain/Models/Accounts/AccountCreationDialogResult.cs index 428d1307..961a0d1a 100644 --- a/Wino.Core.Domain/Models/Accounts/AccountCreationDialogResult.cs +++ b/Wino.Core.Domain/Models/Accounts/AccountCreationDialogResult.cs @@ -2,5 +2,5 @@ namespace Wino.Core.Domain.Models.Accounts { - public record AccountCreationDialogResult(MailProviderType ProviderType, string AccountName, string AccountColorHex = ""); + public record AccountCreationDialogResult(MailProviderType ProviderType, string AccountName, SpecialImapProviderDetails SpecialImapProviderDetails); } diff --git a/Wino.Core.Domain/Models/Accounts/SpecialImapProviderDetails.cs b/Wino.Core.Domain/Models/Accounts/SpecialImapProviderDetails.cs new file mode 100644 index 00000000..5f3b489c --- /dev/null +++ b/Wino.Core.Domain/Models/Accounts/SpecialImapProviderDetails.cs @@ -0,0 +1,6 @@ +using Wino.Core.Domain.Enums; + +namespace Wino.Core.Domain.Models.Accounts +{ + public record SpecialImapProviderDetails(string Address, string Password, string SenderName, SpecialImapProvider SpecialImapProvider); +} diff --git a/Wino.Core.UWP/Controls/AccountCreationDialogControl.xaml b/Wino.Core.UWP/Controls/AccountCreationDialogControl.xaml new file mode 100644 index 00000000..ae38dd73 --- /dev/null +++ b/Wino.Core.UWP/Controls/AccountCreationDialogControl.xaml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + - -