Skip to content

Commit 6c00418

Browse files
authored
v0.7.6 (#600)
1 parent f89b3ad commit 6c00418

Some content is hidden

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

63 files changed

+5179
-1086
lines changed

.devbots/needs-review.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enabled: true
2+
label: "needs-review"
3+
delay: 30

Files.Launcher/Files.Launcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>WinExe</OutputType>
99
<RootNamespace>ProcessLauncher</RootNamespace>
1010
<AssemblyName>ProcessLauncher</AssemblyName>
11-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
<Deterministic>true</Deterministic>

Files.Launcher/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ static void Main(string[] args)
1818
if (arguments.Equals("StartupTasks"))
1919
{
2020
// Detect User Paths
21-
ApplicationData.Current.LocalSettings.Values["DetectedDesktopLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
22-
ApplicationData.Current.LocalSettings.Values["DetectedDownloadsLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "{374DE290-123F-4565-9164-39C4925E467B}", null);
23-
ApplicationData.Current.LocalSettings.Values["DetectedDocumentsLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
24-
ApplicationData.Current.LocalSettings.Values["DetectedPicturesLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
25-
ApplicationData.Current.LocalSettings.Values["DetectedMusicLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
26-
ApplicationData.Current.LocalSettings.Values["DetectedVideosLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
27-
ApplicationData.Current.LocalSettings.Values["DetectedOneDriveLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);
21+
ApplicationData.Current.LocalSettings.Values["DesktopPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
22+
ApplicationData.Current.LocalSettings.Values["DownloadsPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "{374DE290-123F-4565-9164-39C4925E467B}", null);
23+
ApplicationData.Current.LocalSettings.Values["DocumentsPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
24+
ApplicationData.Current.LocalSettings.Values["PicturesPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
25+
ApplicationData.Current.LocalSettings.Values["MusicPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
26+
ApplicationData.Current.LocalSettings.Values["VideosPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
27+
ApplicationData.Current.LocalSettings.Values["OneDrivePath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);
2828

2929
// Check QuickLook Availability
3030
QuickLook.CheckQuickLookAvailability(localSettings);

Files.Launcher/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>

Files.Package/Package.appxmanifest

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,57 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop">
3-
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.5.0" />
4-
<Properties>
5-
<DisplayName>Files UWP - Preview</DisplayName>
6-
<PublisherDisplayName>Yair A</PublisherDisplayName>
7-
<Logo>Assets\StoreLogo.png</Logo>
8-
</Properties>
9-
<Dependencies>
10-
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
11-
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
12-
</Dependencies>
13-
<Resources>
14-
<Resource Language="x-generate" />
15-
</Resources>
16-
<Applications>
17-
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$" desktop4:SupportsMultipleInstances="true">
18-
<uap:VisualElements DisplayName="Files UWP - Preview" Description="Meet Files, a free and open-source File Manager for Windows 10. Created from the ground up to look and feel amazing, Files is built to replace the dated Windows File Explorer." Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="transparent">
19-
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png" ShortName="Files">
20-
<uap:ShowNameOnTiles>
21-
<uap:ShowOn Tile="square150x150Logo"/>
22-
<uap:ShowOn Tile="wide310x150Logo"/>
23-
<uap:ShowOn Tile="square310x310Logo"/>
24-
</uap:ShowNameOnTiles>
25-
</uap:DefaultTile>
26-
<uap:SplashScreen Image="Assets\SplashScreen.png" uap5:Optional="true" />
27-
</uap:VisualElements>
28-
<Extensions>
29-
<desktop:Extension Category="windows.fullTrustProcess" Executable="Files.Launcher\ProcessLauncher.exe">
30-
<desktop:FullTrustProcess>
31-
<desktop:ParameterGroup GroupId="DesktopAppExeGroup" Parameters="/DesktopApp"/>
32-
<desktop:ParameterGroup GroupId="TerminalGroup" Parameters="/Terminal"/>
33-
<desktop:ParameterGroup GroupId="UserFolderPathsGroup" Parameters="/DetectUserPaths"/>
34-
</desktop:FullTrustProcess>
35-
</desktop:Extension>
36-
<uap:Extension Category="windows.protocol">
37-
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
38-
</uap:Extension>
39-
<uap5:Extension
40-
Category="windows.appExecutionAlias"
41-
Executable="files.exe"
42-
EntryPoint="files.App">
43-
<uap5:AppExecutionAlias>
44-
<uap5:ExecutionAlias Alias="files.exe"/>
45-
</uap5:AppExecutionAlias>
46-
</uap5:Extension>
47-
</Extensions>
48-
</Application>
49-
</Applications>
50-
<Capabilities>
51-
<uap:Capability Name="removableStorage" />
52-
<rescap:Capability Name="runFullTrust" />
53-
<rescap:Capability Name="broadFileSystemAccess" />
54-
<Capability Name="internetClient"/>
55-
</Capabilities>
3+
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.6.0" />
4+
<Properties>
5+
<DisplayName>Files UWP - Preview</DisplayName>
6+
<PublisherDisplayName>Yair A</PublisherDisplayName>
7+
<Logo>Assets\StoreLogo.png</Logo>
8+
</Properties>
9+
<Dependencies>
10+
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
11+
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
12+
</Dependencies>
13+
<Resources>
14+
<Resource Language="x-generate" />
15+
</Resources>
16+
<Applications>
17+
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$" desktop4:SupportsMultipleInstances="true">
18+
<uap:VisualElements DisplayName="Files UWP - Preview" Description="Meet Files, a free and open-source File Manager for Windows 10. Created from the ground up to look and feel amazing, Files is built to replace the dated Windows File Explorer." Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="transparent">
19+
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png" ShortName="Files">
20+
<uap:ShowNameOnTiles>
21+
<uap:ShowOn Tile="square150x150Logo"/>
22+
<uap:ShowOn Tile="wide310x150Logo"/>
23+
<uap:ShowOn Tile="square310x310Logo"/>
24+
</uap:ShowNameOnTiles>
25+
</uap:DefaultTile>
26+
<uap:SplashScreen Image="Assets\SplashScreen.png" uap5:Optional="true" />
27+
</uap:VisualElements>
28+
<Extensions>
29+
<desktop:Extension Category="windows.fullTrustProcess" Executable="Files.Launcher\ProcessLauncher.exe">
30+
<desktop:FullTrustProcess>
31+
<desktop:ParameterGroup GroupId="DesktopAppExeGroup" Parameters="/DesktopApp"/>
32+
<desktop:ParameterGroup GroupId="TerminalGroup" Parameters="/Terminal"/>
33+
<desktop:ParameterGroup GroupId="UserFolderPathsGroup" Parameters="/DetectUserPaths"/>
34+
</desktop:FullTrustProcess>
35+
</desktop:Extension>
36+
<uap:Extension Category="windows.protocol">
37+
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
38+
</uap:Extension>
39+
<uap5:Extension
40+
Category="windows.appExecutionAlias"
41+
Executable="files.exe"
42+
EntryPoint="files.App">
43+
<uap5:AppExecutionAlias>
44+
<uap5:ExecutionAlias Alias="files.exe"/>
45+
</uap5:AppExecutionAlias>
46+
</uap5:Extension>
47+
</Extensions>
48+
</Application>
49+
</Applications>
50+
<Capabilities>
51+
<rescap:Capability Name="packageQuery"/>
52+
<rescap:Capability Name="runFullTrust" />
53+
<rescap:Capability Name="broadFileSystemAccess" />
54+
<uap:Capability Name="removableStorage" />
55+
<Capability Name="internetClient"/>
56+
</Capabilities>
5657
</Package>

Files/App.xaml.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static IShellPage CurrentInstance
5454
public static ObservableCollection<WSLDistroItem> linuxDistroItems = new ObservableCollection<WSLDistroItem>();
5555
public static SettingsViewModel AppSettings { get; set; }
5656
public static InteractionViewModel InteractionViewModel { get; set; }
57+
public static SelectedItemPropertiesViewModel SelectedItemPropertiesViewModel { get; set; }
5758

5859
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
5960

@@ -80,6 +81,7 @@ public App()
8081

8182
AppSettings = new SettingsViewModel();
8283
InteractionViewModel = new InteractionViewModel();
84+
SelectedItemPropertiesViewModel = new SelectedItemPropertiesViewModel();
8385
}
8486

8587
private void RegisterUncaughtExceptionLogger()
@@ -163,18 +165,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
163165
//start tracking app usage
164166
SystemInformation.TrackAppUse(e);
165167

166-
if (SystemInformation.IsAppUpdated)
167-
{
168-
var dialog = new ContentDialog()
169-
{
170-
Title = "What's new in v0.7.5",
171-
Content = "• Fixed a crash that would sometimes occur when right clicking on a file or folder.\n• Fixed an issue where the status bar wouldn't hide on the new tab page.\n• Fixed an issue where clicking on the quick access item for home wouldn't navigate to the home page.\n• Fixed a bug that prevented users from right clicking on the navigation bar.",
172-
PrimaryButtonText = "Lets go!"
173-
};
174-
175-
dialog.ShowAsync();
176-
}
177-
178168
Logger.Info("App launched");
179169

180170
bool canEnablePrelaunch = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch");

Files/BaseLayout.cs

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.IO;
99
using System.Linq;
1010
using System.Runtime.CompilerServices;
11+
using Windows.ApplicationModel.DataTransfer;
1112
using Windows.Storage;
1213
using Windows.UI.Core;
1314
using Windows.UI.Xaml;
@@ -73,6 +74,7 @@ internal set
7374
{
7475
IsItemSelected = true;
7576
}
77+
SetSelectedItemsOnUi(value);
7678
NotifyPropertyChanged("SelectedItems");
7779
}
7880
}
@@ -98,6 +100,7 @@ internal set
98100
{
99101
IsItemSelected = true;
100102
}
103+
SetSelectedItemOnUi(value);
101104
NotifyPropertyChanged("SelectedItem");
102105
}
103106
}
@@ -119,6 +122,12 @@ public BaseLayout()
119122
}
120123
}
121124

125+
protected abstract void SetSelectedItemOnUi(ListedItem selectedItem);
126+
127+
protected abstract void SetSelectedItemsOnUi(List<ListedItem> selectedItems);
128+
129+
protected abstract ListedItem GetItemFromElement(object element);
130+
122131
private void AppSettings_LayoutModeChangeRequested(object sender, EventArgs e)
123132
{
124133
if (App.CurrentInstance.ContentPage != null)
@@ -144,7 +153,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
144153
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
145154
}
146155

147-
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
156+
protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
148157
{
149158
base.OnNavigatedTo(eventArgs);
150159
// Add item jumping handler
@@ -171,9 +180,9 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
171180
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true;
172181
}
173182

174-
App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.WorkingDirectory);
175-
App.Clipboard_ContentChanged(null, null);
183+
await App.CurrentInstance.ViewModel.RefreshItems();
176184

185+
App.Clipboard_ContentChanged(null, null);
177186
App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters;
178187
}
179188

@@ -273,5 +282,93 @@ protected virtual void Page_CharacterReceived(CoreWindow sender, CharacterReceiv
273282
char letterPressed = Convert.ToChar(args.KeyCode);
274283
App.CurrentInstance.InteractionOperations.PushJumpChar(letterPressed);
275284
}
285+
286+
protected async void List_DragOver(object sender, DragEventArgs e)
287+
{
288+
if (e.DataView.Contains(StandardDataFormats.StorageItems))
289+
{
290+
IReadOnlyList<IStorageItem> draggedItems = await e.DataView.GetStorageItemsAsync();
291+
// As long as one file doesn't already belong to this folder
292+
if (draggedItems.Any(draggedItem => !Directory.GetParent(draggedItem.Path).FullName.Equals(App.CurrentInstance.ViewModel.WorkingDirectory, StringComparison.OrdinalIgnoreCase)))
293+
{
294+
e.AcceptedOperation = DataPackageOperation.Copy;
295+
e.Handled = true;
296+
}
297+
else
298+
{
299+
e.AcceptedOperation = DataPackageOperation.None;
300+
}
301+
}
302+
}
303+
304+
protected async void List_Drop(object sender, DragEventArgs e)
305+
{
306+
if (e.DataView.Contains(StandardDataFormats.StorageItems))
307+
{
308+
await AssociatedInteractions.PasteItems(e.DataView, App.CurrentInstance.ViewModel.WorkingDirectory, e.AcceptedOperation);
309+
e.Handled = true;
310+
}
311+
}
312+
313+
protected async void Item_DragStarting(object sender, DragStartingEventArgs e)
314+
{
315+
List<IStorageItem> selectedStorageItems = new List<IStorageItem>();
316+
foreach (ListedItem item in App.CurrentInstance.ContentPage.SelectedItems)
317+
{
318+
if (item.PrimaryItemAttribute == StorageItemTypes.File)
319+
selectedStorageItems.Add(await StorageFile.GetFileFromPathAsync(item.ItemPath));
320+
else if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
321+
selectedStorageItems.Add(await StorageFolder.GetFolderFromPathAsync(item.ItemPath));
322+
}
323+
324+
e.Data.SetStorageItems(selectedStorageItems);
325+
e.DragUI.SetContentFromDataPackage();
326+
}
327+
328+
protected async void Item_DragOver(object sender, DragEventArgs e)
329+
{
330+
ListedItem item = GetItemFromElement(sender);
331+
if (e.DataView.Contains(StandardDataFormats.StorageItems))
332+
{
333+
e.Handled = true;
334+
IReadOnlyList<IStorageItem> draggedItems = await e.DataView.GetStorageItemsAsync();
335+
// Items from the same parent folder as this folder are dragged into this folder, so we move the items instead of copy
336+
if (draggedItems.Any(draggedItem => Directory.GetParent(draggedItem.Path).FullName == Directory.GetParent(item.ItemPath).FullName))
337+
{
338+
e.AcceptedOperation = DataPackageOperation.Move;
339+
}
340+
else
341+
{
342+
e.AcceptedOperation = DataPackageOperation.Copy;
343+
}
344+
}
345+
}
346+
347+
protected async void Item_Drop(object sender, DragEventArgs e)
348+
{
349+
e.Handled = true;
350+
ListedItem rowItem = GetItemFromElement(sender);
351+
await App.CurrentInstance.InteractionOperations.PasteItems(e.DataView, rowItem.ItemPath, e.AcceptedOperation);
352+
}
353+
354+
protected void InitializeDrag(UIElement element)
355+
{
356+
ListedItem item = GetItemFromElement(element);
357+
if(item != null)
358+
{
359+
element.AllowDrop = false;
360+
element.DragStarting -= Item_DragStarting;
361+
element.DragStarting += Item_DragStarting;
362+
element.DragOver -= Item_DragOver;
363+
element.Drop -= Item_Drop;
364+
if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
365+
{
366+
element.AllowDrop = true;
367+
element.DragOver += Item_DragOver;
368+
element.Drop += Item_Drop;
369+
}
370+
}
371+
}
372+
276373
}
277374
}

0 commit comments

Comments
 (0)