Skip to content

Commit

Permalink
v0.8.1 (#789)
Browse files Browse the repository at this point in the history
Co-authored-by: ADeltaX <adeltaxsystem@gmail.com>
Co-authored-by: Thomas <Thomas.Klemenc@gmail.com>
Co-authored-by: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com>
Co-authored-by: PhonerApp <63700223+PhonerApp@users.noreply.github.com>
Co-authored-by: Vladyslav <tsvetkov_vlad@ukr.net>
Co-authored-by: ADeltaX <adeltaxsystem@gmail.com>
Co-authored-by: Thomas <Thomas.Klemenc@gmail.com>
Co-authored-by: ADeltaX <info@adeltax.com>
Co-authored-by: Jg's House <45227503+Jaiganeshkumaran@users.noreply.github.com>
Co-authored-by: PhonerApp <63700223+PhonerApp@users.noreply.github.com>
Co-authored-by: Dylan-Osborne <46000533+Dylan-Osborne@users.noreply.github.com>
Co-authored-by: Richard <richard_herminio@outlook.com>
Co-authored-by: Luke Blevins <lukeblevins15@gmail.com>
  • Loading branch information
10 people committed May 15, 2020
1 parent 6eaa0a5 commit d092f76
Show file tree
Hide file tree
Showing 35 changed files with 456 additions and 686 deletions.
2 changes: 1 addition & 1 deletion Files.Package/Package.appxmanifest
@@ -1,6 +1,6 @@
<?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="FilesUWPDev" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.8.0.0" />
<Identity Name="FilesUWPDev" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.8.1.0" />
<Properties>
<DisplayName>Files UWP - Dev</DisplayName>
<PublisherDisplayName>Yair A</PublisherDisplayName>
Expand Down
5 changes: 0 additions & 5 deletions Files/App.xaml
Expand Up @@ -11,8 +11,6 @@
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="White" />
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="White" />
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="White" />
<SolidColorBrush x:Key="YourHomeCardBackgroundColor" Color="#f3f1ef" />
<SolidColorBrush x:Key="YourHomeCardBorderColor" Color="#f3f1ef" />
Expand All @@ -23,8 +21,6 @@
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="#191919" />
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="#191919" />
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#191919" />
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="Black" />
<StaticResource x:Key="YourHomeCardBackgroundColor" ResourceKey="TextControlBackground" />
Expand All @@ -34,7 +30,6 @@
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="#191919" />
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundPressed" Color="#191919" />
<SolidColorBrush x:Key="CustomInputFieldBorderBrush" Color="#FF363636" />
<!--<SolidColorBrush x:Key="TextControlBorderBrush" Color="#FF363636" />-->
<SolidColorBrush x:Key="RibbonBackgroundColor" Color="#131313" />
<StaticResource x:Key="NavigationViewTopPaneBackground" ResourceKey="RibbonBackgroundColor" />
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
Expand Down
37 changes: 0 additions & 37 deletions Files/App.xaml.cs
Expand Up @@ -64,34 +64,6 @@ public static IShellPage CurrentInstance

public App()
{
var args = Environment.GetCommandLineArgs();

if (args.Length == 2)
{
var parsedCommands = CommandLineParser.ParseUntrustedCommands(args);

if (parsedCommands != null && parsedCommands.Count > 0)
{
foreach (var command in parsedCommands)
{
switch (command.Type)
{
case ParsedCommandType.ExplorerShellCommand:
var proc = Process.GetCurrentProcess();
OpenShellCommandInExplorer(command.Payload, proc.Id).GetAwaiter().GetResult();

//this is useless.
Exit();
return;
default:
break;
}
}
}


}

InitializeComponent();
Suspending += OnSuspending;

Expand Down Expand Up @@ -340,15 +312,6 @@ protected override async void OnActivated(IActivatedEventArgs args)
Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed;
}

public static async Task OpenShellCommandInExplorer(string shellCommand, int pid)
{
System.Diagnostics.Debug.WriteLine("Launching shell command in FullTrustProcess");
ApplicationData.Current.LocalSettings.Values["ShellCommand"] = shellCommand;
ApplicationData.Current.LocalSettings.Values["Arguments"] = "ShellCommand";
ApplicationData.Current.LocalSettings.Values["pid"] = pid;
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
}

private void TryEnablePrelaunch()
{
Windows.ApplicationModel.Core.CoreApplication.EnablePrelaunch(true);
Expand Down
19 changes: 11 additions & 8 deletions Files/BaseLayout.cs
Expand Up @@ -221,15 +221,18 @@ public void RightClickContextMenu_Opening(object sender, object e)
{
var selectedDataItem = selectedFileSystemItems[0] as ListedItem;

if (selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
if (!string.IsNullOrEmpty(selectedDataItem.FileExtension))
{
UnloadMenuFlyoutItemByName("OpenItem");
this.FindName("UnzipItem");
}
else if (!selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
{
this.FindName("OpenItem");
UnloadMenuFlyoutItemByName("UnzipItem");
if (selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
{
UnloadMenuFlyoutItemByName("OpenItem");
this.FindName("UnzipItem");
}
else if (!selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
{
this.FindName("OpenItem");
UnloadMenuFlyoutItemByName("UnzipItem");
}
}
}
else if (selectedFileSystemItems.Count > 1)
Expand Down
21 changes: 11 additions & 10 deletions Files/Files.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -30,7 +30,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
Expand All @@ -41,7 +41,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
Expand All @@ -55,7 +55,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
Expand All @@ -66,7 +66,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
Expand All @@ -80,7 +80,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
Expand All @@ -92,7 +92,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
Expand All @@ -106,7 +106,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
Expand All @@ -117,7 +117,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
Expand Down Expand Up @@ -156,6 +156,7 @@
<Compile Include="Helpers\StringExtensions.cs" />
<Compile Include="Helpers\NegateConverter.cs" />
<Compile Include="Helpers\ThemeHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="ResourceController.cs" />
<Compile Include="UserControls\NavigationToolbar\INavigationToolbar.cs" />
<Compile Include="UserControls\NavigationToolbar\ModernNavigationToolbar.xaml.cs">
Expand Down Expand Up @@ -497,7 +498,7 @@
<Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.4.0-prerelease.200113001</Version>
<Version>2.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry">
<Version>5.0.0-preview.1.20120.5</Version>
Expand Down
42 changes: 15 additions & 27 deletions Files/Filesystem/Drives.cs
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
Expand Down Expand Up @@ -51,37 +51,25 @@ public DrivesManager()
});
}

private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
private void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
{
// Only update collection from UI-thread
try
if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == ResourceController.GetTranslation("SidebarDrives")) == null)
{
App.sideBarItems.Add(new HeaderTextItem() { Text = ResourceController.GetTranslation("SidebarDrives") });
}
foreach (DriveItem drive in Drives)
{
await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
if (!App.sideBarItems.Contains(drive))
{
if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == ResourceController.GetTranslation("SidebarDrives")) == null)
{
App.sideBarItems.Add(new HeaderTextItem() { Text = ResourceController.GetTranslation("SidebarDrives") });
}
foreach (DriveItem drive in Drives)
{
if (!App.sideBarItems.Contains(drive))
{
App.sideBarItems.Add(drive);
}
}
foreach (INavigationControlItem item in App.sideBarItems.ToList())
{
if (item is DriveItem && !Drives.Contains(item))
{
App.sideBarItems.Remove(item);
}
}
});
App.sideBarItems.Add(drive);
}
}
catch (Exception)
foreach (INavigationControlItem item in App.sideBarItems.ToList())
{
// UI thread not created yet?
if (item is DriveItem && !Drives.Contains(item))
{
App.sideBarItems.Remove(item);
}
}
}

