Skip to content

Commit

Permalink
v0.7.6 (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Apr 14, 2020
1 parent f89b3ad commit 6c00418
Show file tree
Hide file tree
Showing 63 changed files with 5,179 additions and 1,086 deletions.
3 changes: 3 additions & 0 deletions .devbots/needs-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enabled: true
label: "needs-review"
delay: 30
2 changes: 1 addition & 1 deletion Files.Launcher/Files.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>ProcessLauncher</RootNamespace>
<AssemblyName>ProcessLauncher</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
Expand Down
14 changes: 7 additions & 7 deletions Files.Launcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ static void Main(string[] args)
if (arguments.Equals("StartupTasks"))
{
// Detect User Paths
ApplicationData.Current.LocalSettings.Values["DetectedDesktopLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
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);
ApplicationData.Current.LocalSettings.Values["DetectedDocumentsLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
ApplicationData.Current.LocalSettings.Values["DetectedPicturesLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
ApplicationData.Current.LocalSettings.Values["DetectedMusicLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
ApplicationData.Current.LocalSettings.Values["DetectedVideosLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
ApplicationData.Current.LocalSettings.Values["DetectedOneDriveLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);
ApplicationData.Current.LocalSettings.Values["DesktopPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
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);
ApplicationData.Current.LocalSettings.Values["DocumentsPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
ApplicationData.Current.LocalSettings.Values["PicturesPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
ApplicationData.Current.LocalSettings.Values["MusicPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
ApplicationData.Current.LocalSettings.Values["VideosPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
ApplicationData.Current.LocalSettings.Values["OneDrivePath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);

// Check QuickLook Availability
QuickLook.CheckQuickLookAvailability(localSettings);
Expand Down
2 changes: 1 addition & 1 deletion Files.Launcher/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
107 changes: 54 additions & 53 deletions Files.Package/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.5.0" />
<Properties>
<DisplayName>Files UWP - Preview</DisplayName>
<PublisherDisplayName>Yair A</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$" desktop4:SupportsMultipleInstances="true">
<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">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png" ShortName="Files">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
<uap:ShowOn Tile="square310x310Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" uap5:Optional="true" />
</uap:VisualElements>
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="Files.Launcher\ProcessLauncher.exe">
<desktop:FullTrustProcess>
<desktop:ParameterGroup GroupId="DesktopAppExeGroup" Parameters="/DesktopApp"/>
<desktop:ParameterGroup GroupId="TerminalGroup" Parameters="/Terminal"/>
<desktop:ParameterGroup GroupId="UserFolderPathsGroup" Parameters="/DetectUserPaths"/>
</desktop:FullTrustProcess>
</desktop:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
</uap:Extension>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="files.exe"
EntryPoint="files.App">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="files.exe"/>
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<uap:Capability Name="removableStorage" />
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="broadFileSystemAccess" />
<Capability Name="internetClient"/>
</Capabilities>
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.6.0" />
<Properties>
<DisplayName>Files UWP - Preview</DisplayName>
<PublisherDisplayName>Yair A</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$" desktop4:SupportsMultipleInstances="true">
<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">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png" ShortName="Files">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
<uap:ShowOn Tile="square310x310Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" uap5:Optional="true" />
</uap:VisualElements>
<Extensions>
<desktop:Extension Category="windows.fullTrustProcess" Executable="Files.Launcher\ProcessLauncher.exe">
<desktop:FullTrustProcess>
<desktop:ParameterGroup GroupId="DesktopAppExeGroup" Parameters="/DesktopApp"/>
<desktop:ParameterGroup GroupId="TerminalGroup" Parameters="/Terminal"/>
<desktop:ParameterGroup GroupId="UserFolderPathsGroup" Parameters="/DetectUserPaths"/>
</desktop:FullTrustProcess>
</desktop:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
</uap:Extension>
<uap5:Extension
Category="windows.appExecutionAlias"
Executable="files.exe"
EntryPoint="files.App">
<uap5:AppExecutionAlias>
<uap5:ExecutionAlias Alias="files.exe"/>
</uap5:AppExecutionAlias>
</uap5:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="packageQuery"/>
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="broadFileSystemAccess" />
<uap:Capability Name="removableStorage" />
<Capability Name="internetClient"/>
</Capabilities>
</Package>
14 changes: 2 additions & 12 deletions Files/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static IShellPage CurrentInstance
public static ObservableCollection<WSLDistroItem> linuxDistroItems = new ObservableCollection<WSLDistroItem>();
public static SettingsViewModel AppSettings { get; set; }
public static InteractionViewModel InteractionViewModel { get; set; }
public static SelectedItemPropertiesViewModel SelectedItemPropertiesViewModel { get; set; }

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

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

AppSettings = new SettingsViewModel();
InteractionViewModel = new InteractionViewModel();
SelectedItemPropertiesViewModel = new SelectedItemPropertiesViewModel();
}

private void RegisterUncaughtExceptionLogger()
Expand Down Expand Up @@ -163,18 +165,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
//start tracking app usage
SystemInformation.TrackAppUse(e);

if (SystemInformation.IsAppUpdated)
{
var dialog = new ContentDialog()
{
Title = "What's new in v0.7.5",
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.",
PrimaryButtonText = "Lets go!"
};

dialog.ShowAsync();
}

Logger.Info("App launched");

bool canEnablePrelaunch = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch");
Expand Down
103 changes: 100 additions & 3 deletions Files/BaseLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
using Windows.UI.Core;
using Windows.UI.Xaml;
Expand Down Expand Up @@ -73,6 +74,7 @@ internal set
{
IsItemSelected = true;
}
SetSelectedItemsOnUi(value);
NotifyPropertyChanged("SelectedItems");
}
}
Expand All @@ -98,6 +100,7 @@ internal set
{
IsItemSelected = true;
}
SetSelectedItemOnUi(value);
NotifyPropertyChanged("SelectedItem");
}
}
Expand All @@ -119,6 +122,12 @@ public BaseLayout()
}
}

protected abstract void SetSelectedItemOnUi(ListedItem selectedItem);

protected abstract void SetSelectedItemsOnUi(List<ListedItem> selectedItems);

protected abstract ListedItem GetItemFromElement(object element);

private void AppSettings_LayoutModeChangeRequested(object sender, EventArgs e)
{
if (App.CurrentInstance.ContentPage != null)
Expand All @@ -144,7 +153,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
{
base.OnNavigatedTo(eventArgs);
// Add item jumping handler
Expand All @@ -171,9 +180,9 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true;
}

App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.WorkingDirectory);
App.Clipboard_ContentChanged(null, null);
await App.CurrentInstance.ViewModel.RefreshItems();

App.Clipboard_ContentChanged(null, null);
App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters;
}

Expand Down Expand Up @@ -273,5 +282,93 @@ protected virtual void Page_CharacterReceived(CoreWindow sender, CharacterReceiv
char letterPressed = Convert.ToChar(args.KeyCode);
App.CurrentInstance.InteractionOperations.PushJumpChar(letterPressed);
}

protected async void List_DragOver(object sender, DragEventArgs e)
{
if (e.DataView.Contains(StandardDataFormats.StorageItems))
{
IReadOnlyList<IStorageItem> draggedItems = await e.DataView.GetStorageItemsAsync();
// As long as one file doesn't already belong to this folder
if (draggedItems.Any(draggedItem => !Directory.GetParent(draggedItem.Path).FullName.Equals(App.CurrentInstance.ViewModel.WorkingDirectory, StringComparison.OrdinalIgnoreCase)))
{
e.AcceptedOperation = DataPackageOperation.Copy;
e.Handled = true;
}
else
{
e.AcceptedOperation = DataPackageOperation.None;
}
}
}

protected async void List_Drop(object sender, DragEventArgs e)
{
if (e.DataView.Contains(StandardDataFormats.StorageItems))
{
await AssociatedInteractions.PasteItems(e.DataView, App.CurrentInstance.ViewModel.WorkingDirectory, e.AcceptedOperation);
e.Handled = true;
}
}

protected async void Item_DragStarting(object sender, DragStartingEventArgs e)
{
List<IStorageItem> selectedStorageItems = new List<IStorageItem>();
foreach (ListedItem item in App.CurrentInstance.ContentPage.SelectedItems)
{
if (item.PrimaryItemAttribute == StorageItemTypes.File)
selectedStorageItems.Add(await StorageFile.GetFileFromPathAsync(item.ItemPath));
else if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
selectedStorageItems.Add(await StorageFolder.GetFolderFromPathAsync(item.ItemPath));
}

e.Data.SetStorageItems(selectedStorageItems);
e.DragUI.SetContentFromDataPackage();
}

protected async void Item_DragOver(object sender, DragEventArgs e)
{
ListedItem item = GetItemFromElement(sender);
if (e.DataView.Contains(StandardDataFormats.StorageItems))
{
e.Handled = true;
IReadOnlyList<IStorageItem> draggedItems = await e.DataView.GetStorageItemsAsync();
// Items from the same parent folder as this folder are dragged into this folder, so we move the items instead of copy
if (draggedItems.Any(draggedItem => Directory.GetParent(draggedItem.Path).FullName == Directory.GetParent(item.ItemPath).FullName))
{
e.AcceptedOperation = DataPackageOperation.Move;
}
else
{
e.AcceptedOperation = DataPackageOperation.Copy;
}
}
}

protected async void Item_Drop(object sender, DragEventArgs e)
{
e.Handled = true;
ListedItem rowItem = GetItemFromElement(sender);
await App.CurrentInstance.InteractionOperations.PasteItems(e.DataView, rowItem.ItemPath, e.AcceptedOperation);
}

protected void InitializeDrag(UIElement element)
{
ListedItem item = GetItemFromElement(element);
if(item != null)
{
element.AllowDrop = false;
element.DragStarting -= Item_DragStarting;
element.DragStarting += Item_DragStarting;
element.DragOver -= Item_DragOver;
element.Drop -= Item_Drop;
if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
{
element.AllowDrop = true;
element.DragOver += Item_DragOver;
element.Drop += Item_Drop;
}
}
}

}
}
Loading

0 comments on commit 6c00418

Please sign in to comment.