Skip to content

Commit 513bf26

Browse files
authored
Merge branch 'master' into sort
2 parents 4f89a22 + 06d3de2 commit 513bf26

40 files changed

+4199
-174
lines changed

Files.Launcher/Files.Launcher.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<Version>4.7.0</Version>
134134
</PackageReference>
135135
<PackageReference Include="Vanara.Windows.Shell">
136-
<Version>3.2.11</Version>
136+
<Version>3.2.12</Version>
137137
</PackageReference>
138138
</ItemGroup>
139139
<ItemGroup>

Files.Launcher/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ await Win32API.StartSTATask(() =>
422422
menu = sf.GetChildrenUIObjects<Shell32.IContextMenu>(null, files.ToArray());
423423
menu.QueryContextMenu(HMENU.NULL, 0, 0, 0, Shell32.CMF.CMF_DEFAULTONLY);
424424
var pici = new Shell32.CMINVOKECOMMANDINFOEX();
425-
pici.lpVerb = Shell32.CMDSTR_OPEN;
425+
pici.lpVerb = new SafeResourceId(Shell32.CMDSTR_OPEN, CharSet.Ansi);
426426
pici.nShow = ShowWindowCommand.SW_SHOW;
427427
pici.cbSize = (uint)Marshal.SizeOf(pici);
428428
menu.InvokeCommand(pici);
7.06 KB
Binary file not shown.

Files/CommandLine/CommandLineParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static List<KeyValuePair<string, string>> Parse(string[] args = null)
114114
}
115115

116116
if (parsedArgs.Count == 0 && args.Length >= 2)
117-
parsedArgs.Add(new KeyValuePair<string, string>("-Cmdless", string.Join(" ", args.Skip(1))));
117+
parsedArgs.Add(new KeyValuePair<string, string>("-Cmdless", string.Join(" ", args.Skip(1)).TrimStart()));
118118

119119
return parsedArgs;
120120
}

Files/Enums/WallpaperType.cs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Files.Enums
2+
{
3+
public enum WallpaperType
4+
{
5+
Desktop,
6+
LockScreen
7+
}
8+
}

Files/Files.csproj

+12
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,12 @@
222222
<Compile Include="Enums\SidebarOpacity.cs" />
223223
<Compile Include="Enums\SortOption.cs" />
224224
<Compile Include="Enums\TimeStyle.cs" />
225+
<Compile Include="Enums\WallpaperType.cs" />
225226
<Compile Include="Filesystem\DriveItem.cs" />
226227
<Compile Include="Filesystem\Drives.cs" />
228+
<Compile Include="UserControls\SpecificPageOnStartup.xaml.cs">
229+
<DependentUpon>SpecificPageOnStartup.xaml</DependentUpon>
230+
</Compile>
227231
<Compile Include="UserControls\StatusBarControl.xaml.cs">
228232
<DependentUpon>StatusBarControl.xaml</DependentUpon>
229233
</Compile>
@@ -386,6 +390,8 @@
386390
<Content Include="Assets\WSL\ubuntu.svg" />
387391
<Content Include="Assets\WSL\ubuntupng.png" />
388392
<Content Include="Properties\Default.rd.xml" />
393+
<PRIResource Include="Strings\or-IN\Resources.resw" />
394+
<PRIResource Include="Strings\hi-IN\Resources.resw" />
389395
<PRIResource Include="Strings\pt-BR\Resources.resw" />
390396
<PRIResource Include="Strings\he-IL\Resources.resw" />
391397
<PRIResource Include="Strings\ja-JP\Resources.resw" />
@@ -451,6 +457,10 @@
451457
<SubType>Designer</SubType>
452458
<Generator>MSBuild:Compile</Generator>
453459
</Page>
460+
<Page Include="UserControls\SpecificPageOnStartup.xaml">
461+
<SubType>Designer</SubType>
462+
<Generator>MSBuild:Compile</Generator>
463+
</Page>
454464
<Page Include="UserControls\Widgets\LibraryCards.xaml">
455465
<Generator>MSBuild:Compile</Generator>
456466
<SubType>Designer</SubType>
@@ -591,9 +601,11 @@
591601
<XliffResource Include="MultilingualResources\Files.es-ES.xlf" />
592602
<XliffResource Include="MultilingualResources\Files.fr-FR.xlf" />
593603
<XliffResource Include="MultilingualResources\Files.he-IL.xlf" />
604+
<XliffResource Include="MultilingualResources\Files.hi-IN.xlf" />
594605
<XliffResource Include="MultilingualResources\Files.it-IT.xlf" />
595606
<XliffResource Include="MultilingualResources\Files.ja-JP.xlf" />
596607
<XliffResource Include="MultilingualResources\Files.nl-NL.xlf" />
608+
<XliffResource Include="MultilingualResources\Files.or-IN.xlf" />
597609
<XliffResource Include="MultilingualResources\Files.pl-PL.xlf" />
598610
<XliffResource Include="MultilingualResources\Files.pt-BR.xlf" />
599611
<XliffResource Include="MultilingualResources\Files.ru-RU.xlf" />