Expand Down
23 changes: 17 additions & 6 deletions Files/Interacts/Interaction.cs
Expand Up @@ -75,6 +75,22 @@ public async void SetAsDesktopBackgroundItem_Click(object sender, RoutedEventArg
await profileSettings.TrySetWallpaperImageAsync(file);
}

public async void SetAsLockscreenBackgroundItem_Click(object sender, RoutedEventArgs e)
{
// Get the path of the selected file
StorageFile sourceFile = await StorageFile.GetFileFromPathAsync((CurrentInstance.ContentPage as BaseLayout).SelectedItem.ItemPath);

// Get the app's local folder to use as the destination folder.
StorageFolder localFolder = ApplicationData.Current.LocalFolder;

// Copy the file to the destination folder.
// Replace the existing file if the file already exists.
StorageFile file = await sourceFile.CopyAsync(localFolder, "Background.png", NameCollisionOption.ReplaceExisting);

// Set the lockscreen background
await LockScreen.SetImageFileAsync(file);
}

public void OpenNewTab()
{
instanceTabsView.AddNewTab(typeof(ModernShellPage), "New tab");
Expand Down Expand Up @@ -1132,16 +1148,11 @@ public async void ToggleQuickLook()
{
try
{
string selectedItemPath = null;
int selectedItemCount;
Type sourcePageType = App.CurrentInstance.CurrentPageType;
selectedItemCount = (CurrentInstance.ContentPage as BaseLayout).SelectedItems.Count;
if (selectedItemCount == 1)
{
selectedItemPath = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0].ItemPath;
}

if (selectedItemCount == 1)
if (selectedItemCount == 1 && !App.CurrentInstance.ContentPage.isRenamingItem)
{
var clickedOnItem = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0];

Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.de-DE.xlf
Expand Up @@ -631,6 +631,10 @@
<source>Replace existing item</source>
<target state="new">Replace existing item</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="new">Set as lockscreen background</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.es-ES.xlf
Expand Up @@ -630,6 +630,10 @@
<source>Replace existing item</source>
<target state="translated">Reemplazar elemento existente</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="translated">Establecer como fondo de pantalla de bloqueo</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.fr-FR.xlf
Expand Up @@ -632,6 +632,10 @@
<source>Replace existing item</source>
<target state="new">Replace existing item</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="new">Set as lockscreen background</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.it-IT.xlf
Expand Up @@ -631,6 +631,10 @@
<source>Replace existing item</source>
<target state="new">Replace existing item</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="new">Set as lockscreen background</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.nl-NL.xlf
Expand Up @@ -632,6 +632,10 @@
<source>Replace existing item</source>
<target state="new">Replace existing item</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="new">Set as lockscreen background</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Files/MultilingualResources/Files.pl-PL.xlf
Expand Up @@ -632,6 +632,10 @@
<source>Replace existing item</source>
<target state="new">Replace existing item</target>
</trans-unit>
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
<source>Set as lockscreen background</source>
<target state="new">Set as lockscreen background</target>
</trans-unit>
</group>
</body>
</file>
Expand Down

0 comments on commit d092f76

Please sign in to comment.