Reworked IMAP setup flow. Implemented easy way to share protocol log on failure if possible.

This commit is contained in:
Burak Kaan Köse
2024-06-17 02:16:06 +02:00
parent a788b1706b
commit 49afed7751
24 changed files with 1000 additions and 331 deletions

View File

@@ -9,13 +9,14 @@ using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Models.Accounts;
using Wino.Core.Domain.Models.AutoDiscovery;
using Wino.Core.Messages.Mails;
using Wino.Extensions;
namespace Wino.Views.ImapSetup
{
public sealed partial class AdvancedImapSetupPage : Page
{
private string _protocolLog;
public List<ImapAuthenticationMethodModel> AvailableAuthenticationMethods { get; } = new List<ImapAuthenticationMethodModel>()
{
new ImapAuthenticationMethodModel(Core.Domain.Enums.ImapAuthenticationMethod.Auto, Translator.ImapAuthenticationMethod_Auto),
@@ -76,6 +77,8 @@ namespace Wino.Views.ImapSetup
{
base.OnNavigatedTo(e);
// ProtocolLogGrid.Visibility = Visibility.Collapsed;
// Connection is succesfull but error occurred.
// Imap and Smptp settings exists here at this point.
@@ -93,12 +96,8 @@ namespace Wino.Views.ImapSetup
IncomingServerBox.Text = serverInfo.IncomingServer;
IncomingServerPortBox.Text = serverInfo.IncomingServerPort;
OutgoingPasswordBox.Password = serverInfo.OutgoingServerPassword;
OutgoingServerBox.Text = serverInfo.OutgoingServer;
OutgoingServerPort.Text = serverInfo.OutgoingServerPort;
OutgoingUsernameBox.Text = serverInfo.OutgoingServerUsername;
UseSameCredentialsForSending = OutgoingUsernameBox.Text == UsernameBox.Text;
@@ -112,12 +111,6 @@ namespace Wino.Views.ImapSetup
DisplayNameBox.Text = autoDiscoveryMinimalSettings.DisplayName;
PasswordBox.Password = autoDiscoveryMinimalSettings.Password;
}
else if (e.Parameter is AutoDiscoveryConnectionTestFailedPackage failedPackage)
{
ErrorMessage.Text = failedPackage.Error.Message;
MainScrollviewer.ScrollToElement(ErrorMessage);
}
}
private void CancelClicked(object sender, RoutedEventArgs e) => WeakReferenceMessenger.Default.Send(new ImapSetupDismissRequested(null));
@@ -136,8 +129,6 @@ namespace Wino.Views.ImapSetup
private void SignInClicked(object sender, RoutedEventArgs e)
{
ErrorMessage.Text = string.Empty;
var info = new CustomServerInformation()
{
IncomingServer = GetServerWithoutPort(IncomingServerBox.Text),