Files/Filesystem/DriveItem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void SetGlyph(DriveType type)
8686
break;
8787

8888
case DriveType.CDRom:
89-
Glyph = "\uE958";
89+
Glyph = "\uec39";
9090
break;
9191

9292
case DriveType.Unknown:

Files/Interacts/Interaction.cs

+41-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Files.Dialogs;
2+
using Files.Enums;
23
using Files.Filesystem;
34
using Files.Helpers;
45
using Files.UserControls;
@@ -65,37 +66,44 @@ public void List_ItemClick(object sender, DoubleTappedRoutedEventArgs e)
6566
OpenSelectedItems(false);
6667
}
6768

68-
public async void SetAsDesktopBackgroundItem_Click(object sender, RoutedEventArgs e)
69+
public void SetAsDesktopBackgroundItem_Click(object sender, RoutedEventArgs e)
6970
{
70-
// Get the path of the selected file
71-
StorageFile sourceFile = await ItemViewModel.GetFileFromPathAsync(CurrentInstance.ContentPage.SelectedItem.ItemPath);
72-
73-
// Get the app's local folder to use as the destination folder.
74-
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
75-
76-
// Copy the file to the destination folder.
77-
// Replace the existing file if the file already exists.
78-
StorageFile file = await sourceFile.CopyAsync(localFolder, "Background.png", NameCollisionOption.ReplaceExisting);
71+
SetAsBackground(WallpaperType.Desktop);
72+
}
7973

80-
// Set the desktop background
81-
UserProfilePersonalizationSettings profileSettings = UserProfilePersonalizationSettings.Current;
82-
await profileSettings.TrySetWallpaperImageAsync(file);
74+
public void SetAsLockscreenBackgroundItem_Click(object sender, RoutedEventArgs e)
75+
{
76+
SetAsBackground(WallpaperType.LockScreen);
8377
}
8478

85-
public async void SetAsLockscreenBackgroundItem_Click(object sender, RoutedEventArgs e)
79+
public async void SetAsBackground(WallpaperType type)
8680
{
87-
// Get the path of the selected file
88-
StorageFile sourceFile = await ItemViewModel.GetFileFromPathAsync(CurrentInstance.ContentPage.SelectedItem.ItemPath);
81+
if (UserProfilePersonalizationSettings.IsSupported())
82+
{
83+
// Get the path of the selected file
84+
StorageFile sourceFile = await ItemViewModel.GetFileFromPathAsync(CurrentInstance.ContentPage.SelectedItem.ItemPath);
8985

90-
// Get the app's local folder to use as the destination folder.
91-
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
86+
// Get the app's local folder to use as the destination folder.
87+
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
9288

93-
// Copy the file to the destination folder.
94-
// Replace the existing file if the file already exists.
95-
StorageFile file = await sourceFile.CopyAsync(localFolder, "Background.png", NameCollisionOption.ReplaceExisting);
89+
// Copy the file to the destination folder.
90+
// Generate unique name if the file already exists.
91+
// If the file you are trying to set as the wallpaper has the same name as the current wallpaper,
92+
// the system will ignore the request and no-op the operation
93+
StorageFile file = await sourceFile.CopyAsync(localFolder, sourceFile.Name, NameCollisionOption.GenerateUniqueName);
9694

97-
// Set the lockscreen background
98-
await LockScreen.SetImageFileAsync(file);
95+
UserProfilePersonalizationSettings profileSettings = UserProfilePersonalizationSettings.Current;
96+
if (type == WallpaperType.Desktop)
97+
{
98+
// Set the desktop background
99+
await profileSettings.TrySetWallpaperImageAsync(file);
100+
}
101+
else if (type == WallpaperType.LockScreen)
102+
{
103+
// Set the lockscreen background
104+
await profileSettings.TrySetLockScreenImageAsync(file);
105+
}
106+
}
99107
}
100108

