Skip to content

Commit c7645eb

Browse files
committed
Fix conflicts
2 parents d2b8147 + 1f5e036 commit c7645eb

File tree

115 files changed

+7578
-3402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+7578
-3402
lines changed

Files.Extensions/Files.Extensions.vcxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.props')" />
3+
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.props')" />
44
<PropertyGroup Label="Globals">
55
<CppWinRTOptimized>true</CppWinRTOptimized>
66
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
@@ -146,13 +146,13 @@
146146
</ItemGroup>
147147
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
148148
<ImportGroup Label="ExtensionTargets">
149-
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
149+
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
150150
</ImportGroup>
151151
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
152152
<PropertyGroup>
153153
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
154154
</PropertyGroup>
155-
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
156-
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201113.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
155+
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
156+
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210403.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
157157
</Target>
158158
</Project>

Files.Extensions/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Windows.CppWinRT" version="2.0.201113.7" targetFramework="native" />
3+
<package id="Microsoft.Windows.CppWinRT" version="2.0.210403.2" targetFramework="native" />
44
</packages>

Files/App.xaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
x:Class="Files.App"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:fsvm="using:Files.ViewModels" xmlns:controls="using:Microsoft.UI.Xaml.Controls">
5+
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
6+
xmlns:fsvm="using:Files.ViewModels">
67
<Application.Resources>
78
<ResourceDictionary>
89
<fsvm:FolderLayoutInformation x:Key="DetailsInfo" Mode="DetailsView" />
@@ -26,7 +27,7 @@
2627
<ResourceDictionary.MergedDictionaries>
2728
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
2829
<ResourceDictionary Source="/ResourceDictionaries/CustomHeaderStyle.xaml" />
29-
<controls:XamlControlsResources ControlsResourcesVersion="Version2"/>
30+
<controls:XamlControlsResources ControlsResourcesVersion="Version2" />
3031
<ResourceDictionary>
3132
<ResourceDictionary.ThemeDictionaries>
3233
<ResourceDictionary x:Key="Light">

Files/Assets/tile-0-250x250.png

1020 Bytes
Loading

Files/Assets/tile-0-300x300.png

867 Bytes
Loading

