Skip to content

Commit

Permalink
Added a new reusable FileSelector control allowing tools to get one o…
Browse files Browse the repository at this point in the history
…r many files as input. (#308)

* Added a new reusable FileSelector control allowing tools to get one or many files as input.

* Fixed typo

* Fixed a bug where PickSingleFolderAsync would crash on some machines

* updated language manager
  • Loading branch information
veler committed Jan 30, 2022
1 parent aa055ff commit dc6b289
Show file tree
Hide file tree
Showing 89 changed files with 3,791 additions and 1,548 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Here is the list of tool name you can use:
- `hash` - Hash Generator
- `uuid` - UUID Generator
- `loremipsum` - Lorem Ipsum Generator
- `checksum` - CheckSum File
- `checksum` - Checksum File
- `jsonformat` Json Formatter
- `sqlformat` - SQL Formatter
- `jsonyaml` - Json <> Yaml
Expand Down
7 changes: 7 additions & 0 deletions src/dev/impl/DevToys/DevToys.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<Compile Include="Models\Radix.cs" />
<Compile Include="Models\NumberBaseFormat.cs" />
<Compile Include="Models\TileIconSizeDefinition.cs" />
<Compile Include="UI\Controls\FileSelector.xaml.cs">
<DependentUpon>FileSelector.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Controls\ToolProvidersGridView.xaml.cs">
<DependentUpon>ToolProvidersGridView.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -533,6 +536,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Controls\FileSelector.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI\Controls\ToolProvidersGridView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
154 changes: 64 additions & 90 deletions src/dev/impl/DevToys/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,36 +393,11 @@ public class CheckSumGeneratorStrings : ObservableObject
/// </summary>
public string OutputComparer => _resources.GetString("OutputComparer");

/// <summary>
/// Gets the resource SaveAs.
/// </summary>
public string SaveAs => _resources.GetString("SaveAs");

/// <summary>
/// Gets the resource SearchDisplayName.
/// </summary>
public string SearchDisplayName => _resources.GetString("SearchDisplayName");

/// <summary>
/// Gets the resource SelectFilesInstruction1.
/// </summary>
public string SelectFilesInstruction1 => _resources.GetString("SelectFilesInstruction1");

/// <summary>
/// Gets the resource SelectFilesInstruction2.
/// </summary>
public string SelectFilesInstruction2 => _resources.GetString("SelectFilesInstruction2");

/// <summary>
/// Gets the resource SelectFilesInstruction3.
/// </summary>
public string SelectFilesInstruction3 => _resources.GetString("SelectFilesInstruction3");

/// <summary>
/// Gets the resource SelectFilesInstruction4.
/// </summary>
public string SelectFilesInstruction4 => _resources.GetString("SelectFilesInstruction4");

/// <summary>
/// Gets the resource Uppercase.
/// </summary>
Expand Down Expand Up @@ -453,26 +428,6 @@ public class ColorBlindnessSimulatorStrings : ObservableObject
/// </summary>
public string SearchDisplayName => _resources.GetString("SearchDisplayName");

/// <summary>
/// Gets the resource InvalidSelectedFiles.
/// </summary>
public string InvalidSelectedFiles => _resources.GetString("InvalidSelectedFiles");

/// <summary>
/// Gets the resource SelectFilesInstruction1.
/// </summary>
public string SelectFilesInstruction1 => _resources.GetString("SelectFilesInstruction1");

/// <summary>
/// Gets the resource SelectFilesInstruction2.
/// </summary>
public string SelectFilesInstruction2 => _resources.GetString("SelectFilesInstruction2");

/// <summary>
/// Gets the resource SelectFilesInstruction3.
/// </summary>
public string SelectFilesInstruction3 => _resources.GetString("SelectFilesInstruction3");

/// <summary>
/// Gets the resource SaveAs.
/// </summary>
Expand Down Expand Up @@ -502,11 +457,6 @@ public class ColorBlindnessSimulatorStrings : ObservableObject
/// Gets the resource TritanopiaSimulation.
/// </summary>
public string TritanopiaSimulation => _resources.GetString("TritanopiaSimulation");

/// <summary>
/// Gets the resource SelectFilesInstruction4.
/// </summary>
public string SelectFilesInstruction4 => _resources.GetString("SelectFilesInstruction4");
}

