-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Display error message when transferring files that are too l…
…arge for FAT32 (#13137)
- Loading branch information
1 parent
be42aea
commit 3221267
Showing
8 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- Copyright (c) 2023 Files Community. Licensed under the MIT License. See the LICENSE. --> | ||
<ContentDialog | ||
x:Class="Files.App.Dialogs.FileTooLargeDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:helpers="using:Files.App.Helpers" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title="{helpers:ResourceString Name=CopyFailureFileToLarge}" | ||
CornerRadius="{StaticResource OverlayCornerRadius}" | ||
DefaultButton="Primary" | ||
PrimaryButtonText="{helpers:ResourceString Name=OK}" | ||
RequestedTheme="{x:Bind helpers:ThemeHelper.RootTheme}" | ||
Style="{StaticResource DefaultContentDialogStyle}" | ||
mc:Ignorable="d"> | ||
|
||
<ListView | ||
MaxHeight="300" | ||
ItemsSource="{x:Bind ViewModel.Paths}" | ||
SelectionMode="None"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate x:DataType="x:String"> | ||
<TextBlock | ||
Padding="4" | ||
IsTabStop="False" | ||
Text="{x:Bind}" | ||
TextWrapping="Wrap" /> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
|
||
</ContentDialog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Files.App.Dialogs | ||
{ | ||
public sealed partial class FileTooLargeDialog : ContentDialog, IDialog<FileTooLargeDialogViewModel> | ||
{ | ||
public FileTooLargeDialogViewModel ViewModel | ||
{ | ||
get => (FileTooLargeDialogViewModel)DataContext; | ||
set => DataContext = value; | ||
} | ||
|
||
public FileTooLargeDialog() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public new async Task<DialogResult> ShowAsync() | ||
{ | ||
return (DialogResult)await SetContentDialogRoot(this).TryShowAsync(); | ||
} | ||
|
||
// WINUI3 | ||
private ContentDialog SetContentDialogRoot(ContentDialog contentDialog) | ||
{ | ||
if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) | ||
contentDialog.XamlRoot = MainWindow.Instance.Content.XamlRoot; | ||
|
||
return contentDialog; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Files.Core/ViewModels/Dialogs/FileTooLargeDialogViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
namespace Files.Core.ViewModels.Dialogs | ||
{ | ||
public sealed class FileTooLargeDialogViewModel: ObservableObject | ||
{ | ||
public IEnumerable<string> Paths { get; private set; } | ||
|
||
public FileTooLargeDialogViewModel(IEnumerable<string> paths) | ||
{ | ||
Paths = paths; | ||
} | ||
} | ||
} |