From a4b19173618756e1d0cee3339e6cde734d13abb7 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 5 Feb 2019 11:47:37 -0800 Subject: Fixed a bug where UI elements were attempting to be updated in a background thread. Also code cleanup & removed confusing startup UI --- windows/WinUI/OnboardProcess/CreateAccount.xaml | 38 --------- windows/WinUI/OnboardProcess/CreateAccount.xaml.cs | 66 --------------- windows/WinUI/OnboardProcess/CreateOrJoin.xaml | 49 ----------- windows/WinUI/OnboardProcess/CreateOrJoin.xaml.cs | 98 ---------------------- windows/WinUI/OnboardProcess/EnterToken.xaml | 29 ------- windows/WinUI/OnboardProcess/EnterToken.xaml.cs | 57 ------------- windows/WinUI/OnboardProcess/Finished.xaml | 27 ------ windows/WinUI/OnboardProcess/Finished.xaml.cs | 37 -------- windows/WinUI/OnboardProcess/LogIn.xaml | 35 -------- windows/WinUI/OnboardProcess/LogIn.xaml.cs | 57 ------------- windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml | 27 ------ .../WinUI/OnboardProcess/RegisterOrLogIn.xaml.cs | 48 ----------- 12 files changed, 568 deletions(-) delete mode 100644 windows/WinUI/OnboardProcess/CreateAccount.xaml delete mode 100644 windows/WinUI/OnboardProcess/CreateAccount.xaml.cs delete mode 100644 windows/WinUI/OnboardProcess/CreateOrJoin.xaml delete mode 100644 windows/WinUI/OnboardProcess/CreateOrJoin.xaml.cs delete mode 100644 windows/WinUI/OnboardProcess/EnterToken.xaml delete mode 100644 windows/WinUI/OnboardProcess/EnterToken.xaml.cs delete mode 100644 windows/WinUI/OnboardProcess/Finished.xaml delete mode 100644 windows/WinUI/OnboardProcess/Finished.xaml.cs delete mode 100644 windows/WinUI/OnboardProcess/LogIn.xaml delete mode 100644 windows/WinUI/OnboardProcess/LogIn.xaml.cs delete mode 100644 windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml delete mode 100644 windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml.cs (limited to 'windows/WinUI/OnboardProcess') diff --git a/windows/WinUI/OnboardProcess/CreateAccount.xaml b/windows/WinUI/OnboardProcess/CreateAccount.xaml deleted file mode 100644 index ddf50252..00000000 --- a/windows/WinUI/OnboardProcess/CreateAccount.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/windows/WinUI/OnboardProcess/CreateAccount.xaml.cs b/windows/WinUI/OnboardProcess/CreateAccount.xaml.cs deleted file mode 100644 index 72ba2182..00000000 --- a/windows/WinUI/OnboardProcess/CreateAccount.xaml.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WinUI.OnboardProcess -{ - /// - /// Interaction logic for CreateAccount.xaml - /// - public partial class CreateAccount : UserControl, ISwitchable - { - public CreateAccount() - { - InitializeComponent(); - } - - public void UtilizeState(object state) - { - throw new NotImplementedException(); - } - - public void CreateAccount_Click(object sender, RoutedEventArgs e) - { - DoCreateAccount(); - } - - public void BackButton_Click(object sender, RoutedEventArgs e) - { - Switcher.Switch(new RegisterOrLogIn()); - } - - public async void DoCreateAccount() - { - if (PasswordTextBox1.Password.ToString() != PasswordTextBox2.Password.ToString()) - { - ErrorText.Content = "Passwords do not match!"; - } - else - { - CentralAPI api = CentralAPI.Instance; - bool accountCreated = await api.Login(EmailAddressTextBox.Text, - PasswordTextBox1.Password.ToString(), true); - - if (accountCreated) - { - Switcher.Switch(new CreateOrJoin()); - } - else - { - ErrorText.Content = "An error ocurred while creating your account."; - } - } - } - } -} diff --git a/windows/WinUI/OnboardProcess/CreateOrJoin.xaml b/windows/WinUI/OnboardProcess/CreateOrJoin.xaml deleted file mode 100644 index 21413e84..00000000 --- a/windows/WinUI/OnboardProcess/CreateOrJoin.xaml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/windows/WinUI/OnboardProcess/Finished.xaml.cs b/windows/WinUI/OnboardProcess/Finished.xaml.cs deleted file mode 100644 index a34abfe2..00000000 --- a/windows/WinUI/OnboardProcess/Finished.xaml.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WinUI.OnboardProcess -{ - /// - /// Interaction logic for Finished.xaml - /// - public partial class Finished : UserControl, ISwitchable - { - public Finished() - { - InitializeComponent(); - } - public void UtilizeState(object state) - { - throw new NotImplementedException(); - } - - private void DoneButton_Click(object sender, RoutedEventArgs e) - { - Window.GetWindow(this).Close(); - } - } -} diff --git a/windows/WinUI/OnboardProcess/LogIn.xaml b/windows/WinUI/OnboardProcess/LogIn.xaml deleted file mode 100644 index 501f7e0f..00000000 --- a/windows/WinUI/OnboardProcess/LogIn.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/windows/WinUI/OnboardProcess/LogIn.xaml.cs b/windows/WinUI/OnboardProcess/LogIn.xaml.cs deleted file mode 100644 index 8657b800..00000000 --- a/windows/WinUI/OnboardProcess/LogIn.xaml.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace WinUI.OnboardProcess -{ - /// - /// Interaction logic for LogIn.xaml - /// - public partial class LogIn : UserControl, ISwitchable - { - public LogIn() - { - InitializeComponent(); - } - - public void UtilizeState(object state) - { - throw new NotImplementedException(); - } - - public void LoginButton_Click(object sender, RoutedEventArgs e) - { - DoLogin(); - } - - public void BackButton_Click(object sender, RoutedEventArgs e) - { - Switcher.Switch(new RegisterOrLogIn()); - } - - private async void DoLogin() - { - CentralAPI api = CentralAPI.Instance; - bool didLogIn = await api.Login(EmailAddressTextBox.Text, PasswordTextBox.Password.ToString(), false); - if (didLogIn) - { - Switcher.Switch(new CreateOrJoin()); - } - else - { - ErrorText.Content = "Invalid username or password"; - } - } - } -} diff --git a/windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml b/windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml deleted file mode 100644 index 01f3ba9d..00000000 --- a/windows/WinUI/OnboardProcess/RegisterOrLogIn.xaml +++ /dev/null @@ -1,27 +0,0 @@ - - - Welcome to ZeroTier - Let's get started! - - If you haven't yet created an account, click "Create Account" below. If you have an account, you can log in with your username/password, or simply enter an API key. - - - - -