Bunch of calendar implementation thing.
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
@@ -142,8 +143,14 @@
|
||||
Header="App-Specific Password"
|
||||
PasswordChanged="ImapPasswordChanged" />
|
||||
|
||||
<HyperlinkButton
|
||||
<ComboBox
|
||||
Grid.Row="4"
|
||||
Header="{x:Bind domain:Translator.ImapCalDavSettingsPage_CalendarModeHeader, Mode=OneWay}"
|
||||
ItemsSource="{x:Bind CalendarModeOptions, Mode=OneWay}"
|
||||
SelectedIndex="{x:Bind SelectedCalendarModeIndex, Mode=TwoWay}" />
|
||||
|
||||
<HyperlinkButton
|
||||
Grid.Row="5"
|
||||
HorizontalAlignment="Right"
|
||||
Click="AppSpecificHelpButtonClicked"
|
||||
Content="How do I get app-specific password?" />
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.System;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
@@ -24,6 +25,7 @@ public sealed partial class NewAccountDialog : ContentDialog
|
||||
public static readonly DependencyProperty IsSpecialImapServerPartVisibleProperty = DependencyProperty.Register(nameof(IsSpecialImapServerPartVisible), typeof(bool), typeof(NewAccountDialog), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty SelectedMailProviderProperty = DependencyProperty.Register(nameof(SelectedMailProvider), typeof(ProviderDetail), typeof(NewAccountDialog), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedProviderChanged)));
|
||||
public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register(nameof(SelectedColor), typeof(AppColorViewModel), typeof(NewAccountDialog), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedColorChanged)));
|
||||
public static readonly DependencyProperty SelectedCalendarModeIndexProperty = DependencyProperty.Register(nameof(SelectedCalendarModeIndex), typeof(int), typeof(NewAccountDialog), new PropertyMetadata(0));
|
||||
|
||||
|
||||
public AppColorViewModel SelectedColor
|
||||
@@ -32,6 +34,12 @@ public sealed partial class NewAccountDialog : ContentDialog
|
||||
set { SetValue(SelectedColorProperty, value); }
|
||||
}
|
||||
|
||||
public int SelectedCalendarModeIndex
|
||||
{
|
||||
get { return (int)GetValue(SelectedCalendarModeIndexProperty); }
|
||||
set { SetValue(SelectedCalendarModeIndexProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets current selected mail provider in the dialog.
|
||||
/// </summary>
|
||||
@@ -59,6 +67,12 @@ public sealed partial class NewAccountDialog : ContentDialog
|
||||
public List<IProviderDetail> Providers { get; set; }
|
||||
|
||||
public List<AppColorViewModel> AvailableColors { get; set; }
|
||||
public List<string> CalendarModeOptions { get; } =
|
||||
[
|
||||
Translator.ImapCalDavSettingsPage_CalendarModeCalDav,
|
||||
Translator.ImapCalDavSettingsPage_CalendarModeLocalOnly,
|
||||
Translator.ImapCalDavSettingsPage_CalendarModeDisabled
|
||||
];
|
||||
|
||||
|
||||
public AccountCreationDialogResult Result = null;
|
||||
@@ -102,8 +116,19 @@ public sealed partial class NewAccountDialog : ContentDialog
|
||||
if (IsSpecialImapServerPartVisible)
|
||||
{
|
||||
// Special imap detail input.
|
||||
var calendarSupportMode = SelectedCalendarModeIndex switch
|
||||
{
|
||||
1 => ImapCalendarSupportMode.LocalOnly,
|
||||
2 => ImapCalendarSupportMode.Disabled,
|
||||
_ => ImapCalendarSupportMode.CalDav
|
||||
};
|
||||
|
||||
var details = new SpecialImapProviderDetails(SpecialImapAddress.Text.Trim(), AppSpecificPassword.Password.Trim(), DisplayNameTextBox.Text.Trim(), SelectedMailProvider.SpecialImapProvider);
|
||||
var details = new SpecialImapProviderDetails(
|
||||
SpecialImapAddress.Text.Trim(),
|
||||
AppSpecificPassword.Password.Trim(),
|
||||
DisplayNameTextBox.Text.Trim(),
|
||||
SelectedMailProvider.SpecialImapProvider,
|
||||
calendarSupportMode);
|
||||
Result = new AccountCreationDialogResult(SelectedMailProvider.Type, AccountNameTextbox.Text.Trim(), details, SelectedColor?.Hex ?? string.Empty);
|
||||
Hide();
|
||||
|
||||
|
||||
@@ -3,20 +3,29 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:abstract="using:Wino.Views.Abstract"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel MaxWidth="1040" Padding="24,20,24,24" Spacing="16">
|
||||
<StackPanel
|
||||
MaxWidth="1040"
|
||||
Padding="24,20,24,24"
|
||||
Spacing="16">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock FontSize="30" FontWeight="SemiBold" Text="{x:Bind ViewModel.PageTitle, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
FontSize="30"
|
||||
FontWeight="SemiBold"
|
||||
Text="{x:Bind ViewModel.PageTitle, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
Opacity="0.85"
|
||||
Text="{x:Bind ViewModel.SubtitleText, Mode=OneWay}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<TextBlock Opacity="0.85" Text="{x:Bind ViewModel.ProviderHint, Mode=OneWay}" TextWrapping="WrapWholeWords" />
|
||||
<TextBlock
|
||||
Opacity="0.85"
|
||||
Text="{x:Bind ViewModel.ProviderHint, Mode=OneWay}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</StackPanel>
|
||||
|
||||
<SelectorBar x:Name="SetupModeSelector" SelectionChanged="OnSetupModeSelectionChanged">
|
||||
@@ -32,15 +41,29 @@
|
||||
CornerRadius="12"
|
||||
Visibility="{x:Bind helpers:XamlHelpers.ReverseBoolToVisibilityConverter(ViewModel.IsAdvancedSetupSelected), Mode=OneWay}">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock FontSize="19" FontWeight="SemiBold" Text="{x:Bind ViewModel.BasicSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock Opacity="0.75" Text="{x:Bind ViewModel.BasicSectionDescriptionText, Mode=OneWay}" TextWrapping="WrapWholeWords" />
|
||||
<TextBlock
|
||||
FontSize="19"
|
||||
FontWeight="SemiBold"
|
||||
Text="{x:Bind ViewModel.BasicSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
Opacity="0.75"
|
||||
Text="{x:Bind ViewModel.BasicSectionDescriptionText, Mode=OneWay}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<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}" />
|
||||
<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}" />
|
||||
@@ -59,7 +82,10 @@
|
||||
CornerRadius="12"
|
||||
Visibility="{x:Bind helpers:XamlHelpers.ReverseBoolToVisibilityConverter(ViewModel.IsBasicSetupSelected), Mode=OneWay}">
|
||||
<StackPanel Spacing="14">
|
||||
<TextBlock FontSize="19" FontWeight="SemiBold" Text="{x:Bind ViewModel.AdvancedSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
FontSize="19"
|
||||
FontWeight="SemiBold"
|
||||
Text="{x:Bind ViewModel.AdvancedSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
Opacity="0.75"
|
||||
Text="{x:Bind ViewModel.AdvancedSectionDescriptionText, Mode=OneWay}"
|
||||
@@ -113,14 +139,23 @@
|
||||
BorderThickness="1"
|
||||
CornerRadius="12">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock FontSize="19" FontWeight="SemiBold" Text="{x:Bind ViewModel.CalendarSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock Opacity="0.75" Text="{x:Bind ViewModel.CalendarSectionDescriptionText, Mode=OneWay}" TextWrapping="WrapWholeWords" />
|
||||
<TextBlock
|
||||
FontSize="19"
|
||||
FontWeight="SemiBold"
|
||||
Text="{x:Bind ViewModel.CalendarSectionTitleText, Mode=OneWay}" />
|
||||
<TextBlock
|
||||
Opacity="0.75"
|
||||
Text="{x:Bind ViewModel.CalendarSectionDescriptionText, Mode=OneWay}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<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 Opacity="0.8" Text="{x:Bind ViewModel.SelectedCalendarSupportDescription, Mode=OneWay}" TextWrapping="WrapWholeWords" />
|
||||
<TextBlock
|
||||
Opacity="0.8"
|
||||
Text="{x:Bind ViewModel.SelectedCalendarSupportDescription, Mode=OneWay}"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
<Button
|
||||
HorizontalAlignment="Left"
|
||||
Command="{x:Bind ViewModel.ShowLocalCalendarExplanationCommand}"
|
||||
@@ -157,14 +192,24 @@
|
||||
<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="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}" />
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user