Skip to content

Commit 0c078d4

Browse files
committed
Changelog 1.1.0
- Fixed the convert bug issue from previous commit - Reintroduced Windows Toast (downgraded toast package to 7.0.0 because it is the recommended version) - Minor cleanups & changes
1 parent 6e09306 commit 0c078d4

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

PhotoModeApp/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Reflection;
21
using System.Windows;
32

43
[assembly: ThemeInfo(

PhotoModeApp/Helpers/Win32Files.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private struct WIN32_FIND_DATA
3838

3939
public static int GetFileCount(string dir, bool includeSubdirectories = false)
4040
{
41-
string searchPattern = Path.Combine(dir, "PRDR3*.");
41+
string searchPattern = Path.Combine(dir, "PRDR3*");
4242

4343
var findFileData = new WIN32_FIND_DATA();
4444
IntPtr hFindFile = FindFirstFile(searchPattern, ref findFileData);

PhotoModeApp/PhotoModeApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PrivateAssets>all</PrivateAssets>
3333
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3434
</PackageReference>
35-
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
35+
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.0.0" />
3636
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
3737
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
3838
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />

PhotoModeApp/ViewModels/SettingsViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using Microsoft.Toolkit.Mvvm.ComponentModel;
2-
using Microsoft.Toolkit.Mvvm.Input;
3-
using System;
4-
using System.Windows.Input;
52
using Wpf.Ui.Common.Interfaces;
63

74
namespace PhotoModeApp.ViewModels

PhotoModeApp/Views/Pages/DashboardPage.xaml.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System;
44
using System.Diagnostics;
55
using System.IO;
6-
using System.Threading;
76
using System.Threading.Tasks;
87
using System.Windows;
98
using Windows.Foundation.Collections;
@@ -32,12 +31,24 @@ public ViewModels.DashboardViewModel ViewModel
3231

3332
private bool isAnyFilesSkipped;
3433

34+
3535
public DashboardPage(ViewModels.DashboardViewModel viewModel)
3636
{
3737
ViewModel = viewModel;
3838

3939
InitializeComponent();
4040
PathAction.Content = Helpers.Config.GetPath();
41+
42+
ToastNotificationManagerCompat.OnActivated += toastArgs =>
43+
{
44+
ToastArguments args = ToastArguments.Parse(toastArgs.Argument);
45+
ValueSet userInput = toastArgs.UserInput;
46+
47+
Application.Current.Dispatcher.Invoke(delegate
48+
{
49+
Process.Start("explorer.exe", Helpers.Config.GetPath());
50+
});
51+
};
4152
}
4253

4354
public async Task SetupAsync()
@@ -79,9 +90,9 @@ private async Task<int> ProcessPicturesAsync(IProgress<int> progress)
7990

8091
var finalPath = String.Format("{0}\\ConvertedImages\\{1}", Helpers.Config.GetPath(),
8192
Path.GetFileName(convertedFileName));
82-
try
83-
{
84-
File.Move(convertedFileName, finalPath);
93+
try
94+
{
95+
File.Move(convertedFileName, finalPath);
8596
}
8697
catch (IOException)
8798
{
@@ -105,9 +116,9 @@ private async Task<int> ProcessPicturesAsync(IProgress<int> progress)
105116

106117
private async void ConvertButton_Click(object sender, System.Windows.RoutedEventArgs e)
107118
{
108-
if (Helpers.Config.GetPath().Length > 0) return;
119+
if (Helpers.Config.GetPath().Length < 1) return;
109120

110-
totalNumberOfFiles = Helpers.Win32Files.GetFileCount(Helpers.Config.GetPath(), true);
121+
totalNumberOfFiles = Helpers.Win32Files.GetFileCount(Helpers.Config.GetPath(), false);
111122

112123
if (totalNumberOfFiles < 1)
113124
{
@@ -126,6 +137,15 @@ private async void ConvertButton_Click(object sender, System.Windows.RoutedEvent
126137
{
127138
StatusLabel.Text = "Photos successfully converted! 🎉";
128139
ConvertButton.IsEnabled = true;
140+
141+
new ToastContentBuilder()
142+
.AddArgument("action", "viewConversation")
143+
.AddArgument("conversationId", 9813)
144+
.AddText("Photos successfully converted! 🎉")
145+
.AddButton(new ToastButton()
146+
.SetContent("Show")
147+
.SetBackgroundActivation())
148+
.Show();
129149
return;
130150
}
131151

0 commit comments

Comments
 (0)