Files/BaseLayout.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ protected async void Item_Drop(object sender, DragEventArgs e)
565565
ListedItem rowItem = GetItemFromElement(sender);
566566
if (rowItem != null)
567567
{
568-
await ParentShellPageInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, (rowItem as ShortcutItem)?.TargetPath ?? rowItem.ItemPath, true);
568+
await ParentShellPageInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, (rowItem as ShortcutItem)?.TargetPath ?? rowItem.ItemPath, false, true);
569569
}
570570
deferral.Complete();
571571
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using Windows.UI.Xaml.Data;
3+
4+
namespace Files.Converters
5+
{
6+
public class MiddleTextEllipsisConverter : IValueConverter
7+
{
8+
public object Convert(object value, Type targetType, object parameter, string language)
9+
{
10+
string text = value as string;
11+
int maxLength = parameter == null ? 15 : System.Convert.ToInt32(parameter);
12+
13+
if (string.IsNullOrWhiteSpace(text))
14+
{
15+
return value;
16+
}
17+
18+
if (text.Length > maxLength)
19+
{
20+
int amountToCutOff = text.Length - maxLength;
21+
int middleIndexInString = text.Length / 2;
22+
23+
int startIndex = text.Length - (middleIndexInString + (amountToCutOff / 2));
24+
int endIndex = middleIndexInString + (amountToCutOff / 2);
25+
26+
string newString = string.Format("{0}...{1}", text.Substring(0, startIndex), text.Substring(endIndex));
27+
28+
return newString;
29+
}
30+
31+
return value;
32+
}
33+
34+
public object ConvertBack(object value, Type targetType, object parameter, string language)
35+
{
36+
throw new NotImplementedException();
37+
}
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
using Files.Enums;
2+
using Files.ViewModels.Dialogs;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using Windows.UI.Xaml;
6+
7+
namespace Files.DataModels
8+
{
9+
public struct FilesystemItemsOperationItemModel
10+
{
11+
public FilesystemOperationType OperationType;
12+
13+
public string SourcePath;
14+
15+
public string DestinationPath;
16+
17+
public FilesystemItemsOperationItemModel(FilesystemOperationType operationType, string sourcePath, string destinationPath)
18+
{
19+
this.OperationType = operationType;
20+
this.SourcePath = sourcePath;
21+
this.DestinationPath = destinationPath;
22+
}
23+
}
24+
25+
public struct FilesystemItemsOperationDataModel
26+
{
27+
public FilesystemOperationType OperationType;
28+
29+
public bool MustResolveConflicts;
30+
31+
public bool PermanentlyDelete;
32+
33+
public bool PermanentlyDeleteEnabled;
34+
35+
/// <summary>
36+
/// The items that are copied/moved/deleted from the source directory (to destination)
37+
/// </summary>
38+
public List<FilesystemItemsOperationItemModel> IncomingItems;
39+
40+
/// <summary>
41+
/// The items that are conflicting between <see cref="IncomingItems"/> and the items that are in the destination directory
42+
/// </summary>
43+
public List<FilesystemItemsOperationItemModel> ConflictingItems;
44+
45+
public FilesystemItemsOperationDataModel(FilesystemOperationType operationType, bool mustResolveConflicts, bool permanentlyDelete, bool permanentlyDeleteEnabled, List<FilesystemItemsOperationItemModel> incomingItems, List<FilesystemItemsOperationItemModel> conflictingItems)
46+
{
47+
this.OperationType = operationType;
48+
this.MustResolveConflicts = mustResolveConflicts;
49+
this.PermanentlyDelete = permanentlyDelete;
50+
this.PermanentlyDeleteEnabled = permanentlyDeleteEnabled;
51+
this.IncomingItems = incomingItems;
52+
this.ConflictingItems = conflictingItems;
53+
}
54+
55+
public List<FilesystemOperationItemViewModel> ToItems()
56+
{
57+
List<FilesystemOperationItemViewModel> items = new List<FilesystemOperationItemViewModel>();
58+
59+
List<FilesystemItemsOperationItemModel> nonConflictingItems = IncomingItems.Except(ConflictingItems).ToList();
60+
61+
// Add conflicting items first
62+
foreach (var item in ConflictingItems)
63+
{
64+
items.Add(new FilesystemOperationItemViewModel()
65+
{
66+
OperationIconGlyph = GetOperationIconGlyph(item.OperationType),
67+
SourcePath = item.SourcePath,
68+
PlusIconVisibility = Visibility.Collapsed,
69+
DestinationPath = item.DestinationPath,
70+
IsConflicting = true,
71+
ExclamationMarkVisibility = Visibility.Visible,
72+
ItemOperation = item.OperationType
73+
});
74+
}
75+
76+
// Then add non-conflicting items
77+
foreach (var item in nonConflictingItems)
78+
{
79+
items.Add(new FilesystemOperationItemViewModel()
80+
{
81+
OperationIconGlyph = GetOperationIconGlyph(item.OperationType),
82+
SourcePath = item.SourcePath,
83+
ArrowIconVisibility = item.OperationType == FilesystemOperationType.Delete ? Visibility.Collapsed : Visibility.Visible,
84+
PlusIconVisibility = item.OperationType == FilesystemOperationType.Delete ? Visibility.Collapsed : Visibility.Visible,
85+
DestinationPath = item.DestinationPath,
86+
IsConflicting = false,
87+
ExclamationMarkVisibility = Visibility.Collapsed,
88+
ItemOperation = item.OperationType
89+
});
90+
}
91+
92+
return items;
93+
}
94+
95+
private string GetOperationIconGlyph(FilesystemOperationType operationType)
96+
{
97+
switch (operationType)
98+
{
99+
case FilesystemOperationType.Copy:
100+
return "\uE8C8";
101+
102+
case FilesystemOperationType.Move:
103+
return "\uE8C6";
104+
105+
case FilesystemOperationType.Delete:
106+
return "\uE74D";
107+
108+
default:
109+
return "\uE8FB";
110+
}
111+
}
112+
}
113+
}

Files/Dialogs/ConfirmDeleteDialog.xaml

-58
This file was deleted.

Files/Dialogs/ConfirmDeleteDialog.xaml.cs

-54
This file was deleted.

0 commit comments

Comments
 (0)