Skip to content

Commit c91b038

Browse files
committed
Merge branch 'dev'
2 parents 84a0a73 + 5bb3d1d commit c91b038

File tree

65 files changed

+2686
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2686
-568
lines changed

Other/Translator/TranslatorWindow.xaml.cs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ namespace Translator;
2626

2727
public partial class TranslatorWindow : Window
2828
{
29-
private static string TempPath => Path.Combine(".", "ScreenToGif", "Resources");
30-
3129
private readonly List<ResourceDictionary> _resourceList = new();
3230
private IEnumerable<string> _cultures;
3331
private ObservableCollection<Translation> _translationList = new();
32+
private string _tempPath;
3433
private string _resourceTemplate;
3534

3635
public TranslatorWindow()
@@ -42,8 +41,7 @@ public TranslatorWindow()
4241

4342
private async void Window_Loaded(object sender, RoutedEventArgs e)
4443
{
45-
if (!Directory.Exists(TempPath))
46-
Directory.CreateDirectory(TempPath);
44+
PrepareTempPath();
4745

4846
OpenButton.IsEnabled = false;
4947
RefreshButton.IsEnabled = false;
@@ -220,17 +218,18 @@ private async void Load_Executed(object sender, ExecutedRoutedEventArgs e)
220218
CheckFileExists = true,
221219
Title = "Open a Resource Dictionary",
222220
Filter = "Resource Dictionay (*.xaml)|*.xaml;",
223-
InitialDirectory = Path.GetFullPath(TempPath)
221+
InitialDirectory = Path.GetFullPath(_tempPath)
224222
};
225223

226224
var result = ofd.ShowDialog();
227225

228-
if (!result.HasValue || !result.Value) return;
226+
if (!result.HasValue || !result.Value)
227+
return;
229228

230229
//Will save the file to other folder.
231-
var tempFile = Path.Combine(TempPath, "Temp", Path.GetFileName(ofd.FileName));
230+
var tempFile = Path.Combine(_tempPath, "Temp", Path.GetFileName(ofd.FileName));
232231

233-
Directory.CreateDirectory(Path.Combine(TempPath, "Temp"));
232+
Directory.CreateDirectory(Path.Combine(_tempPath, "Temp"));
234233

235234
//Replaces the special chars.
236235
var text = await Task.Factory.StartNew(() => File.ReadAllText(ofd.FileName, Encoding.UTF8).Replace("&#", "&amp;#").Replace("<!--<!--", "<!--").Replace("-->-->", "-->"));
@@ -290,7 +289,8 @@ private async void Export_Executed(object sender, ExecutedRoutedEventArgs e)
290289

291290
var result = sfd.ShowDialog();
292291

293-
if (!result.HasValue || !result.Value) return;
292+
if (!result.HasValue || !result.Value)
293+
return;
294294

295295
BaseDataGrid.IsEnabled = false;
296296
StatusBand.Info("Exporting translation...");
@@ -321,6 +321,14 @@ private void Window_Closing(object sender, CancelEventArgs e)
321321

322322
#region Methods
323323

324+
private void PrepareTempPath()
325+
{
326+
_tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ScreenToGif", "Resources");
327+
328+
if (!Directory.Exists(_tempPath))
329+
Directory.CreateDirectory(_tempPath);
330+
}
331+
324332
private async Task DownloadSingleResourceAsync(string culture)
325333
{
326334
try
@@ -425,7 +433,7 @@ private async Task DownloadFileAsync2(Uri uri, string name)
425433
{
426434
try
427435
{
428-
var file = Path.Combine(Dispatcher.Invoke<string>(() => TempPath), name);
436+
var file = Path.Combine(Dispatcher.Invoke<string>(() => _tempPath), name);
429437

430438
if (File.Exists(file))
431439
File.Delete(file);
@@ -464,7 +472,7 @@ private async Task DownloadFileAsync(Uri uri, string name)
464472
{
465473
try
466474
{
467-
var file = Path.Combine(Dispatcher.Invoke<string>(() => TempPath), name);
475+
var file = Path.Combine(Dispatcher.Invoke<string>(() => _tempPath), name);
468476

469477
if (File.Exists(file))
470478
File.Delete(file);
@@ -503,7 +511,7 @@ private async Task LoadFilesAsync()
503511
{
504512
try
505513
{
506-
var files = await Task.Factory.StartNew(() => Directory.EnumerateFiles(TempPath, "*.xaml"));
514+
var files = await Task.Factory.StartNew(() => Directory.EnumerateFiles(_tempPath, "*.xaml"));
507515

508516
foreach (var file in files)
509517
{

ScreenToGif.Model/Enums/EncoderTypes.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace ScreenToGif.Domain.Enums;
33
public enum EncoderTypes
44
{
55
ScreenToGif, //Gif, Apng
6+
KGySoft, // Gif
67
System, //Gif, Video
78
FFmpeg, //Gif, Webp, Apng, Video
89
Gifski //Gif

ScreenToGif.Model/Enums/PanelType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public enum PanelTypes
6969
RemoveDuplicates = 13,
7070

7171
/// <summary>
72-
/// Mouse Clicks Panel.
72+
/// Mouse Events Panel.
7373
/// </summary>
74-
MouseClicks = 14,
74+
MouseEvents = 14,
7575

7676
/// <summary>
7777
/// Smooth Loop Panel.

ScreenToGif.Model/Enums/TaskTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace ScreenToGif.Domain.Enums;
33
public enum TaskTypes
44
{
55
NotDeclared = 0,
6-
MouseClicks = 1,
6+
MouseEvents = 1,
77
KeyStrokes = 2,
88
Delay = 3,
99
Progress = 4,

ScreenToGif.Model/Enums/VideoCodecPresets.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace ScreenToGif.Domain.Enums;
55
[SuppressMessage("ReSharper", "InconsistentNaming")]
66
public enum VideoCodecPresets
77
{
8+
Auto = -1,
89
NotSelected,
910
None,
1011

ScreenToGif.Model/Enums/VideoCodecs.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,14 @@ public enum VideoCodecs
4040
Vp8,
4141

4242
[Description("libvpx-vp9")]
43-
Vp9
43+
Vp9,
44+
45+
[Description("libaom-av1")]
46+
LibAom,
47+
48+
[Description("libsvtav1")]
49+
SvtAv1,
50+
51+
[Description("librav1e")]
52+
Rav1E,
4453
}

ScreenToGif.Model/Enums/VideoPixelFormats.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public enum VideoPixelFormats
2424
Gbrp12Le,
2525
Gray,
2626
Gray10Le,
27+
Gray12Le,
2728
Gray16Be,
2829
MonoB,
2930
Nv12,

ScreenToGif.Model/ScreenToGif.Domain.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<DebugType>embedded</DebugType>
88
<UseWPF>True</UseWPF>
99
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
10-
<Version>2.36.0</Version>
10+
<Version>2.37.0</Version>
1111
</PropertyGroup>
1212

1313
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

ScreenToGif.Native/ScreenToGif.Native.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<UseWindowsForms>True</UseWindowsForms>
88
<DebugType>embedded</DebugType>
99
<Platforms>AnyCPU;ARM64;x64;x86</Platforms>
10-
<Version>2.36.0</Version>
10+
<Version>2.37.0</Version>
1111
</PropertyGroup>
1212

1313
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

ScreenToGif.Test/ScreenToGif.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
1616
<PackageReference Include="xunit" Version="2.4.1" />
1717
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
<PrivateAssets>all</PrivateAssets>
2020
</PackageReference>
21-
<PackageReference Include="coverlet.collector" Version="3.1.0">
21+
<PackageReference Include="coverlet.collector" Version="3.1.2">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>

0 commit comments

Comments
 (0)