Skip to content

Commit

Permalink
Added "Show all Keys" button in Password page (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 3, 2024
1 parent ec459f3 commit 41a9cfa
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
17 changes: 15 additions & 2 deletions InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
Width="300"
Expand Down Expand Up @@ -96,11 +97,23 @@
</Grid>
</Border>
<Button
x:Name="ExportBtn"
x:Name="ShowBtn"
Grid.Column="2"
Margin="5"
Padding="5"
Background="Transparent"
Click="ShowBtn_Click"
Content="&#xF3FC;"
Cursor="Hand"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource ToolButton}" />
<Button
x:Name="ExportBtn"
Grid.Column="3"
Margin="5"
Padding="5"
Background="Transparent"
Click="ExportBtn_Click"
Content="&#xF1A5;"
Cursor="Hand"
Expand All @@ -109,7 +122,7 @@
Style="{DynamicResource ToolButton}" />
<Button
x:Name="GetWiFiBtn"
Grid.Column="3"
Grid.Column="4"
Margin="5"
Padding="5"
Background="{DynamicResource LightAccent}"
Expand Down
13 changes: 11 additions & 2 deletions InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace InternetTest.Pages;
public partial class WiFiPasswordsPage : Page
{
bool codeInjected = !Global.Settings.UseSynethia;
bool showKeys = false;
public WiFiPasswordsPage()
{
InitializeComponent();
Expand All @@ -53,7 +54,7 @@ public WiFiPasswordsPage()
private void InitUI()
{
TitleTxt.Text = $"{Properties.Resources.Commands} > {Properties.Resources.WifiPasswords}";
PlaceholderGrid.Children.Add(Placeholder); // Show the placeholder instead of an empty page
if (PlaceholderGrid.Children.Count == 0) PlaceholderGrid.Children.Add(Placeholder); // Show the placeholder instead of an empty page

try
{
Expand Down Expand Up @@ -128,6 +129,7 @@ internal async Task ExportWiFiNetworkInfo(string path, bool includePasswords)

internal void LoadWiFiInfo(string path)
{
WiFiItemDisplayer.Children.Clear();
string[] files = Directory.GetFiles(path);
for (int i = 0; i < files.Length; i++)
{
Expand All @@ -138,7 +140,7 @@ internal void LoadWiFiInfo(string path)

if (test != null)
{
WiFiItemDisplayer.Children.Add(new WiFiInfoItem(test));
WiFiItemDisplayer.Children.Add(new WiFiInfoItem(test, showKeys));
}
streamReader.Close();
}
Expand Down Expand Up @@ -238,4 +240,11 @@ private async void ExportWithoutPasswordBtn_Click(object sender, RoutedEventArgs
await ExportWiFiNetworkInfo(folderBrowserDialog.SelectedPath, false);
}
}

private void ShowBtn_Click(object sender, RoutedEventArgs e)
{
showKeys = !showKeys;
InitUI();
ShowBtn.Content = showKeys ? "\uF3F8" : "\uF3FC";
}
}
3 changes: 2 additions & 1 deletion InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ public partial class WiFiInfoItem : UserControl
{
bool codeInjected = !Global.Settings.UseSynethia;
private WLANProfile WLANProfile { get; init; }
public WiFiInfoItem(WLANProfile profile)
public WiFiInfoItem(WLANProfile profile, bool showKey=false)
{
InitializeComponent();
WLANProfile = profile;

InitUI();
if (showKey) ShowKeyBtn_Click(this, null);
}

internal void InitUI()
Expand Down

0 comments on commit 41a9cfa

Please # to comment.