aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs42
1 files changed, 40 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index aa0eedefb..8eaa1f360 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -159,6 +159,11 @@ namespace Tango.MachineStudio.UI.ViewModels
/// </summary>
public RelayCommand OpenDeveloperConsoleCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the about command.
+ /// </summary>
+ public RelayCommand AboutCommand { get; set; }
+
private IAuthenticationProvider _authenticationProvider;
/// <summary>
/// Gets or sets the authentication provider.
@@ -319,6 +324,8 @@ namespace Tango.MachineStudio.UI.ViewModels
OpenDeveloperConsoleCommand = new RelayCommand(OpenDeveloperConsole);
TangoMessenger.Default.Register<Messages.ForcedUpdateMessage>((x) => DisableCheckForUpdates = true);
+
+ AboutCommand = new RelayCommand(ShowAboutDialog);
}
private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e)
@@ -502,9 +509,32 @@ namespace Tango.MachineStudio.UI.ViewModels
}
else
{
- _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>((x) =>
+ _notificationProvider.ShowModalDialog<ConnectedMachineViewVM>(async (x) =>
{
- DisconnectFromMachine();
+ if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.Disconnect)
+ {
+ DisconnectFromMachine();
+ }
+ else if (x.Result == ConnectedMachineViewVM.ConnectedMachineVMResult.UploadHardwareConfig)
+ {
+ if (NotificationProvider.ShowQuestion("This will reset the machine hardware configuration to the database configuration. Are you sure?"))
+ {
+ using (NotificationProvider.PushTaskItem("Uploading hardware configuration..."))
+ {
+ try
+ {
+ var configuration = ApplicationManager.ConnectedMachine.Machine.Configuration;
+ await ApplicationManager.ConnectedMachine.UploadHardwareConfiguration(configuration.HardwareVersion, configuration);
+ NotificationProvider.ShowInfo("Hardware configuration uploaded successfully.");
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error upload hardware configuration.");
+ NotificationProvider.ShowError("Error upload hardware configuration." + Environment.NewLine + ex.Message);
+ }
+ }
+ }
+ }
});
}
@@ -660,6 +690,14 @@ namespace Tango.MachineStudio.UI.ViewModels
}
}
+ /// <summary>
+ /// Shows the about dialog.
+ /// </summary>
+ private void ShowAboutDialog()
+ {
+ NotificationProvider.ShowModalDialog<AboutViewVM>((x) => { });
+ }
+
private void ReportIssue()
{
_notificationProvider.ShowModalDialog<ReportIssueViewVM, ReportIssueView>(new ReportIssueViewVM(TFSClient.Project, TFSClient.CreateBug()), async (vm) =>