Imap setup simplified and fixed the threading issues.
This commit is contained in:
@@ -16,7 +16,6 @@ using Wino.Core.Domain.Models.Navigation;
|
|||||||
using Wino.Core.Domain.Models.Synchronization;
|
using Wino.Core.Domain.Models.Synchronization;
|
||||||
using Wino.Core.Services;
|
using Wino.Core.Services;
|
||||||
using Wino.Mail.ViewModels.Data;
|
using Wino.Mail.ViewModels.Data;
|
||||||
using Wino.Messaging.Client.Calendar;
|
|
||||||
using Wino.Messaging.Client.Navigation;
|
using Wino.Messaging.Client.Navigation;
|
||||||
using Wino.Messaging.Server;
|
using Wino.Messaging.Server;
|
||||||
|
|
||||||
@@ -319,7 +318,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var minimalSettings = BuildMinimalSettingsOrThrow();
|
var minimalSettings = BuildMinimalSettingsOrThrow();
|
||||||
await AutoDiscoverAndApplySettingsAsync(minimalSettings).ConfigureAwait(false);
|
await AutoDiscoverAndApplySettingsAsync(minimalSettings);
|
||||||
|
|
||||||
_mailDialogService.InfoBarMessage(
|
_mailDialogService.InfoBarMessage(
|
||||||
Translator.IMAPSetupDialog_ValidationSuccess_Title,
|
Translator.IMAPSetupDialog_ValidationSuccess_Title,
|
||||||
@@ -399,7 +398,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await EnsureImapSettingsPreparedAsync().ConfigureAwait(false);
|
await EnsureImapSettingsPreparedAsync();
|
||||||
|
|
||||||
var serverInformation = BuildServerInformation();
|
var serverInformation = BuildServerInformation();
|
||||||
|
|
||||||
@@ -407,12 +406,12 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
ValidateImapSettings(serverInformation);
|
ValidateImapSettings(serverInformation);
|
||||||
ValidateCalendarModeSpecificSettings(serverInformation);
|
ValidateCalendarModeSpecificSettings(serverInformation);
|
||||||
|
|
||||||
await ValidateImapConnectivityAsync(serverInformation).ConfigureAwait(false);
|
await ValidateImapConnectivityAsync(serverInformation);
|
||||||
IsImapValidationSucceeded = true;
|
IsImapValidationSucceeded = true;
|
||||||
|
|
||||||
if (serverInformation.CalendarSupportMode == ImapCalendarSupportMode.CalDav)
|
if (serverInformation.CalendarSupportMode == ImapCalendarSupportMode.CalDav)
|
||||||
{
|
{
|
||||||
await ValidateCalDavConnectivityAsync(serverInformation).ConfigureAwait(false);
|
await ValidateCalDavConnectivityAsync(serverInformation);
|
||||||
IsCalDavValidationSucceeded = true;
|
IsCalDavValidationSucceeded = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -432,7 +431,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await SaveEditFlowAsync(serverInformation).ConfigureAwait(false);
|
await SaveEditFlowAsync(serverInformation);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -654,7 +653,7 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var minimalSettings = BuildMinimalSettingsOrThrow();
|
var minimalSettings = BuildMinimalSettingsOrThrow();
|
||||||
await AutoDiscoverAndApplySettingsAsync(minimalSettings).ConfigureAwait(false);
|
await AutoDiscoverAndApplySettingsAsync(minimalSettings);
|
||||||
|
|
||||||
if (!HasCompleteImapSettings())
|
if (!HasCompleteImapSettings())
|
||||||
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
|
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
|
||||||
@@ -676,22 +675,25 @@ public partial class ImapCalDavSettingsPageViewModel : MailBaseViewModel
|
|||||||
if (serverInformation == null)
|
if (serverInformation == null)
|
||||||
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
|
throw new InvalidOperationException(Translator.Exception_ImapAutoDiscoveryFailed);
|
||||||
|
|
||||||
ApplyServerInformation(serverInformation);
|
await ExecuteUIThread(async () =>
|
||||||
|
|
||||||
if (IsCalendarSupportEnabled && SelectedCalendarSupportMode == ImapCalendarSupportMode.CalDav)
|
|
||||||
{
|
{
|
||||||
var discoveredCalDavUri = await _autoDiscoveryService.DiscoverCalDavServiceUriAsync(minimalSettings.Email).ConfigureAwait(false);
|
ApplyServerInformation(serverInformation);
|
||||||
if (discoveredCalDavUri != null)
|
|
||||||
|
if (IsCalendarSupportEnabled && SelectedCalendarSupportMode == ImapCalendarSupportMode.CalDav)
|
||||||
{
|
{
|
||||||
CalDavServiceUrl = discoveredCalDavUri.ToString();
|
var discoveredCalDavUri = await _autoDiscoveryService.DiscoverCalDavServiceUriAsync(minimalSettings.Email);
|
||||||
|
if (discoveredCalDavUri != null)
|
||||||
|
{
|
||||||
|
CalDavServiceUrl = discoveredCalDavUri.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(CalDavUsername))
|
||||||
|
CalDavUsername = minimalSettings.Email;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(CalDavPassword))
|
||||||
|
CalDavPassword = minimalSettings.Password;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
if (string.IsNullOrWhiteSpace(CalDavUsername))
|
|
||||||
CalDavUsername = minimalSettings.Email;
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(CalDavPassword))
|
|
||||||
CalDavPassword = minimalSettings.Password;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private async Task ValidateImapConnectivityAsync(CustomServerInformation serverInformation)
|
private async Task ValidateImapConnectivityAsync(CustomServerInformation serverInformation)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,267 +4,267 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:abstract="using:Wino.Views.Abstract"
|
xmlns:abstract="using:Wino.Views.Abstract"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:helpers="using:Wino.Helpers"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel
|
<Grid
|
||||||
|
MaxWidth="980"
|
||||||
Padding="36,28,36,36"
|
Padding="36,28,36,36"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Center">
|
||||||
Spacing="24">
|
<StackPanel Spacing="20">
|
||||||
|
<StackPanel Spacing="4">
|
||||||
<!-- Page Header -->
|
<TextBlock
|
||||||
<StackPanel Spacing="4">
|
FontSize="28"
|
||||||
<TextBlock
|
FontWeight="SemiBold"
|
||||||
FontSize="28"
|
Text="{x:Bind ViewModel.PageTitle, Mode=OneWay}" />
|
||||||
FontWeight="SemiBold"
|
<TextBlock
|
||||||
Text="{x:Bind ViewModel.PageTitle, Mode=OneWay}" />
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
<TextBlock
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
Text="{x:Bind ViewModel.SubtitleText, Mode=OneWay}"
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
TextWrapping="WrapWholeWords" />
|
||||||
Text="{x:Bind ViewModel.SubtitleText, Mode=OneWay}"
|
<TextBlock
|
||||||
TextWrapping="WrapWholeWords" />
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
<TextBlock
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
Text="{x:Bind ViewModel.ProviderHint, Mode=OneWay}"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
TextWrapping="WrapWholeWords"
|
||||||
Text="{x:Bind ViewModel.ProviderHint, Mode=OneWay}"
|
Visibility="{x:Bind ViewModel.HasProviderHint, Mode=OneWay}" />
|
||||||
TextWrapping="WrapWholeWords"
|
|
||||||
Visibility="{x:Bind ViewModel.HasProviderHint, Mode=OneWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Setup Mode Selector -->
|
|
||||||
<SelectorBar x:Name="SetupModeSelector" SelectionChanged="OnSetupModeSelectionChanged">
|
|
||||||
<SelectorBarItem Icon="Library" Text="{x:Bind ViewModel.BasicTabText, Mode=OneWay}" />
|
|
||||||
<SelectorBarItem Icon="Setting" Text="{x:Bind ViewModel.AdvancedTabText, Mode=OneWay}" />
|
|
||||||
</SelectorBar>
|
|
||||||
|
|
||||||
<!-- Basic Setup Card -->
|
|
||||||
<Border
|
|
||||||
Padding="20"
|
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
|
||||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="8"
|
|
||||||
Visibility="{x:Bind helpers:XamlHelpers.ReverseBoolToVisibilityConverter(ViewModel.IsAdvancedSetupSelected), Mode=OneWay}">
|
|
||||||
<StackPanel Spacing="16">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="16"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
Text="{x:Bind ViewModel.BasicSectionTitleText, Mode=OneWay}" />
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{x:Bind ViewModel.BasicSectionDescriptionText, Mode=OneWay}"
|
|
||||||
TextWrapping="WrapWholeWords" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Grid ColumnSpacing="12">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBox
|
|
||||||
Grid.Column="0"
|
|
||||||
Header="{x:Bind ViewModel.DisplayNameHeaderText, Mode=OneWay}"
|
|
||||||
PlaceholderText="{x:Bind ViewModel.DisplayNamePlaceholderText, Mode=OneWay}"
|
|
||||||
Text="{x:Bind ViewModel.DisplayName, Mode=TwoWay}" />
|
|
||||||
<TextBox
|
|
||||||
Grid.Column="1"
|
|
||||||
Header="{x:Bind ViewModel.EmailAddressHeaderText, Mode=OneWay}"
|
|
||||||
PlaceholderText="{x:Bind ViewModel.EmailAddressPlaceholderText, Mode=OneWay}"
|
|
||||||
Text="{x:Bind ViewModel.EmailAddress, Mode=TwoWay}" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<PasswordBox Header="{x:Bind ViewModel.PasswordHeaderText, Mode=OneWay}" Password="{x:Bind ViewModel.Password, Mode=TwoWay}" />
|
|
||||||
|
|
||||||
<CheckBox Content="{x:Bind ViewModel.EnableCalendarSupportText, Mode=OneWay}" IsChecked="{x:Bind ViewModel.IsCalendarSupportEnabled, Mode=TwoWay}" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Command="{x:Bind ViewModel.AutoDiscoverSettingsCommand}"
|
|
||||||
Content="{x:Bind ViewModel.AutoDiscoverButtonText, Mode=OneWay}"
|
|
||||||
Style="{ThemeResource AccentButtonStyle}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Advanced Setup Card -->
|
<Border
|
||||||
<Border
|
Padding="20"
|
||||||
Padding="20"
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
BorderThickness="1"
|
||||||
BorderThickness="1"
|
CornerRadius="8">
|
||||||
CornerRadius="8"
|
<StackPanel Spacing="16">
|
||||||
Visibility="{x:Bind helpers:XamlHelpers.ReverseBoolToVisibilityConverter(ViewModel.IsBasicSetupSelected), Mode=OneWay}">
|
<StackPanel Spacing="2">
|
||||||
<StackPanel Spacing="20">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="16"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
Text="{x:Bind ViewModel.AdvancedSectionTitleText, Mode=OneWay}" />
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{x:Bind ViewModel.AdvancedSectionDescriptionText, Mode=OneWay}"
|
|
||||||
TextWrapping="WrapWholeWords" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Grid ColumnSpacing="24">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<!-- Incoming (IMAP) Settings -->
|
|
||||||
<Border
|
|
||||||
Padding="16"
|
|
||||||
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
|
||||||
CornerRadius="6">
|
|
||||||
<StackPanel Spacing="10">
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<FontIcon FontSize="14" Glyph="" />
|
|
||||||
<TextBlock FontWeight="SemiBold" Text="{x:Bind ViewModel.IncomingSectionTitleText, Mode=OneWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
<TextBox Header="{x:Bind ViewModel.IncomingServerHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServer, Mode=TwoWay}" />
|
|
||||||
<TextBox Header="{x:Bind ViewModel.PortHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServerPort, Mode=TwoWay}" />
|
|
||||||
<TextBox Header="{x:Bind ViewModel.IncomingUsernameHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServerUsername, Mode=TwoWay}" />
|
|
||||||
<PasswordBox Header="{x:Bind ViewModel.IncomingPasswordHeaderText, Mode=OneWay}" Password="{x:Bind ViewModel.IncomingServerPassword, Mode=TwoWay}" />
|
|
||||||
<ComboBox
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Header="{x:Bind ViewModel.ConnectionSecurityHeaderText, Mode=OneWay}"
|
|
||||||
ItemsSource="{x:Bind ViewModel.AvailableConnectionSecurityDisplayNames}"
|
|
||||||
SelectedIndex="{x:Bind ViewModel.SelectedIncomingServerConnectionSecurityIndex, Mode=TwoWay}" />
|
|
||||||
<ComboBox
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Header="{x:Bind ViewModel.AuthenticationMethodHeaderText, Mode=OneWay}"
|
|
||||||
ItemsSource="{x:Bind ViewModel.AvailableAuthenticationMethodDisplayNames}"
|
|
||||||
SelectedIndex="{x:Bind ViewModel.SelectedIncomingServerAuthenticationMethodIndex, Mode=TwoWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Outgoing (SMTP) Settings -->
|
|
||||||
<Border
|
|
||||||
Grid.Column="1"
|
|
||||||
Padding="16"
|
|
||||||
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
|
||||||
CornerRadius="6">
|
|
||||||
<StackPanel Spacing="10">
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<FontIcon FontSize="14" Glyph="" />
|
|
||||||
<TextBlock FontWeight="SemiBold" Text="{x:Bind ViewModel.OutgoingSectionTitleText, Mode=OneWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
<TextBox Header="{x:Bind ViewModel.OutgoingServerHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServer, Mode=TwoWay}" />
|
|
||||||
<TextBox Header="{x:Bind ViewModel.PortHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServerPort, Mode=TwoWay}" />
|
|
||||||
<TextBox Header="{x:Bind ViewModel.OutgoingUsernameHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServerUsername, Mode=TwoWay}" />
|
|
||||||
<PasswordBox Header="{x:Bind ViewModel.OutgoingPasswordHeaderText, Mode=OneWay}" Password="{x:Bind ViewModel.OutgoingServerPassword, Mode=TwoWay}" />
|
|
||||||
<ComboBox
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Header="{x:Bind ViewModel.ConnectionSecurityHeaderText, Mode=OneWay}"
|
|
||||||
ItemsSource="{x:Bind ViewModel.AvailableConnectionSecurityDisplayNames}"
|
|
||||||
SelectedIndex="{x:Bind ViewModel.SelectedOutgoingServerConnectionSecurityIndex, Mode=TwoWay}" />
|
|
||||||
<ComboBox
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Header="{x:Bind ViewModel.AuthenticationMethodHeaderText, Mode=OneWay}"
|
|
||||||
ItemsSource="{x:Bind ViewModel.AvailableAuthenticationMethodDisplayNames}"
|
|
||||||
SelectedIndex="{x:Bind ViewModel.SelectedOutgoingServerAuthenticationMethodIndex, Mode=TwoWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Calendar Settings Card -->
|
|
||||||
<Border
|
|
||||||
Padding="20"
|
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
|
||||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="8">
|
|
||||||
<StackPanel Spacing="16">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<FontIcon FontSize="16" Glyph="" />
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Text="{x:Bind ViewModel.CalendarSectionTitleText, Mode=OneWay}" />
|
Text="{x:Bind ViewModel.BasicSectionTitleText, Mode=OneWay}" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{x:Bind ViewModel.BasicSectionDescriptionText, Mode=OneWay}"
|
||||||
|
TextWrapping="WrapWholeWords" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="12" RowSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Header="{x:Bind ViewModel.DisplayNameHeaderText, Mode=OneWay}"
|
||||||
|
PlaceholderText="{x:Bind ViewModel.DisplayNamePlaceholderText, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.DisplayName, Mode=TwoWay}" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Header="{x:Bind ViewModel.EmailAddressHeaderText, Mode=OneWay}"
|
||||||
|
PlaceholderText="{x:Bind ViewModel.EmailAddressPlaceholderText, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.EmailAddress, Mode=TwoWay}" />
|
||||||
|
<PasswordBox
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Header="{x:Bind ViewModel.PasswordHeaderText, Mode=OneWay}"
|
||||||
|
Password="{x:Bind ViewModel.Password, Mode=TwoWay}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
Content="{x:Bind ViewModel.EnableCalendarSupportText, Mode=OneWay}"
|
||||||
|
IsChecked="{x:Bind ViewModel.IsCalendarSupportEnabled, Mode=TwoWay}" />
|
||||||
|
|
||||||
|
<StackPanel Spacing="8">
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{x:Bind ViewModel.AdvancedSectionDescriptionText, Mode=OneWay}"
|
||||||
|
TextWrapping="WrapWholeWords" />
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Command="{x:Bind ViewModel.AutoDiscoverSettingsCommand}"
|
||||||
|
Content="{x:Bind ViewModel.AutoDiscoverButtonText, Mode=OneWay}"
|
||||||
|
Style="{ThemeResource AccentButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Padding="20"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="8">
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<StackPanel Spacing="2">
|
||||||
|
<TextBlock
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="{x:Bind ViewModel.AdvancedSectionTitleText, Mode=OneWay}" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{x:Bind ViewModel.AdvancedSectionDescriptionText, Mode=OneWay}"
|
||||||
|
TextWrapping="WrapWholeWords" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="16">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||||
|
CornerRadius="6">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<FontIcon FontSize="14" Glyph="" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="{x:Bind ViewModel.IncomingSectionTitleText, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBox Header="{x:Bind ViewModel.IncomingServerHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServer, Mode=TwoWay}" />
|
||||||
|
<TextBox Header="{x:Bind ViewModel.PortHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServerPort, Mode=TwoWay}" />
|
||||||
|
<TextBox Header="{x:Bind ViewModel.IncomingUsernameHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.IncomingServerUsername, Mode=TwoWay}" />
|
||||||
|
<PasswordBox Header="{x:Bind ViewModel.IncomingPasswordHeaderText, Mode=OneWay}" Password="{x:Bind ViewModel.IncomingServerPassword, Mode=TwoWay}" />
|
||||||
|
<ComboBox
|
||||||
|
Header="{x:Bind ViewModel.ConnectionSecurityHeaderText, Mode=OneWay}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AvailableConnectionSecurityDisplayNames}"
|
||||||
|
SelectedIndex="{x:Bind ViewModel.SelectedIncomingServerConnectionSecurityIndex, Mode=TwoWay}" />
|
||||||
|
<ComboBox
|
||||||
|
Header="{x:Bind ViewModel.AuthenticationMethodHeaderText, Mode=OneWay}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AvailableAuthenticationMethodDisplayNames}"
|
||||||
|
SelectedIndex="{x:Bind ViewModel.SelectedIncomingServerAuthenticationMethodIndex, Mode=TwoWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Grid.Column="1"
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||||
|
CornerRadius="6">
|
||||||
|
<StackPanel Spacing="10">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<FontIcon FontSize="14" Glyph="" />
|
||||||
|
<TextBlock FontWeight="SemiBold" Text="{x:Bind ViewModel.OutgoingSectionTitleText, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBox Header="{x:Bind ViewModel.OutgoingServerHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServer, Mode=TwoWay}" />
|
||||||
|
<TextBox Header="{x:Bind ViewModel.PortHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServerPort, Mode=TwoWay}" />
|
||||||
|
<TextBox Header="{x:Bind ViewModel.OutgoingUsernameHeaderText, Mode=OneWay}" Text="{x:Bind ViewModel.OutgoingServerUsername, Mode=TwoWay}" />
|
||||||
|
<PasswordBox Header="{x:Bind ViewModel.OutgoingPasswordHeaderText, Mode=OneWay}" Password="{x:Bind ViewModel.OutgoingServerPassword, Mode=TwoWay}" />
|
||||||
|
<ComboBox
|
||||||
|
Header="{x:Bind ViewModel.ConnectionSecurityHeaderText, Mode=OneWay}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AvailableConnectionSecurityDisplayNames}"
|
||||||
|
SelectedIndex="{x:Bind ViewModel.SelectedOutgoingServerConnectionSecurityIndex, Mode=TwoWay}" />
|
||||||
|
<ComboBox
|
||||||
|
Header="{x:Bind ViewModel.AuthenticationMethodHeaderText, Mode=OneWay}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AvailableAuthenticationMethodDisplayNames}"
|
||||||
|
SelectedIndex="{x:Bind ViewModel.SelectedOutgoingServerAuthenticationMethodIndex, Mode=TwoWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{x:Bind ViewModel.TestImapConnectionCommand}"
|
||||||
|
Content="{x:Bind ViewModel.TestImapButtonText, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Padding="20"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="8">
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<StackPanel Spacing="2">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="{x:Bind ViewModel.CalendarSectionTitleText, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{x:Bind ViewModel.CalendarSectionDescriptionText, Mode=OneWay}"
|
||||||
|
TextWrapping="WrapWholeWords" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<ComboBox
|
||||||
|
Header="{x:Bind ViewModel.CalendarModeHeaderText, Mode=OneWay}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsCalendarModeSelectionVisible, Mode=OneWay}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AvailableCalendarSupportModeTitles}"
|
||||||
|
SelectedIndex="{x:Bind ViewModel.SelectedCalendarSupportModeIndex, Mode=TwoWay}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{x:Bind ViewModel.CalendarSectionDescriptionText, Mode=OneWay}"
|
Text="{x:Bind ViewModel.SelectedCalendarSupportDescription, Mode=OneWay}"
|
||||||
TextWrapping="WrapWholeWords" />
|
TextWrapping="WrapWholeWords" />
|
||||||
|
|
||||||
|
<HyperlinkButton
|
||||||
|
Command="{x:Bind ViewModel.ShowLocalCalendarExplanationCommand}"
|
||||||
|
Content="{x:Bind ViewModel.LocalCalendarLearnMoreText, Mode=OneWay}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLocalCalendarModeSelected, Mode=OneWay}" />
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="12" Visibility="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox
|
||||||
|
Grid.Column="0"
|
||||||
|
Header="{x:Bind ViewModel.CalDavServiceUrlHeaderText, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.CalDavServiceUrl, Mode=TwoWay}" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Column="1"
|
||||||
|
Header="{x:Bind ViewModel.CalDavUsernameHeaderText, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.CalDavUsername, Mode=TwoWay}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<PasswordBox
|
||||||
|
Header="{x:Bind ViewModel.CalDavPasswordHeaderText, Mode=OneWay}"
|
||||||
|
Password="{x:Bind ViewModel.CalDavPassword, Mode=TwoWay}"
|
||||||
|
Visibility="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Command="{x:Bind ViewModel.TestCalDavConnectionCommand}"
|
||||||
|
Content="{x:Bind ViewModel.TestCalDavButtonText, Mode=OneWay}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<ComboBox
|
<Grid Margin="0,4,0,0" ColumnSpacing="8">
|
||||||
HorizontalAlignment="Stretch"
|
<Grid.ColumnDefinitions>
|
||||||
Header="{x:Bind ViewModel.CalendarModeHeaderText, Mode=OneWay}"
|
<ColumnDefinition Width="*" />
|
||||||
IsEnabled="{x:Bind ViewModel.IsCalendarModeSelectionVisible, Mode=OneWay}"
|
<ColumnDefinition Width="Auto" />
|
||||||
ItemsSource="{x:Bind ViewModel.AvailableCalendarSupportModeTitles}"
|
<ColumnDefinition Width="Auto" />
|
||||||
SelectedIndex="{x:Bind ViewModel.SelectedCalendarSupportModeIndex, Mode=TwoWay}" />
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button
|
||||||
<TextBlock
|
Grid.Column="1"
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
Command="{x:Bind ViewModel.CancelCommand}"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Content="{x:Bind ViewModel.CancelButtonText, Mode=OneWay}" />
|
||||||
Text="{x:Bind ViewModel.SelectedCalendarSupportDescription, Mode=OneWay}"
|
<Button
|
||||||
TextWrapping="WrapWholeWords" />
|
Grid.Column="2"
|
||||||
|
Command="{x:Bind ViewModel.SaveCommand}"
|
||||||
<HyperlinkButton
|
Content="{x:Bind ViewModel.SaveButtonText, Mode=OneWay}"
|
||||||
Command="{x:Bind ViewModel.ShowLocalCalendarExplanationCommand}"
|
Style="{ThemeResource AccentButtonStyle}" />
|
||||||
Content="{x:Bind ViewModel.LocalCalendarLearnMoreText, Mode=OneWay}"
|
</Grid>
|
||||||
IsEnabled="{x:Bind ViewModel.IsLocalCalendarModeSelected, Mode=OneWay}" />
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
<Grid ColumnSpacing="12" Visibility="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="2*" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBox
|
|
||||||
Grid.Column="0"
|
|
||||||
Header="{x:Bind ViewModel.CalDavServiceUrlHeaderText, Mode=OneWay}"
|
|
||||||
Text="{x:Bind ViewModel.CalDavServiceUrl, Mode=TwoWay}" />
|
|
||||||
<TextBox
|
|
||||||
Grid.Column="1"
|
|
||||||
Header="{x:Bind ViewModel.CalDavUsernameHeaderText, Mode=OneWay}"
|
|
||||||
Text="{x:Bind ViewModel.CalDavUsername, Mode=TwoWay}" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<PasswordBox
|
|
||||||
Header="{x:Bind ViewModel.CalDavPasswordHeaderText, Mode=OneWay}"
|
|
||||||
Password="{x:Bind ViewModel.CalDavPassword, Mode=TwoWay}"
|
|
||||||
Visibility="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}" />
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Action Bar -->
|
|
||||||
<Grid Margin="0,4,0,0" ColumnSpacing="8">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Button
|
|
||||||
Grid.Column="0"
|
|
||||||
Command="{x:Bind ViewModel.TestImapConnectionCommand}"
|
|
||||||
Content="{x:Bind ViewModel.TestImapButtonText, Mode=OneWay}" />
|
|
||||||
<Button
|
|
||||||
Grid.Column="1"
|
|
||||||
Command="{x:Bind ViewModel.TestCalDavConnectionCommand}"
|
|
||||||
Content="{x:Bind ViewModel.TestCalDavButtonText, Mode=OneWay}"
|
|
||||||
IsEnabled="{x:Bind ViewModel.IsCalDavSettingsVisible, Mode=OneWay}" />
|
|
||||||
<Button
|
|
||||||
Grid.Column="3"
|
|
||||||
Command="{x:Bind ViewModel.CancelCommand}"
|
|
||||||
Content="{x:Bind ViewModel.CancelButtonText, Mode=OneWay}" />
|
|
||||||
<Button
|
|
||||||
Grid.Column="4"
|
|
||||||
Command="{x:Bind ViewModel.SaveCommand}"
|
|
||||||
Content="{x:Bind ViewModel.SaveButtonText, Mode=OneWay}"
|
|
||||||
Style="{ThemeResource AccentButtonStyle}" />
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</abstract:ImapCalDavSettingsPageAbstract>
|
</abstract:ImapCalDavSettingsPageAbstract>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Microsoft.UI.Xaml.Navigation;
|
|
||||||
using Wino.Views.Abstract;
|
using Wino.Views.Abstract;
|
||||||
|
|
||||||
namespace Wino.Views;
|
namespace Wino.Views;
|
||||||
@@ -10,22 +8,4 @@ public sealed partial class ImapCalDavSettingsPage : ImapCalDavSettingsPageAbstr
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSetupModeSelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
ViewModel.SelectedSetupTabIndex = SetupModeSelector.SelectedItem == null ? 0 : SetupModeSelector.Items.IndexOf(SetupModeSelector.SelectedItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnNavigatedTo(e);
|
|
||||||
|
|
||||||
var tabIndex = ViewModel.SelectedSetupTabIndex;
|
|
||||||
if (tabIndex < 0 || tabIndex >= SetupModeSelector.Items.Count)
|
|
||||||
{
|
|
||||||
tabIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetupModeSelector.SelectedItem = SetupModeSelector.Items[tabIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ public class AccountService : BaseDatabaseService, IAccountService
|
|||||||
|
|
||||||
public async Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation)
|
public async Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation)
|
||||||
{
|
{
|
||||||
await Connection.UpdateAsync(customServerInformation, typeof(CustomServerInformation)).ConfigureAwait(false);
|
await Connection.InsertOrReplaceAsync(customServerInformation, typeof(CustomServerInformation)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateAccountAliasesAsync(Guid accountId, List<MailAccountAlias> aliases)
|
public async Task UpdateAccountAliasesAsync(Guid accountId, List<MailAccountAlias> aliases)
|
||||||
|
|||||||
Reference in New Issue
Block a user