Save as eml, translation updates

This commit is contained in:
Burak Kaan Köse
2026-04-23 13:23:05 +02:00
parent 81e28129b7
commit 6f82cd4f26
38 changed files with 1820 additions and 3 deletions
+1
View File
@@ -9,6 +9,7 @@ const joditConfig = {
"showWordsCounter": false,
"showXPathInStatusbar": false,
"spellcheck": true,
"defaultActionOnPaste": "insert_as_text",
"link": {
"processVideoLink": false
},
@@ -111,6 +111,12 @@ public class PreferencesService(IConfigurationService configurationService) : Ob
set => SetPropertyAndSave(nameof(IsHardDeleteProtectionEnabled), value);
}
public bool IsShowEmptyJunkFolderEnabled
{
get => _configurationService.Get(nameof(IsShowEmptyJunkFolderEnabled), false);
set => SetPropertyAndSave(nameof(IsShowEmptyJunkFolderEnabled), value);
}
public bool IsThreadingEnabled
{
get => _configurationService.Get(nameof(IsThreadingEnabled), true);
@@ -185,6 +185,17 @@
<coreControls:WinoFontIcon Icon="{x:Bind GetEditorThemeIcon(WebViewEditor.IsEditorDarkMode), Mode=OneWay}" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="{x:Bind domain:Translator.MailOperation_SaveAs}">
<AppBarButton.Icon>
<coreControls:WinoFontIcon Icon="Save" />
</AppBarButton.Icon>
<AppBarButton.Flyout>
<coreControls:WinoMenuFlyout Placement="BottomEdgeAlignedRight">
<MenuFlyoutItem Click="ExportPdf_Click" Text="{x:Bind domain:Translator.Buttons_PDF}" />
<MenuFlyoutItem Click="ExportEml_Click" Text="{x:Bind domain:Translator.Buttons_EML}" />
</coreControls:WinoMenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Command="{x:Bind ViewModel.DiscardCommand}" Label="{x:Bind domain:Translator.Buttons_Discard}">
<AppBarButton.Icon>
<coreControls:WinoFontIcon Icon="Delete" />
@@ -59,6 +59,17 @@ public sealed partial class ComposePage : ComposePageAbstract,
public ComposePage()
{
InitializeComponent();
ViewModel.SaveHTMLasPDFFunc = async path =>
{
var webView = GetWebView();
if (webView?.CoreWebView2 == null)
{
return false;
}
return await webView.CoreWebView2.PrintToPdfAsync(path, null);
};
ViewModel.CloseRequested += ViewModel_CloseRequested;
}
@@ -495,6 +506,7 @@ public sealed partial class ComposePage : ComposePageAbstract,
FocusManager.GotFocus -= GlobalFocusManagerGotFocus;
ComposeAiActionsPanel.CancelPendingOperation();
await ViewModel.UpdateMimeChangesAsync();
ViewModel.SaveHTMLasPDFFunc = null;
ViewModel.RenderHtmlBodyAsyncFunc = null;
DisposeDisposables();
@@ -565,6 +577,16 @@ public sealed partial class ComposePage : ComposePageAbstract,
}
}
private async void ExportPdf_Click(object sender, RoutedEventArgs e)
{
await ViewModel.ExportAsPdfAsync();
}
private async void ExportEml_Click(object sender, RoutedEventArgs e)
{
await ViewModel.ExportAsEmlAsync();
}
protected override void RegisterRecipients()
{
base.RegisterRecipients();
@@ -160,6 +160,10 @@
<ToggleSwitch IsOn="{x:Bind ViewModel.PreferencesService.IsHardDeleteProtectionEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsEmptyJunkFolderCommand_Description}" Header="{x:Bind domain:Translator.SettingsEmptyJunkFolderCommand_Title}">
<ToggleSwitch IsOn="{x:Bind ViewModel.PreferencesService.IsShowEmptyJunkFolderEnabled, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard Description="{x:Bind domain:Translator.SettingsAutoSelectNextItem_Description}" Header="{x:Bind domain:Translator.SettingsAutoSelectNextItem_Title}">
<ToggleSwitch IsOn="{x:Bind ViewModel.PreferencesService.AutoSelectNextItem, Mode=TwoWay}" />
<controls:SettingsCard.HeaderIcon>