Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-connection status update & changed placement
Greedeks441c6986afc5
diff --git a/.Source/GTweak/Core/ViewModel/PagesViewModel.cs b/.Source/GTweak/Core/ViewModel/PagesViewModel.csindex 929441f0..625de98f 100644--- a/.Source/GTweak/Core/ViewModel/PagesViewModel.cs+++ b/.Source/GTweak/Core/ViewModel/PagesViewModel.cs@@ -146,7 +146,7 @@ namespace GTweak.Core.ViewModelDisplayIpAddress = SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"];DisplayCountProcess = new SystemData.MonitoringSystem().CountProcess.ToString();- if (Settings.IsHiddenIpAddress & !SystemData.СomputerСonfiguration.IsConnectionLose & !SystemData.СomputerСonfiguration.IsInternetLimited & !SystemData.СomputerСonfiguration.IsConnectionBlock)+ if (Settings.IsHiddenIpAddress & SystemData.СomputerСonfiguration.ConnectionStatus == 0){SetBlurValue = 20;DisplayImageHidden = (DrawingImage)Application.Current.Resources["DI_Show"];@@ -154,7 +154,7 @@ namespace GTweak.Core.ViewModelelse{SetBlurValue = 0;- DisplayImageHidden = !SystemData.СomputerСonfiguration.IsConnectionLose & !SystemData.СomputerСonfiguration.IsInternetLimited & !SystemData.СomputerСonfiguration.IsConnectionBlock ? (DrawingImage)Application.Current.Resources["DI_Hide"] : default;+ DisplayImageHidden = SystemData.СomputerСonfiguration.ConnectionStatus == 0 ? (DrawingImage)Application.Current.Resources["DI_Hide"] : default;}}}diff --git a/.Source/GTweak/Utilities/Tweaks/SystemData.cs b/.Source/GTweak/Utilities/Tweaks/SystemData.csindex 5296ba3e..99f76496 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemData.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemData.cs@@ -2,6 +2,7 @@using Newtonsoft.Json;using System;using System.Collections.Generic;+using System.Data;using System.Diagnostics;using System.Globalization;using System.IO;@@ -125,9 +126,15 @@ namespace GTweak.Utilities.Tweaksinternal sealed class СomputerСonfiguration{internal static string WindowsClientVersion { get; set; } = string.Empty;- internal static bool IsConnectionLose { get; private set; } = false;- internal static bool IsConnectionBlock { get; private set; } = false;- internal static bool IsInternetLimited { get; private set; } = false;++ /// <summary>+ /// No connection problems - [0];+ /// Connection lose - [1];+ /// Conection block - [2];+ /// Connection limited - [3].+ /// </summary>+ internal static byte ConnectionStatus = 0;+private static string _type = string.Empty;private static readonly EnumerationOptions optionsObj = new EnumerationOptions { ReturnImmediately = true };@@ -277,30 +284,33 @@ namespace GTweak.Utilities.Tweakscatch{СonfigurationData["IpAddress"] = (string)Application.Current.Resources["limited_systemInformation"];- IsInternetLimited = true;+ ConnectionStatus = 3;}finally{- if (IsInternetLimited)- IsInternetLimited = false;- if (IsConnectionBlock)- IsConnectionBlock = false;+ switch (ConnectionStatus)+ {+ case 2:+ case 3:+ ConnectionStatus = 0;+ break;+ }if (IPAddress.TryParse(clientInternetProtocol.Ip, out _) && !string.IsNullOrEmpty(clientInternetProtocol.Ip) && !string.IsNullOrEmpty(clientInternetProtocol.Country)){- IsConnectionLose = false;+ ConnectionStatus = 0;СonfigurationData["IpAddress"] = clientInternetProtocol.Ip + " (" + clientInternetProtocol.Country + ")";}else{- IsConnectionBlock = true;+ ConnectionStatus = 2;СonfigurationData["IpAddress"] = (string)Application.Current.Resources["connection_block_systemInformation"];}}}else{- IsConnectionLose = true;+ ConnectionStatus = 1;СonfigurationData["IpAddress"] = (string)Application.Current.Resources["connection_lose_systemInformation"];}});diff --git a/.Source/GTweak/View/InformationSystemView.xaml.cs b/.Source/GTweak/View/InformationSystemView.xaml.csindex 9ccb8d53..d0c1794d 100644--- a/.Source/GTweak/View/InformationSystemView.xaml.cs+++ b/.Source/GTweak/View/InformationSystemView.xaml.cs@@ -27,24 +27,19 @@ namespace GTweak.ViewApp.LanguageChanged += delegate{- if (!SystemData.СomputerСonfiguration.IsConnectionLose)+ switch (SystemData.СomputerСonfiguration.ConnectionStatus){- if (SystemData.СomputerСonfiguration.IsInternetLimited)- {- SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"] = (string)FindResource("limited_systemInformation");- DataContext = new InformationSystemVM();- }- else if (SystemData.СomputerСonfiguration.IsConnectionBlock)- {+ case 1:+ SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"] = (string)FindResource("connection_lose_systemInformation");+ break;+ case 2:SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"] = (string)FindResource("connection_block_systemInformation");- DataContext = new InformationSystemVM();- }- }- else- {- SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"] = (string)FindResource("connection_lose_systemInformation");- DataContext = new InformationSystemVM();+ break;+ case 3:+ SystemData.СomputerСonfiguration.СonfigurationData["IpAddress"] = (string)FindResource("limited_systemInformation");+ break;}+ DataContext = new InformationSystemVM();};timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegatediff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xamlindex 76799c59..01b1fd41 100644--- a/.Source/GTweak/Windows/MainWindow.xaml+++ b/.Source/GTweak/Windows/MainWindow.xaml@@ -192,10 +192,10 @@<uс:ToggleButton x:Name="BtnNotification" DynamicText="{DynamicResource btgl_notifications_main}" VerticalAlignment="Top" Height="25" Margin="40,20,0,0" ChangedState="BtnNotification_ChangedState"/>- <uс:ToggleButton x:Name="BtnTopMost" VerticalAlignment="Top" Height="25" DynamicText="{DynamicResource btgl_toast_main}" Margin="40,15,0,0" ChangedState="BtnTopMost_ChangedState"/>-<uс:ToggleButton x:Name="BtnUpdate" DynamicText="{DynamicResource btgl_update_main}" VerticalAlignment="Top" Height="25" Margin="40,15,0,0" ChangedState="BtnUpdate_ChangedState"/>+ <uс:ToggleButton x:Name="BtnTopMost" VerticalAlignment="Top" Height="25" DynamicText="{DynamicResource btgl_toast_main}" Margin="40,15,0,0" ChangedState="BtnTopMost_ChangedState"/>+<StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,10,0,0"><TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource slider_volume_main}"/><ToggleButton x:Name="BtnSoundNtn" Width="20" Height="20" Margin="10,1,0,0" Style="{StaticResource ToggleSound}" PreviewMouseDown="BtnSoundNtn_PreviewMouseDown"/>diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.csindex 752d851c..c13b56bd 100644--- a/.Source/GTweak/Windows/MainWindow.xaml.cs+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs@@ -20,8 +20,8 @@ namespace GTweakInitializeComponent();BtnNotification.StateNA = Settings.IsViewNotification;- BtnTopMost.StateNA = Topmost = Settings.IsTopMost;BtnUpdate.StateNA = Settings.IsСheckingUpdate;+ BtnTopMost.StateNA = Topmost = Settings.IsTopMost;BtnSoundNtn.IsChecked = Settings.IsSoundNotification;SliderVolume.Value = Settings.VolumeNotification;LanguageSelectionMenu.SelectedIndex = Settings.Language == "en" ? 0 : 1;