Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions builds/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
script: |
[xml]$xmlDoc = Get-Content $(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest
$xmlDoc.Package.Identity.Name="Files"
$xmlDoc.Package.Identity.Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7"
$xmlDoc.Package.Properties.DisplayName="Files"
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files"
$xmlDoc.Save('$(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest')
Expand Down Expand Up @@ -110,6 +111,7 @@ jobs:
script: |
[xml]$xmlDoc = Get-Content $(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP"
$xmlDoc.Package.Identity.Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7"
$xmlDoc.Package.Properties.DisplayName="Files"
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files"
$xmlDoc.Save('$(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest')
Expand Down
1 change: 1 addition & 0 deletions builds/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
script: |
[xml]$xmlDoc = Get-Content $(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP"
$xmlDoc.Package.Identity.Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7"
$xmlDoc.Package.Properties.DisplayName="Files"
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files"
$xmlDoc.Save('$(Build.SourcesDirectory)\src\Files.Package\Package.appxmanifest')
Expand Down
2 changes: 2 additions & 0 deletions src/Common/CloudProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public enum CloudProviders
DropBox,
AppleCloud,
AmazonDrive,
Nextcloud,
Yandex,
Box
}
}
Binary file modified src/Files.Launcher/Assets/FilesOpenDialog/SetFilesAsDefault.reg
Binary file not shown.
Binary file not shown.
24 changes: 22 additions & 2 deletions src/Files.Launcher/Helpers/CloudDrivesDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,32 @@ public static async Task<List<CloudProvider>> DetectCloudDrives()
{
Extensions.IgnoreExceptions(DetectOneDrive, Program.Logger),
Extensions.IgnoreExceptions(DetectSharepoint, Program.Logger),
Extensions.IgnoreExceptions(DetectGenericCloudDrive, Program.Logger)
Extensions.IgnoreExceptions(DetectGenericCloudDrive, Program.Logger),
Extensions.IgnoreExceptions(DetectYandexDisk, Program.Logger),
};

await Task.WhenAll(tasks);

return tasks.Where(o => o.Result != null).SelectMany(o => o.Result).OrderBy(o => o.ID.ToString()).ThenBy(o => o.Name).Distinct().ToList();
}

private static Task<List<CloudProvider>> DetectYandexDisk()
{
var results = new List<CloudProvider>();
using var yandexKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Yandex\Yandex.Disk.2");
var syncedFolder = (string)yandexKey?.GetValue("RootFolder");
if (syncedFolder != null)
{
results.Add(new CloudProvider()
{
ID = CloudProviders.Yandex,
Name = $"Yandex Disk",
SyncFolder = syncedFolder
});
}
return Task.FromResult(results);
}

private static Task<List<CloudProvider>> DetectGenericCloudDrive()
{
var results = new List<CloudProvider>();
Expand All @@ -47,11 +65,12 @@ private static Task<List<CloudProvider>> DetectGenericCloudDrive()
continue;
}