public class CommonStrings : ObservableObject
Expand Down Expand Up @@ -538,6 +488,70 @@ public class CommonStrings : ObservableObject
/// </summary>
public string Delete => _resources.GetString("Delete");

/// <summary>
/// Gets the resource FileSelectorBrowseFiles.
/// </summary>
public string FileSelectorBrowseFiles => _resources.GetString("FileSelectorBrowseFiles");

/// <summary>
/// Gets the resource FileSelectorBrowseFolders.
/// </summary>
public string FileSelectorBrowseFolders => _resources.GetString("FileSelectorBrowseFolders");

/// <summary>
/// Gets the resource FileSelectorDragDropAnyFile.
/// </summary>
public string FileSelectorDragDropAnyFile => _resources.GetString("FileSelectorDragDropAnyFile");

/// <summary>
/// Gets the resource FileSelectorDragDropAnyFiles.
/// </summary>
public string FileSelectorDragDropAnyFiles => _resources.GetString("FileSelectorDragDropAnyFiles");

/// <summary>
/// Gets the resource FileSelectorDragDropAnySpecificFile.
/// </summary>
public string FileSelectorDragDropAnySpecificFile => _resources.GetString("FileSelectorDragDropAnySpecificFile");

/// <summary>
/// Gets the resource FileSelectorDragDropAnySpecificFile with format.
/// </summary>
public string GetFormattedFileSelectorDragDropAnySpecificFile(string? param0)
{
return string.Format(FileSelectorDragDropAnySpecificFile, param0);
}

/// <summary>
/// Gets the resource FileSelectorDragDropAnySpecificFiles.
/// </summary>
public string FileSelectorDragDropAnySpecificFiles => _resources.GetString("FileSelectorDragDropAnySpecificFiles");

/// <summary>
/// Gets the resource FileSelectorDragDropAnySpecificFiles with format.
/// </summary>
public string GetFormattedFileSelectorDragDropAnySpecificFiles(string? param0)
{
return string.Format(FileSelectorDragDropAnySpecificFiles, param0);
}

/// <summary>
/// Gets the resource FileSelectorInvalidSelectedFiles.
/// </summary>
public string FileSelectorInvalidSelectedFiles => _resources.GetString("FileSelectorInvalidSelectedFiles");

/// <summary>
/// Gets the resource FileSelectorInvalidSelectedFiles with format.
/// </summary>
public string GetFormattedFileSelectorInvalidSelectedFiles(string? param0)
{
return string.Format(FileSelectorInvalidSelectedFiles, param0);
}

/// <summary>
/// Gets the resource FileSelectorOr.
/// </summary>
public string FileSelectorOr => _resources.GetString("FileSelectorOr");

/// <summary>
/// Gets the resource Gigabytes.
/// </summary>
Expand Down Expand Up @@ -971,11 +985,6 @@ public class ImageConverterStrings : ObservableObject
/// </summary>
public string FileSizeDisplay => _resources.GetString("FileSizeDisplay");

/// <summary>
/// Gets the resource InvalidSelectedFiles.
/// </summary>
public string InvalidSelectedFiles => _resources.GetString("InvalidSelectedFiles");

/// <summary>
/// Gets the resource OK.
/// </summary>
Expand All @@ -996,21 +1005,6 @@ public class ImageConverterStrings : ObservableObject
/// </summary>
public string SeeErrorMessage => _resources.GetString("SeeErrorMessage");

/// <summary>
/// Gets the resource SelectFilesInstruction1.
/// </summary>
public string SelectFilesInstruction1 => _resources.GetString("SelectFilesInstruction1");