101109
public void OpenNewTab()
@@ -186,8 +194,13 @@ public static async Task InvokeWin32Components(List<string> applicationPaths, st
186194
Debug.WriteLine("Launching EXE in FullTrustProcess");
187195
if (App.Connection != null)
188196
{
189-
var value = new ValueSet();
190-
value.Add("Application", applicationPaths.FirstOrDefault());
197+
var value = new ValueSet
198+
{
199+
{ "WorkingDirectory", App.CurrentInstance.FilesystemViewModel.WorkingDirectory },
200+
{ "Application", applicationPaths.FirstOrDefault() },
201+
{ "ApplicationList", JsonConvert.SerializeObject(applicationPaths) },
202+
};
203+
191204
if (runAsAdmin)
192205
{
193206
value.Add("Arguments", "runas");
@@ -196,7 +209,7 @@ public static async Task InvokeWin32Components(List<string> applicationPaths, st
196209
{
197210
value.Add("Arguments", arguments);
198211
}
199-
value.Add("ApplicationList", JsonConvert.SerializeObject(applicationPaths));
212+
200213
await App.Connection.SendMessageAsync(value);
201214
}
202215
}
@@ -894,7 +907,7 @@ public async Task<StorageFolder> MoveDirectoryAsync(StorageFolder SourceFolder,
894907
}
895908

896909
App.JumpList.RemoveFolder(SourceFolder.Path);
897-
910+
898911
return createdRoot;
899912
}
900913

@@ -1354,7 +1367,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
13541367
}
13551368
}
13561369
}));
1357-
1370+
13581371
await CloneDirectoryAsync(destFolder_InBuffer, destinationFolder, destFolder_InBuffer.Name, true)
13591372
.ContinueWith(async (x) =>
13601373
{

Files/MultilingualResources/Files.de-DE.xlf

+17-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
<target state="translated">Eine neue Registerkarte öffnen</target>
148148
</trans-unit>
149149
<trans-unit id="SettingsOnStartupOpenASpecificPage.Content" translate="yes" xml:space="preserve">
150-
<source>Open a specific page</source>
150+
<source>Open a specific page or pages</source>
151151
<target state="needs-review-translation">Bestimmte Seite oder Seiten öffnen</target>
152152
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
153153
</trans-unit>
@@ -977,6 +977,22 @@
977977
<source>Status</source>
978978
<target state="new">Status</target>
979979
</trans-unit>
980+
<trans-unit id="SettingsOnStartupOpenAddPageButton.Content" translate="yes" xml:space="preserve">
981+
<source>Add a new page</source>
982+
<target state="new">Add a new page</target>
983+
</trans-unit>
984+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlChangePage.Text" translate="yes" xml:space="preserve">
985+
<source>Change Page Location</source>
986+
<target state="new">Change Page Location</target>
987+
</trans-unit>
988+
<trans-unit id="SettingsOnStartupPages.Text" translate="yes" xml:space="preserve">
989+
<source>Pages:</source>
990+
<target state="new">Pages:</target>
991+
</trans-unit>
992+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlRemovePage.Text" translate="yes" xml:space="preserve">
993+
<source>Remove Page</source>
994+
<target state="new">Remove Page</target>
995+
</trans-unit>
980996
</group>
981997
</body>
982998
</file>

Files/MultilingualResources/Files.es-ES.xlf

+24-7
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@
147147
<target state="translated">Abrir una nueva ventana</target>
148148
</trans-unit>
149149
<trans-unit id="SettingsOnStartupOpenASpecificPage.Content" translate="yes" xml:space="preserve">
150-
<source>Open a specific page</source>
151-
<target state="translated">Abrir en una página específica</target>
150+
<source>Open a specific page or pages</source>
151+
<target state="needs-review-translation">Abrir en una página específica</target>
152+
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
152153
</trans-unit>
153154
<trans-unit id="SettingsOnStartupTitle.Text" translate="yes" xml:space="preserve">
154155
<source>On Startup</source>
@@ -192,7 +193,7 @@
192193
</trans-unit>
193194
<trans-unit id="SettingsPreferencesShowConfirmDeleteDialog.Text" translate="yes" xml:space="preserve">
194195
<source>Show a confirmation dialog when deleting files or folders</source>
195-
<target state="translated">Mostrar un diálogo de confirmación al eliminar elementos</target>
196+
<target state="translated">Mostrar cuadro de diálogo para confirmar eliminación</target>
196197
</trans-unit>
197198
<trans-unit id="SidebarDesktop" translate="yes" xml:space="preserve">
198199
<source>Desktop</source>
@@ -956,19 +957,35 @@
956957
</trans-unit>
957958
<trans-unit id="JumpListRecentGroupHeader" translate="yes" xml:space="preserve">
958959
<source>Recent</source>
959-
<target state="new">Recent</target>
960+
<target state="translated">Recientes</target>
960961
</trans-unit>
961962
<trans-unit id="SettingsPreferencesAppLanguage.Text" translate="yes" xml:space="preserve">
962963
<source>App Language</source>
963-
<target state="new">App Language</target>
964+
<target state="translated">Idioma</target>
964965
</trans-unit>
965966
<trans-unit id="SettingsPreferencesAppLanguageRestartRequired.Text" translate="yes" xml:space="preserve">
966967
<source>Restart required</source>
967-
<target state="new">Restart required</target>
968+
<target state="translated">Los cambios se aplicarán la próxima vez que inicies la aplicación</target>
968969
</trans-unit>
969970
<trans-unit id="syncStatusColumn.Header" translate="yes" xml:space="preserve">
970971
<source>Status</source>
971-
<target state="new">Status</target>
972+
<target state="translated">Estado</target>
973+
</trans-unit>
974+
<trans-unit id="SettingsOnStartupOpenAddPageButton.Content" translate="yes" xml:space="preserve">
975+
<source>Add a new page</source>
976+
<target state="new">Add a new page</target>
977+
</trans-unit>
978+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlChangePage.Text" translate="yes" xml:space="preserve">
979+
<source>Change Page Location</source>
980+
<target state="new">Change Page Location</target>
981+
</trans-unit>
982+
<trans-unit id="SettingsOnStartupPages.Text" translate="yes" xml:space="preserve">
983+
<source>Pages:</source>
984+
<target state="new">Pages:</target>
985+
</trans-unit>
986+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlRemovePage.Text" translate="yes" xml:space="preserve">
987+
<source>Remove Page</source>
988+
<target state="new">Remove Page</target>
972989
</trans-unit>
973990
</group>
974991
</body>

Files/MultilingualResources/Files.fr-FR.xlf

+17-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
<target state="translated">Nouvel onglet</target>
150150
</trans-unit>
151151
<trans-unit id="SettingsOnStartupOpenASpecificPage.Content" translate="yes" xml:space="preserve">
152-
<source>Open a specific page</source>
152+
<source>Open a specific page or pages</source>
153153
<target state="needs-review-translation">Ouvrir un ensemble de pages</target>
154154
<note from="MultilingualUpdate" annotates="source" priority="2">Please verify the translation’s accuracy as the source string was updated after it was translated.</note>
155155
</trans-unit>
@@ -973,6 +973,22 @@
973973
<source>Status</source>
974974
<target state="new">Status</target>
975975
</trans-unit>
976+
<trans-unit id="SettingsOnStartupOpenAddPageButton.Content" translate="yes" xml:space="preserve">
977+
<source>Add a new page</source>
978+
<target state="new">Add a new page</target>
979+
</trans-unit>
980+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlChangePage.Text" translate="yes" xml:space="preserve">
981+
<source>Change Page Location</source>
982+
<target state="new">Change Page Location</target>
983+
</trans-unit>
984+
<trans-unit id="SettingsOnStartupPages.Text" translate="yes" xml:space="preserve">
985+
<source>Pages:</source>
986+
<target state="new">Pages:</target>
987+
</trans-unit>
988+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlRemovePage.Text" translate="yes" xml:space="preserve">
989+
<source>Remove Page</source>
990+
<target state="new">Remove Page</target>
991+
</trans-unit>
976992
</group>
977993
</body>
978994
</file>

Files/MultilingualResources/Files.he-IL.xlf

+18-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@
319319
<target state="translated" state-qualifier="tm-suggestion">פתח כרטיסיה חדשה</target>
320320
</trans-unit>
321321
<trans-unit id="SettingsOnStartupOpenASpecificPage.Content" translate="yes" xml:space="preserve">
322-
<source>Open a specific page</source>
323-
<target state="new">Open a specific page</target>
322+
<source>Open a specific page or pages</source>
323+
<target state="new">Open a specific page or pages</target>
324324
</trans-unit>
325325
<trans-unit id="SettingsOnStartupTitle.Text" translate="yes" xml:space="preserve">
326326
<source>On Startup</source>
@@ -970,6 +970,22 @@
970970
<source>Status</source>
971971
<target state="new">Status</target>
972972
</trans-unit>
973+
<trans-unit id="SettingsOnStartupOpenAddPageButton.Content" translate="yes" xml:space="preserve">
974+
<source>Add a new page</source>
975+
<target state="new">Add a new page</target>
976+
</trans-unit>
977+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlChangePage.Text" translate="yes" xml:space="preserve">
978+
<source>Change Page Location</source>
979+
<target state="new">Change Page Location</target>
980+
</trans-unit>
981+
<trans-unit id="SettingsOnStartupPages.Text" translate="yes" xml:space="preserve">
982+
<source>Pages:</source>
983+
<target state="new">Pages:</target>
984+
</trans-unit>
985+
<trans-unit id="SettingsOnStartupOpenSpecificPagesUserControlRemovePage.Text" translate="yes" xml:space="preserve">
986+
<source>Remove Page</source>
987+
<target state="new">Remove Page</target>
988+
</trans-unit>
973989
</group>
974990
</body>
975991
</file>

0 commit comments

Comments
 (0)