Skip to content

Commit

Permalink
dashboard: add button with current version on it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganom committed Oct 16, 2024
1 parent dfa6005 commit 7b6ffba
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SimpleTwitchEmoteSounds/ViewModels/DashboardViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand Down Expand Up @@ -32,6 +33,7 @@ public partial class DashboardViewModel : ViewModelBase
[ObservableProperty] private bool _isEnabled = true;
[ObservableProperty] private string _searchText = string.Empty;
[ObservableProperty] private string _toggleButtonText = "Register Hotkey";
[ObservableProperty] private string _updateButtonText = "v1.2.0";
[ObservableProperty] private bool _isListening;
private static Hotkey ToggleHotkey => ConfigService.Settings.EnableHotkey;
private static ObservableCollection<SoundCommand> SoundCommands => ConfigService.Settings.SoundCommands;
Expand Down Expand Up @@ -201,6 +203,16 @@ private void ToggleSound(SoundCommand soundCommand)
soundCommand.Enabled = !soundCommand.Enabled;
}

[RelayCommand]
private void UpdateButton()
{
const string url = "https://github.com/Ganom/SimpleTwitchEmoteSounds/releases";
Process.Start(new ProcessStartInfo(url)
{
UseShellExecute = true
});
}

partial void OnUsernameChanged(string value)
{
ConfigService.State.Username = value;
Expand Down
10 changes: 10 additions & 0 deletions SimpleTwitchEmoteSounds/Views/DashboardView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,20 @@
Foreground="{Binding EnabledButtonColor}"
Content="{Binding IsEnabled, Converter={StaticResource BoolToEnabledDisabledConverter}}"
Margin="10,0,0,0"
ToolTip.Tip="This is a quick way to enable or disable all sounds at once"
ToolTip.Placement="Bottom"
Width="120" />
<Button Content="{Binding ToggleButtonText}"
Command="{Binding ToggleListeningCommand}"
HorizontalAlignment="Center"
ToolTip.Tip="Click to reassign the hotkey"
ToolTip.Placement="Bottom"
Margin="10,0,0,0" />
<Button Content="{Binding UpdateButtonText}"
Command="{Binding UpdateButtonCommand}"
HorizontalAlignment="Center"
ToolTip.Tip="Click to check for updates"
ToolTip.Placement="Bottom"
Margin="10,0,0,0" />
</StackPanel>
</DockPanel>
Expand Down

0 comments on commit 7b6ffba

Please sign in to comment.