/// <summary>
/// Gets the resource SelectFilesInstruction2.
/// </summary>
public string SelectFilesInstruction2 => _resources.GetString("SelectFilesInstruction2");

/// <summary>
/// Gets the resource SelectFilesInstruction3.
/// </summary>
public string SelectFilesInstruction3 => _resources.GetString("SelectFilesInstruction3");

/// <summary>
/// Gets the resource Description.
/// </summary>
Expand Down Expand Up @@ -1688,11 +1682,6 @@ public class PngJpgCompressorStrings : ObservableObject
/// </summary>
public string FileSizeDisplay => _resources.GetString("FileSizeDisplay");

/// <summary>
/// Gets the resource InvalidSelectedFiles.
/// </summary>
public string InvalidSelectedFiles => _resources.GetString("InvalidSelectedFiles");

/// <summary>
/// Gets the resource OK.
/// </summary>
Expand All @@ -1713,21 +1702,6 @@ public class PngJpgCompressorStrings : ObservableObject
/// </summary>
public string SeeErrorMessage => _resources.GetString("SeeErrorMessage");

/// <summary>
/// Gets the resource SelectFilesInstruction1.
/// </summary>
public string SelectFilesInstruction1 => _resources.GetString("SelectFilesInstruction1");

/// <summary>
/// Gets the resource SelectFilesInstruction2.
/// </summary>
public string SelectFilesInstruction2 => _resources.GetString("SelectFilesInstruction2");

/// <summary>
/// Gets the resource SelectFilesInstruction3.
/// </summary>
public string SelectFilesInstruction3 => _resources.GetString("SelectFilesInstruction3");

