Skip to content

Commit 04c6740

Browse files
v1.0.3
1 parent e09c1f4 commit 04c6740

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/JuliusSweetland.OptiKids/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/JuliusSweetland.OptiKids/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,7 @@ You can turn off update checks from the Management Console (ALT + M).</value>
478478
<data name="WORD_RATE_LABEL" xml:space="preserve">
479479
<value>Word to spell speech rate:</value>
480480
</data>
481+
<data name="QUIT_MESSAGE" xml:space="preserve">
482+
<value>Are you sure you would like to quit?</value>
483+
</data>
481484
</root>

src/JuliusSweetland.OptiKids/UI/Windows/MainWindow.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public partial class MainWindow : Window
1616
private readonly IInputService inputService;
1717
private readonly InteractionRequest<NotificationWithAudioService> managementWindowRequest;
1818
private readonly ICommand managementWindowRequestCommand;
19+
private readonly ICommand quitCommand;
1920

2021
public MainWindow(IAudioService audioService,
2122
IInputService inputService)
@@ -27,6 +28,7 @@ public MainWindow(IAudioService audioService,
2728

2829
managementWindowRequest = new InteractionRequest<NotificationWithAudioService>();
2930
managementWindowRequestCommand = new DelegateCommand(RequestManagementWindow);
31+
quitCommand = new DelegateCommand(Quit);
3032

3133
//Setup key binding (Alt-M and Shift-Alt-M) to open settings
3234
InputBindings.Add(new KeyBinding
@@ -45,6 +47,7 @@ public MainWindow(IAudioService audioService,
4547

4648
public InteractionRequest<NotificationWithAudioService> ManagementWindowRequest { get { return managementWindowRequest; } }
4749
public ICommand ManagementWindowRequestCommand { get { return managementWindowRequestCommand; } }
50+
public ICommand QuitCommand { get { return quitCommand; } }
4851

4952
private void RequestManagementWindow()
5053
{
@@ -56,5 +59,13 @@ private void RequestManagementWindow()
5659
},
5760
_ => inputService.RequestResume());
5861
}
62+
63+
private void Quit()
64+
{
65+
if (MessageBox.Show(Properties.Resources.QUIT_MESSAGE, Properties.Resources.QUIT, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
66+
{
67+
Application.Current.Shutdown();
68+
}
69+
}
5970
}
6071
}

0 commit comments

Comments
 (0)