diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs
index afcf1e5..cc77607 100644
--- a/WeeXnes/Core/Global.cs
+++ b/WeeXnes/Core/Global.cs
@@ -8,7 +8,7 @@ namespace WeeXnes.Core
{
public class Information
{
- public const string Version = "4.4.7";
+ public const string Version = "4.4.8";
public const string EncryptionHash = "8zf5#RdyQ]$4x4_";
public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest";
}
diff --git a/WeeXnes/Core/HandleLaunchArguments.cs b/WeeXnes/Core/HandleLaunchArguments.cs
index ce7b854..ee7ef4e 100644
--- a/WeeXnes/Core/HandleLaunchArguments.cs
+++ b/WeeXnes/Core/HandleLaunchArguments.cs
@@ -19,7 +19,7 @@ namespace WeeXnes.Core
}
public static void arg_debugMode()
{
-
+ MessageBox.Show("user debug mode enabled");
}
public static void arg_enableConsole()
{
diff --git a/WeeXnes/Core/LoginLib.cs b/WeeXnes/Core/LoginLib.cs
index 2ce5816..eef87ea 100644
--- a/WeeXnes/Core/LoginLib.cs
+++ b/WeeXnes/Core/LoginLib.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Net.Http;
using Newtonsoft.Json;
+using WeeXnes.Views.ProfileView;
using WeeXnes.Views.Settings;
using Wpf.Ui.Appearance;
using Wpf.Ui.Controls;
@@ -73,10 +74,12 @@ namespace WeeXnes.Core
_token = token;
return token;
//Console.WriteLine($"Token: {token}");
+
}
else
{
WeeXnes.Core.CustomConsole.WriteLine("Error: " + response.StatusCode);
+ LoginView.errorStringCache.Value = response.StatusCode.ToString();
return null;
}
}
@@ -116,6 +119,7 @@ namespace WeeXnes.Core
//Console.WriteLine($"Email: {user.email}");
// Access other properties as needed
_currentUserCache.Value = user;
+ LoginView.alreadyLoggedIn = true;
return user;
}
else
@@ -124,6 +128,8 @@ namespace WeeXnes.Core
_currentUserCache.Value = null;
WeeXnes.Core.CustomConsole.WriteLine("Error: " + response.StatusCode);
+
+ LoginView.errorStringCache.Value = response.StatusCode.ToString();
return null;
}
}
diff --git a/WeeXnes/MainWindow.xaml b/WeeXnes/MainWindow.xaml
index 4d88545..fac605e 100644
--- a/WeeXnes/MainWindow.xaml
+++ b/WeeXnes/MainWindow.xaml
@@ -91,13 +91,13 @@
Name="ButtonPwGen"
PageTag="Gen"
PageType="{x:Type passwordGenerator:PasswordGenView}"/>
-
+ PageType="{x:Type profile:LoginView}"/>
+
+
+
+
+
+
+
diff --git a/WeeXnes/Views/ProfileView/LoginError.xaml.cs b/WeeXnes/Views/ProfileView/LoginError.xaml.cs
new file mode 100644
index 0000000..faeecdb
--- /dev/null
+++ b/WeeXnes/Views/ProfileView/LoginError.xaml.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace WeeXnes.Views.ProfileView
+{
+ public partial class LoginError : Page
+ {
+ public LoginError()
+ {
+ InitializeComponent();
+ }
+
+ private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
+ {
+ NavigationService.Navigate(new Uri("/Views/ProfileView/LoginView.xaml",UriKind.Relative));
+ }
+ }
+}
\ No newline at end of file
diff --git a/WeeXnes/Views/ProfileView/LoginView.xaml b/WeeXnes/Views/ProfileView/LoginView.xaml
index dad6fc3..65814f4 100644
--- a/WeeXnes/Views/ProfileView/LoginView.xaml
+++ b/WeeXnes/Views/ProfileView/LoginView.xaml
@@ -5,8 +5,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WeeXnes.Views.ProfileView"
mc:Ignorable="d"
- Title="LoginView" Height="450" Width="800">
+ Title="LoginView" Height="Auto" Width="Auto"
+ Loaded="LoginView_OnLoaded">
-
+
+
+
+
+
+
+
diff --git a/WeeXnes/Views/ProfileView/LoginView.xaml.cs b/WeeXnes/Views/ProfileView/LoginView.xaml.cs
index bd316ff..2b2a7f0 100644
--- a/WeeXnes/Views/ProfileView/LoginView.xaml.cs
+++ b/WeeXnes/Views/ProfileView/LoginView.xaml.cs
@@ -1,12 +1,49 @@
-using System.Windows.Controls;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using WeeXnes.Core;
namespace WeeXnes.Views.ProfileView
{
public partial class LoginView : Page
{
+ public static bool alreadyLoggedIn = false;
+ public static UpdateVar errorStringCache = new UpdateVar();
public LoginView()
{
InitializeComponent();
}
+
+ private void SwitchToProfileView()
+ {
+ NavigationService.Navigate(new Uri("/Views/ProfileView/ProfileView.xaml",UriKind.Relative));
+ }
+
+ private void LoginView_OnLoaded(object sender, RoutedEventArgs e)
+ {
+ if (alreadyLoggedIn)
+ {
+ SwitchToProfileView();
+ }
+ }
+
+ private void LoginButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ attemptLogin();
+ }
+
+ private void InputKeydown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter)
+ attemptLogin();
+ }
+
+ private void attemptLogin()
+ {
+ ProfileView.auth._email = tb_email.Text;
+ ProfileView.auth._password = tb_password.Text;
+ SwitchToProfileView();
+ }
}
}
\ No newline at end of file
diff --git a/WeeXnes/Views/ProfileView/ProfileView.xaml.cs b/WeeXnes/Views/ProfileView/ProfileView.xaml.cs
index a8c6f82..36a927a 100644
--- a/WeeXnes/Views/ProfileView/ProfileView.xaml.cs
+++ b/WeeXnes/Views/ProfileView/ProfileView.xaml.cs
@@ -16,13 +16,13 @@ namespace WeeXnes.Views.ProfileView
public ProfileView()
{
InitializeComponent();
- auth._email = "";
- auth._password = "";
}
private void ProfileView_OnLoaded(object sender, RoutedEventArgs e)
{
auth.ExceptionCache.ValueChanged += LoginWorkerException;
auth._currentUserCache.ValueChanged += userCacheChanged;
+ LoginView.errorStringCache.ValueChanged += errorStringChanged;
+ WeeXnes.Core.CustomConsole.WriteLine("Error Hooks loaded");
WeeXnes.Core.CustomConsole.WriteLine("Event hooks loaded");
if (auth._currentUserCache.Value == null)
@@ -32,6 +32,7 @@ namespace WeeXnes.Views.ProfileView
}
else
{
+ LoadProfileToGui();
ProfileContentPanel.Visibility = Visibility.Visible;
}
}
@@ -49,8 +50,11 @@ namespace WeeXnes.Views.ProfileView
}
else
{
- ProfileContentPanel.Visibility = Visibility.Collapsed;
- LoadingScreen.Visibility = Visibility.Visible;
+ this.Dispatcher.Invoke(() =>
+ {
+ ProfileContentPanel.Visibility = Visibility.Collapsed;
+ LoadingScreen.Visibility = Visibility.Visible;
+ });
}
}
@@ -76,8 +80,16 @@ namespace WeeXnes.Views.ProfileView
auth.ExceptionCache.ValueChanged -= LoginWorkerException;
auth._currentUserCache.ValueChanged -= userCacheChanged;
+ LoginView.errorStringCache.ValueChanged -= errorStringChanged;
WeeXnes.Core.CustomConsole.WriteLine("Event hooks unloaded");
}
+ private void errorStringChanged()
+ {
+ this.Dispatcher.Invoke(() =>
+ {
+ NavigationService.Navigate(new Uri("/Views/ProfileView/LoginError.xaml",UriKind.Relative));
+ });
+ }
}
}
\ No newline at end of file
diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj
index f1347a5..c32932b 100644
--- a/WeeXnes/WeeXnes.csproj
+++ b/WeeXnes/WeeXnes.csproj
@@ -4,7 +4,7 @@
Debug
AnyCPU
- 4.4.7
+ 4.4.8
{4B33CEE7-C74D-43B9-B99A-8B273D5195BC}
WinExe
WeeXnes
@@ -106,6 +106,9 @@
SaveToKeyManagerView.xaml
+
+ LoginError.xaml
+
LoginView.xaml
@@ -150,6 +153,7 @@
+