aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs12
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs14
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml7
4 files changed, 27 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index 209b26505..0131cd209 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -90,7 +90,7 @@ namespace Tango.MachineStudio.UI.Authentication
/// <param name="password">The password.</param>
/// <returns></returns>
/// <exception cref="AuthenticationException">Login failed for user " + email</exception>
- public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false)
+ public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false, Action<String> logAction = null)
{
_refreshTokenTimer.Stop();
@@ -112,6 +112,8 @@ namespace Tango.MachineStudio.UI.Authentication
try
{
+ logAction?.Invoke("Logging in to machine service...");
+
response = _client.Login(new LoginRequest()
{
@@ -147,7 +149,10 @@ namespace Tango.MachineStudio.UI.Authentication
try
{
- ObservablesStaticCollections.Instance.Initialize();
+ ObservablesStaticCollections.Instance.Initialize((x) =>
+ {
+ logAction.Invoke(x);
+ });
}
catch (Exception ex)
{
@@ -156,6 +161,7 @@ namespace Tango.MachineStudio.UI.Authentication
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
+ logAction.Invoke("Loading user permissions...");
User user = new UserBuilder(db).Set(x => x.Email.ToLower() == email.ToLower()).WithRolesAndPermissions().WithOrganization().Build();
if (user == null)
@@ -167,6 +173,8 @@ namespace Tango.MachineStudio.UI.Authentication
_refreshTokenTimer.Start();
+ logAction.Invoke("Starting application...");
+
return new AuthenticationLoginResult()
{
User = user,
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index efe8fc6b1..13f22dfda 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -679,7 +679,7 @@ if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\"</PostBuildEven
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index 9c2367f93..dce469dbd 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -116,7 +116,12 @@ namespace Tango.MachineStudio.UI.ViewModels
set { _isStandardUser = value; RaisePropertyChangedAuto(); if (value) IsActiveDirectory = false; }
}
-
+ private String _progressLog;
+ public String ProgressLog
+ {
+ get { return _progressLog; }
+ set { _progressLog = value; RaisePropertyChangedAuto(); }
+ }
/// <summary>
/// Gets or sets the login command.
@@ -146,7 +151,7 @@ namespace Tango.MachineStudio.UI.ViewModels
Email = _settings.LastLoginEmail;
DeploymentSlot = _settings.DeploymentSlot;
RememberMe = _settings.RememberMe;
-
+
if (_settings.LastLoginMethod == LoginMethod.ActiveDirectory)
{
IsActiveDirectory = true;
@@ -184,7 +189,10 @@ namespace Tango.MachineStudio.UI.ViewModels
{
_settings.DeploymentSlot = DeploymentSlot;
- LoginResponse result = _authenticationProvider.Login(Email, Password, loginMethod, _settings.ByPassEnvironmentVersionCheck).Response;
+ LoginResponse result = _authenticationProvider.Login(Email, Password, loginMethod, _settings.ByPassEnvironmentVersionCheck, (progress) =>
+ {
+ ProgressLog = progress;
+ }).Response;
if (result.VersionChangeRequired && !_settings.ByPassEnvironmentVersionCheck)
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
index e7428dd28..ff13ec2c7 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
@@ -91,8 +91,11 @@
</StackPanel>
<StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center">
- <mahapps:ProgressRing Width="80" Height="80" IsActive="{Binding IsLogging}"></mahapps:ProgressRing>
- <TextBlock HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="18" FontStyle="Italic">Logging you in...</TextBlock>
+ <Grid>
+ <ProgressBar Width="300" Height="300" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="{Binding IsLogging}" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
+ <Image Source="{StaticResource MachineBig}" Width="200" RenderOptions.BitmapScalingMode="Fant"></Image>
+ </Grid>
+ <TextBlock HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="16" FontStyle="Italic" Foreground="{StaticResource GrayBrush200}" Text="{Binding ProgressLog}"></TextBlock>
</StackPanel>
</Grid>
</DockPanel>