mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added more UI to the Credentials login form and catch exception
This commit is contained in:
parent
3548e42a64
commit
670efbdb10
@ -4,6 +4,7 @@ using System.Reactive.Linq;
|
||||
using System.Security;
|
||||
using ReactiveUI;
|
||||
using ReactiveUI.Fody.Helpers;
|
||||
using Wabbajack.Common;
|
||||
using Wabbajack.Lib;
|
||||
using Wabbajack.Lib.Downloaders;
|
||||
|
||||
@ -33,6 +34,8 @@ namespace Wabbajack
|
||||
}
|
||||
|
||||
public void Login(SecureString password)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (password == null || password.Length == 0)
|
||||
{
|
||||
@ -43,6 +46,12 @@ namespace Wabbajack
|
||||
ReturnMessage = _downloader.LoginWithCredentials(Username, password);
|
||||
password.Clear();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.Error(e, "Exception while trying to login");
|
||||
ReturnMessage = new LoginReturnMessage($"Unhandled exception: {e.Message}", true);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsValidAddress(string s)
|
||||
{
|
||||
|
@ -17,18 +17,22 @@
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox FontSize="20" x:Name="Username" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"/>
|
||||
<PasswordBox Margin="0 16 0 -8" FontSize="20" x:Name="Password" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"/>
|
||||
<TextBlock FontSize="20" Grid.Row="0" Grid.Column="0" Margin="0 16 8 0">Email:</TextBlock>
|
||||
<TextBox FontSize="20" x:Name="Username" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"/>
|
||||
|
||||
<Button Margin="8 8 0 0" x:Name="LoginButton" Grid.Row="2" Grid.Column="2" Click="LoginButton_OnClick">
|
||||
<TextBlock FontSize="20" Grid.Row="1" Grid.Column="0" Margin="0 16 8 0">Password:</TextBlock>
|
||||
<PasswordBox Margin="0 16 0 -8" FontSize="20" x:Name="Password" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"/>
|
||||
|
||||
<Button Margin="8 8 0 0" x:Name="LoginButton" Grid.Row="2" Grid.Column="3" Click="LoginButton_OnClick">
|
||||
<TextBlock FontSize="14">Login</TextBlock>
|
||||
</Button>
|
||||
|
||||
<TextBox x:Name="Message" FontSize="20" Margin="0 16 0 0" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3"/>
|
||||
<TextBlock x:Name="Message" FontSize="20" Margin="0 16 0 0" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3"/>
|
||||
</Grid>
|
||||
</rxui:ReactiveUserControl>
|
||||
|
Loading…
Reference in New Issue
Block a user