Skip to content

Commit d092f76

Browse files
yaira2ADeltaXt-k365PhonerApptsvietOK
authored
v0.8.1 (#789)
Co-authored-by: ADeltaX <[email protected]> Co-authored-by: Thomas <[email protected]> Co-authored-by: Yair Aichenbaum <[email protected]> Co-authored-by: PhonerApp <[email protected]> Co-authored-by: Vladyslav <[email protected]> Co-authored-by: ADeltaX <[email protected]> Co-authored-by: Thomas <[email protected]> Co-authored-by: ADeltaX <[email protected]> Co-authored-by: Jg's House <[email protected]> Co-authored-by: PhonerApp <[email protected]> Co-authored-by: Dylan-Osborne <[email protected]> Co-authored-by: Richard <[email protected]> Co-authored-by: Luke Blevins <[email protected]>
1 parent 6eaa0a5 commit d092f76

35 files changed

+456
-686
lines changed

Files.Package/Package.appxmanifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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="FilesUWPDev" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.8.0.0" />
3+
<Identity Name="FilesUWPDev" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.8.1.0" />
44
<Properties>
55
<DisplayName>Files UWP - Dev</DisplayName>
66
<PublisherDisplayName>Yair A</PublisherDisplayName>

Files/App.xaml

-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<ResourceDictionary>
1212
<ResourceDictionary.ThemeDictionaries>
1313
<ResourceDictionary x:Key="Light">
14-
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="White" />
15-
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="White" />
1614
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="White" />
1715
<SolidColorBrush x:Key="YourHomeCardBackgroundColor" Color="#f3f1ef" />
1816
<SolidColorBrush x:Key="YourHomeCardBorderColor" Color="#f3f1ef" />
@@ -23,8 +21,6 @@
2321
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
2422
</ResourceDictionary>
2523
<ResourceDictionary x:Key="Dark">
26-
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="#191919" />
27-
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="#191919" />
2824
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#191919" />
2925
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="Black" />
3026
<StaticResource x:Key="YourHomeCardBackgroundColor" ResourceKey="TextControlBackground" />
@@ -34,7 +30,6 @@
3430
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="#191919" />
3531
<SolidColorBrush x:Key="TabViewItemHeaderBackgroundPressed" Color="#191919" />
3632
<SolidColorBrush x:Key="CustomInputFieldBorderBrush" Color="#FF363636" />
37-
<!--<SolidColorBrush x:Key="TextControlBorderBrush" Color="#FF363636" />-->
3833
<SolidColorBrush x:Key="RibbonBackgroundColor" Color="#131313" />
3934
<StaticResource x:Key="NavigationViewTopPaneBackground" ResourceKey="RibbonBackgroundColor" />
4035
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />

Files/App.xaml.cs

-37
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,6 @@ public static IShellPage CurrentInstance
6464

6565
public App()
6666
{
67-
var args = Environment.GetCommandLineArgs();
68-
69-
if (args.Length == 2)
70-
{
71-
var parsedCommands = CommandLineParser.ParseUntrustedCommands(args);
72-
73-
if (parsedCommands != null && parsedCommands.Count > 0)
74-
{
75-
foreach (var command in parsedCommands)
76-
{
77-
switch (command.Type)
78-
{
79-
case ParsedCommandType.ExplorerShellCommand:
80-
var proc = Process.GetCurrentProcess();
81-
OpenShellCommandInExplorer(command.Payload, proc.Id).GetAwaiter().GetResult();
82-
83-
//this is useless.
84-
Exit();
85-
return;
86-
default:
87-
break;
88-
}
89-
}
90-
}
91-
92-
93-
}
94-
9567
InitializeComponent();
9668
Suspending += OnSuspending;
9769

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

343-
public static async Task OpenShellCommandInExplorer(string shellCommand, int pid)
344-
{
345-
System.Diagnostics.Debug.WriteLine("Launching shell command in FullTrustProcess");
346-
ApplicationData.Current.LocalSettings.Values["ShellCommand"] = shellCommand;
347-
ApplicationData.Current.LocalSettings.Values["Arguments"] = "ShellCommand";
348-
ApplicationData.Current.LocalSettings.Values["pid"] = pid;
349-
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
350-
}
351-
352315
private void TryEnablePrelaunch()
353316
{
354317
Windows.ApplicationModel.Core.CoreApplication.EnablePrelaunch(true);

Files/BaseLayout.cs

+11-8
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,18 @@ public void RightClickContextMenu_Opening(object sender, object e)
221221
{
222222
var selectedDataItem = selectedFileSystemItems[0] as ListedItem;
223223

224-
if (selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
224+
if (!string.IsNullOrEmpty(selectedDataItem.FileExtension))
225225
{
226-
UnloadMenuFlyoutItemByName("OpenItem");
227-
this.FindName("UnzipItem");
228-
}
229-
else if (!selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
230-
{
231-
this.FindName("OpenItem");
232-
UnloadMenuFlyoutItemByName("UnzipItem");
226+
if (selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
227+
{
228+
UnloadMenuFlyoutItemByName("OpenItem");
229+
this.FindName("UnzipItem");
230+
}
231+
else if (!selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
232+
{
233+
this.FindName("OpenItem");
234+
UnloadMenuFlyoutItemByName("UnzipItem");
235+
}
233236
}
234237
}
235238
else if (selectedFileSystemItems.Count > 1)

Files/Files.csproj

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
@@ -30,7 +30,7 @@
3030
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
3131
<DebugSymbols>true</DebugSymbols>
3232
<OutputPath>bin\x86\Debug\</OutputPath>
33-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
33+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
3434
<NoWarn>;2008</NoWarn>
3535
<DebugType>full</DebugType>
3636
<PlatformTarget>x86</PlatformTarget>
@@ -41,7 +41,7 @@
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
4343
<OutputPath>bin\x86\Release\</OutputPath>
44-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
44+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
4545
<Optimize>true</Optimize>
4646
<NoWarn>;2008</NoWarn>
4747
<DebugType>pdbonly</DebugType>
@@ -55,7 +55,7 @@
5555
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
5656
<DebugSymbols>true</DebugSymbols>
5757
<OutputPath>bin\ARM\Debug\</OutputPath>
58-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
58+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
5959
<NoWarn>;2008</NoWarn>
6060
<DebugType>full</DebugType>
6161
<PlatformTarget>ARM</PlatformTarget>
@@ -66,7 +66,7 @@
6666
</PropertyGroup>
6767
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
6868
<OutputPath>bin\ARM\Release\</OutputPath>
69-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
69+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
7070
<Optimize>true</Optimize>
7171
<NoWarn>;2008</NoWarn>
7272
<DebugType>pdbonly</DebugType>
@@ -80,7 +80,7 @@
8080
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
8181
<DebugSymbols>true</DebugSymbols>
8282
<OutputPath>bin\ARM64\Debug\</OutputPath>
83-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
83+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
8484
<NoWarn>;2008</NoWarn>
8585
<DebugType>full</DebugType>
8686
<PlatformTarget>ARM64</PlatformTarget>
@@ -92,7 +92,7 @@
9292
</PropertyGroup>
9393
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
9494
<OutputPath>bin\ARM64\Release\</OutputPath>
95-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
95+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
9696
<Optimize>true</Optimize>
9797
<NoWarn>;2008</NoWarn>
9898
<DebugType>pdbonly</DebugType>
@@ -106,7 +106,7 @@
106106
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
107107
<DebugSymbols>true</DebugSymbols>
108108
<OutputPath>bin\x64\Debug\</OutputPath>
109-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
109+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
110110
<NoWarn>;2008</NoWarn>
111111
<DebugType>full</DebugType>
112112
<PlatformTarget>x64</PlatformTarget>
@@ -117,7 +117,7 @@
117117
</PropertyGroup>
118118
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
119119
<OutputPath>bin\x64\Release\</OutputPath>
120-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
120+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
121121
<Optimize>true</Optimize>
122122
<NoWarn>;2008</NoWarn>
123123
<DebugType>pdbonly</DebugType>
@@ -156,6 +156,7 @@
156156
<Compile Include="Helpers\StringExtensions.cs" />
157157
<Compile Include="Helpers\NegateConverter.cs" />
158158
<Compile Include="Helpers\ThemeHelper.cs" />
159+
<Compile Include="Program.cs" />
159160
<Compile Include="ResourceController.cs" />
160161
<Compile Include="UserControls\NavigationToolbar\INavigationToolbar.cs" />
161162
<Compile Include="UserControls\NavigationToolbar\ModernNavigationToolbar.xaml.cs">
@@ -497,7 +498,7 @@
497498
<Version>6.0.0</Version>
498499
</PackageReference>
499500
<PackageReference Include="Microsoft.UI.Xaml">
500-
<Version>2.4.0-prerelease.200113001</Version>
501+
<Version>2.4.0</Version>
501502
</PackageReference>
502503
<PackageReference Include="Microsoft.Win32.Registry">
503504
<Version>5.0.0-preview.1.20120.5</Version>

Files/Filesystem/Drives.cs

+15-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
44
using System.Diagnostics;
@@ -51,37 +51,25 @@ public DrivesManager()
5151
});
5252
}
5353

54-
private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
54+
private void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object args)
5555
{
56-
// Only update collection from UI-thread
57-
try
56+
if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == ResourceController.GetTranslation("SidebarDrives")) == null)
57+
{
58+
App.sideBarItems.Add(new HeaderTextItem() { Text = ResourceController.GetTranslation("SidebarDrives") });
59+
}
60+
foreach (DriveItem drive in Drives)
5861
{
59-
await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
62+
if (!App.sideBarItems.Contains(drive))
6063
{
61-
if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == ResourceController.GetTranslation("SidebarDrives")) == null)
62-
{
63-
App.sideBarItems.Add(new HeaderTextItem() { Text = ResourceController.GetTranslation("SidebarDrives") });
64-
}
65-
foreach (DriveItem drive in Drives)
66-
{
67-
if (!App.sideBarItems.Contains(drive))
68-
{
69-
App.sideBarItems.Add(drive);
70-
}
71-
}
72-
73-
foreach (INavigationControlItem item in App.sideBarItems.ToList())
74-
{
75-
if (item is DriveItem && !Drives.Contains(item))
76-
{
77-
App.sideBarItems.Remove(item);
78-
}
79-
}
80-
});
64+
App.sideBarItems.Add(drive);
65+
}
8166
}
82-
catch (Exception)
67+
foreach (INavigationControlItem item in App.sideBarItems.ToList())
8368
{
84-
// UI thread not created yet?
69+
if (item is DriveItem && !Drives.Contains(item))
70+
{
71+
App.sideBarItems.Remove(item);
72+
}
8573
}
8674
}
8775