// Also works for OneDrive, Box, Amazon Drive, iCloudDrive, Dropbox
// Also works for OneDrive, Box, iCloudDrive, Dropbox
CloudProviders? driveID = driveType switch
{
"MEGA" => CloudProviders.Mega,
"Amazon Drive" => CloudProviders.AmazonDrive,
"Nextcloud" => CloudProviders.Nextcloud,
_ => null
};
if (driveID == null)
Expand All @@ -66,6 +85,7 @@ private static Task<List<CloudProvider>> DetectGenericCloudDrive()
{
CloudProviders.Mega => $"MEGA ({Path.GetFileName(syncedFolder.TrimEnd('\\'))})",
CloudProviders.AmazonDrive => $"Amazon Drive",
CloudProviders.Nextcloud => $"Nextcloud",
_ => null
},
SyncFolder = syncedFolder
Expand Down
24 changes: 21 additions & 3 deletions src/Files.Launcher/MessageHandlers/ContextMenuHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -95,14 +96,31 @@ private object HandleMenuMessage(Dictionary<string, object> message, DisposableD
var cMenuExec = table.GetValue<ContextMenu>("MENU");
if (message.TryGetValue("ItemID", out var menuId))
{
switch (message.Get("CommandString", (string)null))
var isFont = new[] { ".fon", ".otf", ".ttc", ".ttf" }.Contains(Path.GetExtension(cMenuExec.ItemsPath[0]), StringComparer.OrdinalIgnoreCase);
var verb = message.Get("CommandString", (string)null);
switch (verb)
{
case "mount":
case string _ when verb == "install" && isFont:
{
var userFontDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft", "Windows", "Fonts");
var destName = Path.Combine(userFontDir, Path.GetFileName(cMenuExec.ItemsPath[0]));
Win32API.RunPowershellCommand($"-command \"Copy-Item '{cMenuExec.ItemsPath[0]}' '{userFontDir}'; New-ItemProperty -Name '{Path.GetFileNameWithoutExtension(cMenuExec.ItemsPath[0])}' -Path 'HKCU:\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' -PropertyType string -Value '{destName}'\"", false);
}
break;

case string _ when verb == "installAllUsers" && isFont:
{
var winFontDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "Fonts");
Win32API.RunPowershellCommand($"-command \"Copy-Item '{cMenuExec.ItemsPath[0]}' '{winFontDir}'; New-ItemProperty -Name '{Path.GetFileNameWithoutExtension(cMenuExec.ItemsPath[0])}' -Path 'HKLM:\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' -PropertyType string -Value '{Path.GetFileName(cMenuExec.ItemsPath[0])}'\"", true);
}
break;

case string _ when verb == "mount":
var vhdPath = cMenuExec.ItemsPath[0];
Win32API.MountVhdDisk(vhdPath);
break;

case "format":
case string _ when verb == "format":
var drivePath = cMenuExec.ItemsPath[0];
Win32API.OpenFormatDriveDialog(drivePath);
break;
Expand Down
5 changes: 3 additions & 2 deletions src/Files.Launcher/MessageHandlers/Win32MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ public void Initialize(PipeStream connection)

private void DetectIsSetAsDefaultFileManager()
{
using var subkey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Classes\Directory\shell");
ApplicationData.Current.LocalSettings.Values["IsSetAsDefaultFileManager"] = subkey?.GetValue(string.Empty) as string == "openinfiles";
using var subkey = Registry.ClassesRoot.OpenSubKey(@"Folder\shell\open\command");
var command = (string)subkey?.GetValue(string.Empty);
ApplicationData.Current.LocalSettings.Values["IsSetAsDefaultFileManager"] = !string.IsNullOrEmpty(command) && command.Contains("files.exe");
}

private void DetectIsSetAsOpenFileDialog()
Expand Down
2 changes: 1 addition & 1 deletion src/Files.Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop">
<Identity Name="FilesDev" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="2.0.42.0" />
<Identity Name="FilesDev" Publisher="CN=Files" Version="2.0.42.0" />
<Properties>
<DisplayName>Files - Dev</DisplayName>
<PublisherDisplayName>Yair A</PublisherDisplayName>
Expand Down
2 changes: 1 addition & 1 deletion src/Files/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public static void SaveSessionTabs() // Enumerates through all tabs and gets the
}
else
{
var defaultArg = new TabItemArguments() { InitialPageType = typeof(PaneHolderPage), NavigationArg = "NewTab".GetLocalized() };
var defaultArg = new TabItemArguments() { InitialPageType = typeof(PaneHolderPage), NavigationArg = "Home".GetLocalized() };
return defaultArg.Serialize();
}
}).ToList();
Expand Down
59 changes: 3 additions & 56 deletions src/Files/Dialogs/SettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,9 @@
<ResourceDictionary>
<x:Double x:Key="ContentDialogMaxWidth">800</x:Double>
<Thickness x:Key="ContentDialogPadding">0</Thickness>
<Thickness x:Key="NavigationViewTopPaneHeight">40</Thickness>
<Thickness x:Key="TopNavigationViewTopNavGridMargin">10</Thickness>
<Thickness x:Key="TopNavigationViewTopNavGridMargin">4</Thickness>
<SolidColorBrush x:Key="ContentDialogTopOverlay" Color="Transparent" />
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewItemBackground" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelected" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrush" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelected" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewItemBackground" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelected" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrush" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelected" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewDefaultPaneBackground" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewItemBackground" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelected" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPointerOver" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="TopNavigationViewItemBackgroundSelectedPressed" Color="{ThemeResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrush" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelected" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPointerOver" Color="{ThemeResource ControlStrokeColorDefault}" />
<SolidColorBrush x:Key="NavigationViewItemBorderBrushSelectedPressed" Color="{ThemeResource ControlStrokeColorDefault}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
</ResourceDictionary>
</ContentDialog.Resources>