/// <summary>
/// Gets the resource Description.
/// </summary>
Expand Down
14 changes: 1 addition & 13 deletions src/dev/impl/DevToys/Strings/cs-CZ/CheckSumGenerator.resw
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,7 @@
<value>Porovnání s výstupem</value>
</data>
<data name="SearchDisplayName" xml:space="preserve">
<value>Kontrolní součet</value>
</data>
<data name="SelectFilesInstruction1" xml:space="preserve">
<value>Sem přetáhněte soubory</value>
</data>
<data name="SelectFilesInstruction2" xml:space="preserve">
<value>nebo</value>
</data>
<data name="SelectFilesInstruction3" xml:space="preserve">
<value>Procházet soubory</value>
</data>
<data name="SelectFilesInstruction4" xml:space="preserve">
<value>Vložit</value>
<value>Checksum Generator</value>
</data>
<data name="Uppercase" xml:space="preserve">
<value>Velká písmena</value>
Expand Down
15 changes: 0 additions & 15 deletions src/dev/impl/DevToys/Strings/cs-CZ/ColorBlindnessSimulator.resw
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,6 @@
<data name="SearchDisplayName" xml:space="preserve">
<value>Simulátor Barvosleposti</value>
</data>
<data name="InvalidSelectedFiles" xml:space="preserve">
<value>Pouze soubory .png, .jpg, .jpeg nebo .bmp mohou být použity.</value>
</data>
<data name="SelectFilesInstruction1" xml:space="preserve">
<value>Sem přetáhněte soubory PNG, JPEG nebo BMP</value>
</data>
<data name="SelectFilesInstruction2" xml:space="preserve">
<value>nebo</value>
</data>
<data name="SelectFilesInstruction3" xml:space="preserve">
<value>Procházet soubory</value>
</data>
<data name="SaveAs" xml:space="preserve">
<value>Uložit jako</value>
</data>
Expand All @@ -159,7 +147,4 @@
<data name="TritanopiaSimulation" xml:space="preserve">
<value>Simulace Tritanopie</value>
</data>
<data name="SelectFilesInstruction4" xml:space="preserve">
<value>Vložit</value>
</data>
</root>
27 changes: 27 additions & 0 deletions src/dev/impl/DevToys/Strings/cs-CZ/Common.resw
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,33 @@
<data name="Delete" xml:space="preserve">
<value>Odstranit</value>
</data>
<data name="FileSelectorBrowseFiles" xml:space="preserve">
<value>Browse files</value>
</data>
<data name="FileSelectorBrowseFolders" xml:space="preserve">
<value>Browse folders</value>
</data>
<data name="FileSelectorDragDropAnyFile" xml:space="preserve">
<value>Drag &amp; drop any file here</value>
</data>
<data name="FileSelectorDragDropAnyFiles" xml:space="preserve">
<value>Drag &amp; drop any files here</value>
</data>
<data name="FileSelectorDragDropAnySpecificFile" xml:space="preserve">
<value>Drag &amp; drop a {0} file here</value>
<comment>{0} is a single file extension like "PNG"</comment>
</data>
<data name="FileSelectorDragDropAnySpecificFiles" xml:space="preserve">
<value>Drag &amp; drop any {0} files here</value>
<comment>{0} is a list of file extensions like "PNG, TXT, JPG"</comment>
</data>
<data name="FileSelectorInvalidSelectedFiles" xml:space="preserve">
<value>Only {0} file(s) can be used.</value>
<comment>{0} is a list of file extensions like "PNG, TXT, JPG"</comment>
</data>
<data name="FileSelectorOr" xml:space="preserve">
<value>or</value>
</data>
<data name="Gigabytes" xml:space="preserve">
<value>GB</value>
</data>
Expand Down
12 changes: 0 additions & 12 deletions src/dev/impl/DevToys/Strings/cs-CZ/ImageConverter.resw
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@
<value>{0:0.##} {1}</value>
<comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>
</data>
<data name="InvalidSelectedFiles" xml:space="preserve">
<value>Pouze soubory .png, .jpg a .jpeg mohou být použity.</value>
</data>
<data name="OK" xml:space="preserve">
<value>OK</value>
</data>
Expand All @@ -157,15 +154,6 @@
<data name="SeeErrorMessage" xml:space="preserve">
<value>Zobrazit detaily</value>
</data>
<data name="SelectFilesInstruction1" xml:space="preserve">
<value>Sem přetáhněte soubory obrázků</value>
</data>
<data name="SelectFilesInstruction2" xml:space="preserve">
<value>nebo</value>
</data>
<data name="SelectFilesInstruction3" xml:space="preserve">
<value>Procházet soubory</value>
</data>
<data name="Description" xml:space="preserve">
<value>Bezztrátová konverze obrázků</value>
</data>
Expand Down
12 changes: 0 additions & 12 deletions src/dev/impl/DevToys/Strings/cs-CZ/PngJpgCompressor.resw
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@
<value>{0:0.##} {1}</value>
<comment>{0} is a decimal number representing a file size. {1} is a unit, like Bytes, KB, MB, GB, TB</comment>
</data>
<data name="InvalidSelectedFiles" xml:space="preserve">
<value>Jsou podporovány pouze soubory .png, .jpg a .jpeg.</value>
</data>
<data name="OK" xml:space="preserve">
<value>OK</value>
</data>
Expand All @@ -157,15 +154,6 @@
<data name="SeeErrorMessage" xml:space="preserve">
<value>Zobrazit podrobnosti</value>
</data>
<data name="SelectFilesInstruction1" xml:space="preserve">
<value>Sem přetáhněte soubory PNG nebo JPEG</value>
</data>
<data name="SelectFilesInstruction2" xml:space="preserve">
<value>nebo</value>
</data>
<data name="SelectFilesInstruction3" xml:space="preserve">
<value>Procházet soubory</value>
</data>
<data name="Description" xml:space="preserve">
<value>Bezztrátové optimalizování PNG a JPEG</value>
</data>
Expand Down
Loading

0 comments on commit dc6b289

Please sign in to comment.