Files/Interacts/Interaction.cs

+17-6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ public async void SetAsDesktopBackgroundItem_Click(object sender, RoutedEventArg
7575
await profileSettings.TrySetWallpaperImageAsync(file);
7676
}
7777

78+
public async void SetAsLockscreenBackgroundItem_Click(object sender, RoutedEventArgs e)
79+
{
80+
// Get the path of the selected file
81+
StorageFile sourceFile = await StorageFile.GetFileFromPathAsync((CurrentInstance.ContentPage as BaseLayout).SelectedItem.ItemPath);
82+
83+
// Get the app's local folder to use as the destination folder.
84+
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
85+
86+
// Copy the file to the destination folder.
87+
// Replace the existing file if the file already exists.
88+
StorageFile file = await sourceFile.CopyAsync(localFolder, "Background.png", NameCollisionOption.ReplaceExisting);
89+
90+
// Set the lockscreen background
91+
await LockScreen.SetImageFileAsync(file);
92+
}
93+
7894
public void OpenNewTab()
7995
{
8096
instanceTabsView.AddNewTab(typeof(ModernShellPage), "New tab");
@@ -1132,16 +1148,11 @@ public async void ToggleQuickLook()
11321148
{
11331149
try
11341150
{
1135-
string selectedItemPath = null;
11361151
int selectedItemCount;
11371152
Type sourcePageType = App.CurrentInstance.CurrentPageType;
11381153
selectedItemCount = (CurrentInstance.ContentPage as BaseLayout).SelectedItems.Count;
1139-
if (selectedItemCount == 1)
1140-
{
1141-
selectedItemPath = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0].ItemPath;
1142-
}
11431154

1144-
if (selectedItemCount == 1)
1155+
if (selectedItemCount == 1 && !App.CurrentInstance.ContentPage.isRenamingItem)
11451156
{
11461157
var clickedOnItem = (CurrentInstance.ContentPage as BaseLayout).SelectedItems[0];
11471158

Files/MultilingualResources/Files.de-DE.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,10 @@
631631
<source>Replace existing item</source>
632632
<target state="new">Replace existing item</target>
633633
</trans-unit>
634+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
635+
<source>Set as lockscreen background</source>
636+
<target state="new">Set as lockscreen background</target>
637+
</trans-unit>
634638
</group>
635639
</body>
636640
</file>

Files/MultilingualResources/Files.es-ES.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,10 @@
630630
<source>Replace existing item</source>
631631
<target state="translated">Reemplazar elemento existente</target>
632632
</trans-unit>
633+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
634+
<source>Set as lockscreen background</source>
635+
<target state="translated">Establecer como fondo de pantalla de bloqueo</target>
636+
</trans-unit>
633637
</group>
634638
</body>
635639
</file>

Files/MultilingualResources/Files.fr-FR.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@
632632
<source>Replace existing item</source>
633633
<target state="new">Replace existing item</target>
634634
</trans-unit>
635+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
636+
<source>Set as lockscreen background</source>
637+
<target state="new">Set as lockscreen background</target>
638+
</trans-unit>
635639
</group>
636640
</body>
637641
</file>

Files/MultilingualResources/Files.it-IT.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,10 @@
631631
<source>Replace existing item</source>
632632
<target state="new">Replace existing item</target>
633633
</trans-unit>
634+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
635+
<source>Set as lockscreen background</source>
636+
<target state="new">Set as lockscreen background</target>
637+
</trans-unit>
634638
</group>
635639
</body>
636640
</file>

Files/MultilingualResources/Files.nl-NL.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@
632632
<source>Replace existing item</source>
633633
<target state="new">Replace existing item</target>
634634
</trans-unit>
635+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
636+
<source>Set as lockscreen background</source>
637+
<target state="new">Set as lockscreen background</target>
638+
</trans-unit>
635639
</group>
636640
</body>
637641
</file>

Files/MultilingualResources/Files.pl-PL.xlf

+4
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@
632632
<source>Replace existing item</source>
633633
<target state="new">Replace existing item</target>
634634
</trans-unit>
635+
<trans-unit id="BaseLayoutItemContextFlyoutSetAsLockscreenBackground.Text" translate="yes" xml:space="preserve">
636+
<source>Set as lockscreen background</source>
637+
<target state="new">Set as lockscreen background</target>
638+
</trans-unit>
635639
</group>
636640
</body>
637641
</file>

0 commit comments

Comments
 (0)