mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Added buttons to reset all the settings.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -794,6 +794,7 @@
|
||||
<Resource Include="Images\Icons\undo.png" />
|
||||
<Resource Include="Images\Icons\stack.png" />
|
||||
<Resource Include="Images\Icons\git.png" />
|
||||
<Resource Include="Images\Icons\retry.png" />
|
||||
<Content Include="Sounds\rifle_hit.wav" />
|
||||
<Content Include="Sounds\rifle_reload.wav" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -34,12 +34,27 @@
|
||||
|
||||
<Frame Grid.Row="1" x:Name="Main" NavigationUIVisibility="Hidden" />
|
||||
|
||||
<Button x:Name="saveButton" Grid.Row="2" Click="saveButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/save.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">SAVE</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button x:Name="saveButton" Grid.Column="0" Click="saveButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/save.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">SAVE</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button x:Name="resetButton" Grid.Column="1" Click="resetButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/retry.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">RESET</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using OpenBullet.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -68,5 +69,11 @@ namespace OpenBullet.Pages.Main.Settings
|
||||
{
|
||||
OBIOManager.SaveSettings(Globals.obSettingsFile, Globals.obSettings);
|
||||
}
|
||||
|
||||
private void resetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure you want to reset all your OpenBullet settings?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
Globals.obSettings = new OBSettingsViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,12 +35,27 @@
|
||||
|
||||
<Frame Grid.Row="1" x:Name="Main" NavigationUIVisibility="Hidden" />
|
||||
|
||||
<Button x:Name="saveButton" Grid.Row="2" Click="saveButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/save.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">SAVE</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Grid Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button x:Name="saveButton" Grid.Column="0" Click="saveButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/save.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">SAVE</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button x:Name="resetButton" Grid.Column="1" Click="resetButton_Click" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Images/Icons/retry.png" Width="20" />
|
||||
<TextBlock VerticalAlignment="Center" Margin="5 0">RESET</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using RuriLib;
|
||||
using RuriLib.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -76,5 +77,11 @@ namespace OpenBullet.Pages.Main.Settings
|
||||
{
|
||||
IOManager.SaveSettings(Globals.rlSettingsFile, Globals.rlSettings);
|
||||
}
|
||||
|
||||
private void resetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure you want to reset all your RuriLib settings?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
Globals.rlSettings = new RLSettingsViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user