-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Password protect info.dat file and require valid password on application start and when disabling protection. * Fix properly minimizing to system tray. * Fix steamguard window detection in different languages that utilize the em dash instead of regular hyphen. * Lowercase ini variables. * Rename settings window.
- Loading branch information
Showing
8 changed files
with
407 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Window x:Name="PasswordWindowDialog" x:Class="SAM.PasswordWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:SAM" | ||
mc:Ignorable="d" | ||
Title="Password" Height="130" Width="235" Background="#FF333638" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Topmost="True"> | ||
<Grid> | ||
<Button Content="Ok" HorizontalAlignment="Left" Margin="73,63,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/> | ||
<PasswordBox x:Name="PasswordTextBox" PasswordChar="•" HorizontalAlignment="Left" Height="23" Margin="10,32,0,0" VerticalAlignment="Top" Width="199" PreviewKeyDown="PasswordTextBox_PreviewKeyDown"/> | ||
<Label Content="Password" HorizontalAlignment="Left" Margin="81,4,0,0" VerticalAlignment="Top" Foreground="White"/> | ||
|
||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System.Windows; | ||
using System.Windows.Input; | ||
|
||
namespace SAM | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Window2.xaml | ||
/// </summary> | ||
public partial class PasswordWindow : Window | ||
{ | ||
public string PasswordText | ||
{ | ||
get { return PasswordTextBox.Password; } | ||
set { PasswordTextBox.Password = value; } | ||
} | ||
|
||
public PasswordWindow() | ||
{ | ||
InitializeComponent(); | ||
PasswordTextBox.Focus(); | ||
} | ||
|
||
private void PasswordTextBox_PreviewKeyDown(object sender, KeyEventArgs e) | ||
{ | ||
if (e.Key == Key.Return) | ||
{ | ||
if (validateInput()) | ||
{ | ||
DialogResult = true; | ||
} | ||
} | ||
} | ||
|
||
private void Button_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (validateInput()) | ||
{ | ||
DialogResult = true; | ||
} | ||
} | ||
|
||
private bool validateInput() | ||
{ | ||
if (PasswordTextBox.Password.Length > 0) | ||
{ | ||
PasswordText = PasswordTextBox.Password; | ||
return true; | ||
} | ||
else if (PasswordTextBox.Password.Length == 0) | ||
{ | ||
//MessageBoxResult messageBoxResult = MessageBox.Show("No password detected, are you sure?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Warning); | ||
|
||
//if (messageBoxResult == MessageBoxResult.OK) | ||
//{ | ||
// return true; | ||
//} | ||
|
||
PasswordText = ""; | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.