Expand Down Expand Up @@ -150,10 +100,7 @@
VerticalAlignment="Stretch"
VerticalScrollBarVisibility="Visible"
VerticalScrollMode="Enabled">
<Frame
x:Name="SettingsContentFrame"
Padding="12"
Background="{ThemeResource SolidBackgroundFillColorTertiary}" />
<Frame x:Name="SettingsContentFrame" Padding="12,4,12,12" />
</ScrollViewer>
</muxc:NavigationView>

Expand Down
3 changes: 2 additions & 1 deletion src/Files/Files.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<Compile Include="Helpers\ItemListDisplayHelpers\GroupedCollection.cs" />
<Compile Include="Helpers\ItemListDisplayHelpers\GroupingHelper.cs" />
<Compile Include="Helpers\StorageItemIconHelpers.cs" />
<Compile Include="Helpers\StorageSenseHelper.cs" />
<Compile Include="Helpers\UniversalLogWriter.cs" />
<Compile Include="Helpers\SaveImageToFile.cs" />
<Compile Include="Filesystem\FolderHelpers.cs" />
Expand Down Expand Up @@ -1548,4 +1549,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/Files/Helpers/CommonPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public static class CommonPaths

public static Dictionary<string, string> ShellPlaces = new Dictionary<string, string>() {
{ "::{645FF040-5081-101B-9F08-00AA002F954E}", RecycleBinPath },
{ "::{5E5F29CE-E0A8-49D3-AF32-7A7BDC173478}", "NewTab".GetLocalized() /*MyComputerPath*/ },
{ "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "NewTab".GetLocalized() /*MyComputerPath*/ },
{ "::{5E5F29CE-E0A8-49D3-AF32-7A7BDC173478}", "Home".GetLocalized() /*MyComputerPath*/ },
{ "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "Home".GetLocalized() /*MyComputerPath*/ },
{ "::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}", NetworkFolderPath },
{ "::{208D2C60-3AEA-1069-A2D7-08002B30309D}", NetworkFolderPath },
{ RecycleBinPath.ToUpperInvariant(), RecycleBinPath },
{ MyComputerPath.ToUpperInvariant(), "NewTab".GetLocalized() /*MyComputerPath*/ },
{ MyComputerPath.ToUpperInvariant(), "Home".GetLocalized() /*MyComputerPath*/ },
{ NetworkFolderPath.ToUpperInvariant(), NetworkFolderPath },
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Files/Helpers/MultitaskingTabsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static async Task MoveTabToNewWindow(TabItem tab, IMultitaskingControl mu
}
else
{
await NavigationHelpers.OpenPathInNewWindowAsync("NewTab".GetLocalized());
await NavigationHelpers.OpenPathInNewWindowAsync("Home".GetLocalized());
}
}

Expand Down
33 changes: 33 additions & 0 deletions src/Files/Helpers/StorageSenseHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Foundation.Collections;
using Windows.Foundation.Metadata;
using Windows.System;

namespace Files.Helpers
{
internal class StorageSenseHelper
{
public static async void OpenStorageSense(string Path)
{
var connection = await AppServiceConnectionHelper.Instance;
if (connection != null
&& !Path.StartsWith("C:", StringComparison.OrdinalIgnoreCase)
&& ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
await connection.SendMessageAsync(new ValueSet()
{
{ "Arguments", "LaunchSettings" },
{ "page", "page=SettingsPageStorageSenseStorageOverview&target=SystemSettings_StorageSense_VolumeListLink" }
});
}
else
{
await Launcher.LaunchUriAsync(new Uri("ms-settings:storagesense"));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Files/MultilingualResources/Files.af.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@
<source>Security</source>
<target state="translated">Sekuriteit</target>
</trans-unit>
<trans-unit id="SecurityAdvancedPermissions.Text" translate="yes" xml:space="preserve">
<trans-unit id="AdvancedPermissions" translate="yes" xml:space="preserve">
<source>Advanced permissions</source>
<target state="translated">Gevorderde toestemmings</target>
</trans-unit>
Expand Down
Loading