Add initial mail sync range selection
This commit is contained in:
@@ -112,6 +112,16 @@ public class MailAccount
|
||||
/// </summary>
|
||||
public DateTime? LastFolderStructureSyncDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the account was created in Wino.
|
||||
/// </summary>
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timespan used for the account's initial mail synchronization.
|
||||
/// </summary>
|
||||
public InitialSynchronizationRange InitialSynchronizationRange { get; set; } = InitialSynchronizationRange.SixMonths;
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the account can perform ProfileInformation sync type.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Wino.Core.Domain.Enums;
|
||||
|
||||
public enum InitialSynchronizationRange
|
||||
{
|
||||
SixMonths = 0,
|
||||
ThreeMonths = 1,
|
||||
NineMonths = 2,
|
||||
OneYear = 3,
|
||||
Everything = 4
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Extensions;
|
||||
|
||||
public static class InitialSynchronizationRangeExtensions
|
||||
{
|
||||
public static DateTime? ToCutoffDateUtc(this InitialSynchronizationRange range, DateTime utcNow)
|
||||
{
|
||||
var normalizedUtcNow = utcNow.Kind == DateTimeKind.Utc
|
||||
? utcNow
|
||||
: utcNow.ToUniversalTime();
|
||||
|
||||
return range switch
|
||||
{
|
||||
InitialSynchronizationRange.ThreeMonths => normalizedUtcNow.AddMonths(-3),
|
||||
InitialSynchronizationRange.SixMonths => normalizedUtcNow.AddMonths(-6),
|
||||
InitialSynchronizationRange.NineMonths => normalizedUtcNow.AddMonths(-9),
|
||||
InitialSynchronizationRange.OneYear => normalizedUtcNow.AddYears(-1),
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
public record AccountCreationDialogResult(MailProviderType ProviderType, string AccountName, SpecialImapProviderDetails SpecialImapProviderDetails, string AccountColorHex);
|
||||
public record AccountCreationDialogResult(
|
||||
MailProviderType ProviderType,
|
||||
string AccountName,
|
||||
SpecialImapProviderDetails SpecialImapProviderDetails,
|
||||
string AccountColorHex,
|
||||
InitialSynchronizationRange InitialSynchronizationRange);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Accounts;
|
||||
|
||||
public sealed class InitialSynchronizationRangeOption
|
||||
{
|
||||
public InitialSynchronizationRange Range { get; }
|
||||
public string DisplayText { get; }
|
||||
|
||||
public bool IsEverything => Range == InitialSynchronizationRange.Everything;
|
||||
|
||||
public InitialSynchronizationRangeOption(InitialSynchronizationRange range, string displayText)
|
||||
{
|
||||
Range = range;
|
||||
DisplayText = displayText;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,14 @@
|
||||
"AccountCreationDialog_Initializing": "initializing",
|
||||
"AccountCreationDialog_PreparingFolders": "We are getting folder information at the moment.",
|
||||
"AccountCreationDialog_SigninIn": "Account information is being saved.",
|
||||
"AccountCreation_InitialSynchronization_Title": "Mail synchronization range",
|
||||
"AccountCreation_InitialSynchronization_Description": "Choose how far back Wino should download your mail during the first synchronization.",
|
||||
"AccountCreation_InitialSynchronization_3Months": "3 Months",
|
||||
"AccountCreation_InitialSynchronization_6Months": "6 Months",
|
||||
"AccountCreation_InitialSynchronization_9Months": "9 Months",
|
||||
"AccountCreation_InitialSynchronization_Year": "Year",
|
||||
"AccountCreation_InitialSynchronization_Everything": "Everything",
|
||||
"AccountCreation_InitialSynchronization_EverythingWarning": "This will synchronize all your mails to your computer. Extensive use of disk storage is needed. This is not recommended. For optimal performance use smaller synchronization timespan and use online search to access your mails.",
|
||||
"Purchased": "Purchased",
|
||||
"AccountEditDialog_Message": "Account Name",
|
||||
"AccountEditDialog_Title": "Edit Account",
|
||||
@@ -37,6 +45,8 @@
|
||||
"AccountDetailsPage_TabMail": "Mail",
|
||||
"AccountDetailsPage_TabCalendar": "Calendar",
|
||||
"AccountDetailsPage_CalendarListDescription": "Select a calendar to configure its settings",
|
||||
"AccountDetailsPage_InitialSynchronization_Title": "Initial synchronization",
|
||||
"AccountDetailsPage_InitialSynchronization_Description": "Wino synchronized your mails until {0} going back.",
|
||||
"AddHyperlink": "Add",
|
||||
"AppCloseBackgroundSynchronizationWarningTitle": "Background Synchronization",
|
||||
"AppCloseStartupLaunchDisabledWarningMessageFirstLine": "Application has not been set to launch on Windows startup.",
|
||||
|
||||
Reference in New Issue
Block a user