diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-04-26 17:55:17 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-04-26 17:55:17 +0300 |
| commit | 914d28f26fcc61c12f0a98c86e6a5ad5a455f72c (patch) | |
| tree | 49b8f80ff3a6ba8bd7e8159605277593b10e8125 /Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings | |
| parent | 07a75244fe05eb4b2b0b628ec8f038cced238579 (diff) | |
| download | Tango-914d28f26fcc61c12f0a98c86e6a5ad5a455f72c.tar.gz Tango-914d28f26fcc61c12f0a98c86e6a5ad5a455f72c.zip | |
More Eureka Adjustments.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs | 146 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml | 19 |
2 files changed, 86 insertions, 79 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index 49afbe63b..36d1824a0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -381,72 +381,75 @@ namespace Tango.PPC.MachineSettings.ViewModels } } - if (EnableProxy != Settings.EnableProxifier) + if (!BuildProvider.IsEureka) { - CmdCommand cmd = null; - CmdCommandResult result = null; - - if (!EnableProxy) + if (EnableProxy != Settings.EnableProxifier) { - try + CmdCommand cmd = null; + CmdCommandResult result = null; + + if (!EnableProxy) { - cmd = new CmdCommand("taskkill", "/F /IM proxifier.exe"); - result = await cmd.Run(); - Settings.EnableProxifier = false; - Settings.Save(); + try + { + cmd = new CmdCommand("taskkill", "/F /IM proxifier.exe"); + result = await cmd.Run(); + Settings.EnableProxifier = false; + Settings.Save(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Unable to disable the proxy.\n{ex.Message}"); + await NotificationProvider.ShowError($"Unable to disable the proxy.\n{ex.Message}"); + } } - catch (Exception ex) + else { - LogManager.Log(ex, $"Unable to disable the proxy.\n{ex.Message}"); - await NotificationProvider.ShowError($"Unable to disable the proxy.\n{ex.Message}"); + try + { + Process.Start(@"C:\Program Files (x86)\Proxifier\Proxifier.exe"); + Settings.EnableProxifier = true; + Settings.Save(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Unable to start the proxy service.\n{ex.Message}"); + await NotificationProvider.ShowError($"Unable to start the proxy service.\n{ex.Message}"); + } } } - else + + if (_previousEnableUWF != EnableUWF) { + await NotificationProvider.ShowWarning("Changes to disk protection (UWF) will take effect only after a full system restart."); + try { - Process.Start(@"C:\Program Files (x86)\Proxifier\Proxifier.exe"); - Settings.EnableProxifier = true; - Settings.Save(); + LogManager.Log($"Changing UWF mode to '{EnableUWF}'."); + if (EnableUWF) + { + NotificationProvider.SetGlobalBusyMessage("Enabling disk protection (UWF)..."); + await UnifiedWriteFilterManager.Enable(); + } + else + { + NotificationProvider.SetGlobalBusyMessage("Disabling disk protection (UWF)..."); + await UnifiedWriteFilterManager.Disable(); + } + NotificationProvider.ReleaseGlobalBusyMessage(); } catch (Exception ex) { - LogManager.Log(ex, $"Unable to start the proxy service.\n{ex.Message}"); - await NotificationProvider.ShowError($"Unable to start the proxy service.\n{ex.Message}"); + NotificationProvider.ReleaseGlobalBusyMessage(); + LogManager.Log(ex, "Error setting UWF mode."); + await NotificationProvider.ShowError($"Could not change the disk protection mode\n{ex.FlattenMessage()}"); } } - } - - if (_previousEnableUWF != EnableUWF) - { - await NotificationProvider.ShowWarning("Changes to disk protection (UWF) will take effect only after a full system restart."); - try + if (!isRestarting) { - LogManager.Log($"Changing UWF mode to '{EnableUWF}'."); - if (EnableUWF) - { - NotificationProvider.SetGlobalBusyMessage("Enabling disk protection (UWF)..."); - await UnifiedWriteFilterManager.Enable(); - } - else - { - NotificationProvider.SetGlobalBusyMessage("Disabling disk protection (UWF)..."); - await UnifiedWriteFilterManager.Disable(); - } - NotificationProvider.ReleaseGlobalBusyMessage(); + await NavigationManager.NavigateBack(); } - catch (Exception ex) - { - NotificationProvider.ReleaseGlobalBusyMessage(); - LogManager.Log(ex, "Error setting UWF mode."); - await NotificationProvider.ShowError($"Could not change the disk protection mode\n{ex.FlattenMessage()}"); - } - } - - if (!isRestarting) - { - await NavigationManager.NavigateBack(); } } } @@ -477,19 +480,22 @@ namespace Tango.PPC.MachineSettings.ViewModels MachineDataSynchronizer.SynchronizationStarted += (_, __) => InvalidateRelayCommands(); MachineDataSynchronizer.SynchronizationEnded += (_, __) => InvalidateRelayCommands(); - if (!Settings.EnableProxifier) + if (!BuildProvider.IsEureka) { - CmdCommand cmd = null; - CmdCommandResult result = null; - - try + if (!Settings.EnableProxifier) { - cmd = new CmdCommand("taskkill", "/F /IM proxifier.exe"); - result = await cmd.Run(); - } - catch (Exception ex) - { - LogManager.Log(ex, $"Unable to disable the proxy.\n{ex.Message}"); + CmdCommand cmd = null; + CmdCommandResult result = null; + + try + { + cmd = new CmdCommand("taskkill", "/F /IM proxifier.exe"); + result = await cmd.Run(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Unable to disable the proxy.\n{ex.Message}"); + } } } @@ -571,14 +577,17 @@ namespace Tango.PPC.MachineSettings.ViewModels SelectedTimeZone = TimeZones.SingleOrDefault(x => x.StandardName == TimeZone.CurrentTimeZone.StandardName); _previousTimeZone = SelectedTimeZone; - try + if (!BuildProvider.IsEureka) { - EnableUWF = await UnifiedWriteFilterManager.IsEnabled(); - _previousEnableUWF = EnableUWF; - } - catch (Exception ex) - { - LogManager.Log(ex, "Error getting UWF status."); + try + { + EnableUWF = await UnifiedWriteFilterManager.IsEnabled(); + _previousEnableUWF = EnableUWF; + } + catch (Exception ex) + { + LogManager.Log(ex, "Error getting UWF status."); + } } try @@ -613,7 +622,10 @@ namespace Tango.PPC.MachineSettings.ViewModels LogManager.Log(ex, "Error loading lubrication levels."); } - EnableProxy = Settings.EnableProxifier; + if (!BuildProvider.IsEureka) + { + EnableProxy = Settings.EnableProxifier; + } } private async void OnEnableRemoteAssistanceChanged() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index 6871eb330..2a7d968aa 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -59,7 +59,7 @@ <StackPanel Margin="10 30 10 10"> <connectivity:AvailableWiFiConnectionsControl DataContext="{Binding ConnectivityProvider}" /> - <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <controls:TableGrid Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable Hot Spot</TextBlock> <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding EnableHotSpot}"></touch:TouchToggleSlider> @@ -68,7 +68,7 @@ <touch:TouchTextBox IsPassword="True" Watermark="•••••••" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding HotSpotPassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> </controls:TableGrid> - <DockPanel Margin="10 -40 0 0"> + <DockPanel Margin="10 -40 0 0" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <touch:TouchIcon VerticalAlignment="Top" Icon="InformationOutline" Foreground="{StaticResource TangoGrayTextBrush}"></touch:TouchIcon> <TextBlock Margin="10 0 0 0" VerticalAlignment="Top" TextWrapping="Wrap" FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}"> Enabling a hot-spot will create a wireless network dedicated to this machine. @@ -219,7 +219,7 @@ </touch:TouchExpander> <!--REMOTE ASSISTANCE--> - <touch:TouchExpander Margin="0 20 0 0" Header="Remote Assistance" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> + <touch:TouchExpander Margin="0 20 0 0" Header="Remote Assistance" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel> <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable Remote Assistance</TextBlock> @@ -236,7 +236,7 @@ </touch:TouchExpander> <!--LOCK SCREEN--> - <touch:TouchExpander Margin="0 20 0 0" Header="Lock Screen" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> + <touch:TouchExpander Margin="0 20 0 0" Header="Lock Screen" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel> <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable Lock Screen</TextBlock> @@ -327,7 +327,7 @@ </touch:TouchExpander> <!--SCREEN SAVER--> - <touch:TouchExpander Margin="0 20 0 0" Header="Screen Saver" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> + <touch:TouchExpander Margin="0 20 0 0" Header="Screen Saver" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}" Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <StackPanel> <controls:TableGrid Margin="10" RowHeight="60" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center"> @@ -380,7 +380,7 @@ <touch:TouchToggleSlider IsChecked="{Binding Settings.EnableEmbeddedDebugLogs}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> </DockPanel> - <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <DockPanel Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable Proxy</TextBlock> <touch:TouchToggleSlider IsChecked="{Binding EnableProxy}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> </DockPanel> @@ -406,11 +406,6 @@ </DockPanel> <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> - <TextBlock VerticalAlignment="Center">Use Legacy Jobs Module</TextBlock> - <touch:TouchToggleSlider IsChecked="{Binding Settings.UseJobsModuleV2,Converter={StaticResource BooleanInverseConverter}}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> - </DockPanel> - - <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Always Start in Technician Mode</TextBlock> <touch:TouchToggleSlider IsChecked="{Binding Settings.EnableTechnicianModeByDefault}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> </DockPanel> @@ -455,7 +450,7 @@ <touch:TouchNumericTextBox Minimum="1" Maximum="120" KeyboardContainer="{Binding ElementName=Container}" Value="{Binding Settings.InsightsMaxStorageDuration,Converter={StaticResource TimeSpanToDaysConverter}}" Margin="0 0 100 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="90"></touch:TouchNumericTextBox> </DockPanel> - <DockPanel Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> + <DockPanel Visibility="{Binding BuildProvider.IsEureka,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="0 20 0 0" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable UWF (Disk Protection)</TextBlock> <touch:TouchToggleSlider IsChecked="{Binding EnableUWF}" Margin="0 0 100 0" DockPanel.Dock="Right" Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Width="90"></touch:TouchToggleSlider> </DockPanel> |
