diff --git a/InternetTest/InternetTest/App.xaml b/InternetTest/InternetTest/App.xaml index 56aed5e..ba5a95b 100644 --- a/InternetTest/InternetTest/App.xaml +++ b/InternetTest/InternetTest/App.xaml @@ -1703,6 +1703,9 @@ + diff --git a/InternetTest/InternetTest/Classes/DnsCacheInfo.cs b/InternetTest/InternetTest/Classes/DnsCacheInfo.cs index 889d925..d28ff95 100644 --- a/InternetTest/InternetTest/Classes/DnsCacheInfo.cs +++ b/InternetTest/InternetTest/Classes/DnsCacheInfo.cs @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -using System.Text.Json.Serialization; using System.Text.Json; +using System.Text.Json.Serialization; namespace InternetTest.Classes; diff --git a/InternetTest/InternetTest/Classes/Global.cs b/InternetTest/InternetTest/Classes/Global.cs index 724ab31..dc990a5 100644 --- a/InternetTest/InternetTest/Classes/Global.cs +++ b/InternetTest/InternetTest/Classes/Global.cs @@ -48,13 +48,19 @@ public static class Global #if NIGHTLY private static DateTime Date => System.IO.File.GetLastWriteTime(System.Reflection.Assembly.GetEntryAssembly().Location); - public static string Version => $"8.6.1.2409-nightly{Date:yyMM.dd@HHmm}"; + public static string Version => $"8.7.0.2411-nightly{Date:yyMM.dd@HHmm}"; #else - public static string Version => "8.6.1.2409"; + public static string Version => "8.7.0.2411"; #endif public static string LastVersionLink => "https://raw.githubusercontent.com/Leo-Corporation/LeoCorp-Docs/master/Liens/Update%20System/InternetTest/7.0/Version.txt"; - internal static string SynethiaPath => $@"{FileSys.AppDataPath}\Léo Corporation\InternetTest Pro\NewSynethiaConfig.json"; + +#if PORTABLE + public static string DefaultStoragePath => $@"{FileSys.CurrentDirectory}\InternetTest Pro\"; +#else + public static string DefaultStoragePath => $@"{FileSys.AppDataPath}\Léo Corporation\InternetTest Pro\"; +#endif + public static string SynethiaPath => $@"{DefaultStoragePath}\NewSynethiaConfig.json"; public static bool IsConfidentialModeEnabled { get; set; } = false; public static Settings Settings { get; set; } = SettingsManager.Load(); public static SynethiaConfig SynethiaConfig { get; set; } = LoadConfig(); @@ -286,7 +292,7 @@ public static bool IsUrlValid(string url) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); } - public async static Task GetIPInfoAsync(string ip) + public static async Task GetIPInfoAsync(string ip) { try { @@ -649,7 +655,7 @@ public static async Task GetDnsCache() public static async Task RunPowerShellCommandAsync(string psCommand) { // Create a new process to run PowerShell - ProcessStartInfo processInfo = new ProcessStartInfo + ProcessStartInfo processInfo = new() { FileName = "powershell.exe", Arguments = $"-Command \"{psCommand}\"", diff --git a/InternetTest/InternetTest/Classes/Settings.cs b/InternetTest/InternetTest/Classes/Settings.cs index c4794e6..75f37df 100644 --- a/InternetTest/InternetTest/Classes/Settings.cs +++ b/InternetTest/InternetTest/Classes/Settings.cs @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using InternetTest.Enums; -using PeyrSharp.Env; using System; using System.Collections.Generic; using System.Diagnostics; @@ -54,6 +53,10 @@ public Settings() TraceRouteMaxTimeOut = 5000; MainWindowSize = (950, 600); LaunchIpLocationOnStart = true; + DownDetectorWebsites = []; + DefaultTimeInterval = 10; + HideDisabledAdapters = false; + MapZoomLevel = 12; } public Themes Theme { get; set; } @@ -78,25 +81,25 @@ public Settings() public List? DownDetectorWebsites { get; set; } public int? DefaultTimeInterval { get; set; } public bool? HideDisabledAdapters { get; set; } + public int? MapZoomLevel { get; set; } } public static class SettingsManager { - private static string SettingsPath => $@"{FileSys.AppDataPath}\Léo Corporation\InternetTest Pro\Settings.xml"; public static Settings Load() { - if (!Directory.Exists($@"{FileSys.AppDataPath}\Léo Corporation\InternetTest Pro\")) + if (!Directory.Exists(Global.DefaultStoragePath)) { - Directory.CreateDirectory($@"{FileSys.AppDataPath}\Léo Corporation\InternetTest Pro\"); + Directory.CreateDirectory(Global.DefaultStoragePath); } - if (!File.Exists(SettingsPath)) + if (!File.Exists($@"{Global.DefaultStoragePath}\Settings.xml")) { Global.Settings = new(); // Serialize to XML XmlSerializer xmlSerializer = new(typeof(Settings)); - StreamWriter streamWriter = new(SettingsPath); + StreamWriter streamWriter = new($@"{Global.DefaultStoragePath}\Settings.xml"); xmlSerializer.Serialize(streamWriter, Global.Settings); streamWriter.Dispose(); return new(); @@ -106,7 +109,7 @@ public static Settings Load() // Deserialize from xml XmlSerializer xmlDeserializer = new(typeof(Settings)); - StreamReader streamReader = new(SettingsPath); + StreamReader streamReader = new($@"{Global.DefaultStoragePath}\Settings.xml"); var settings = (Settings?)xmlDeserializer.Deserialize(streamReader) ?? new(); // Upgrade the settings file if it comes from an older version @@ -122,6 +125,7 @@ public static Settings Load() settings.DownDetectorWebsites ??= []; settings.DefaultTimeInterval ??= 10; settings.HideDisabledAdapters ??= false; + settings.MapZoomLevel ??= 12; return settings; } @@ -130,7 +134,7 @@ public static void Save() { // Serialize to XML XmlSerializer xmlSerializer = new(typeof(Settings)); - StreamWriter streamWriter = new(SettingsPath); + StreamWriter streamWriter = new($@"{Global.DefaultStoragePath}\Settings.xml"); xmlSerializer.Serialize(streamWriter, Global.Settings); streamWriter.Dispose(); } @@ -186,6 +190,7 @@ public static void Import(string path) settings.DownDetectorWebsites ??= []; settings.DefaultTimeInterval ??= 10; settings.HideDisabledAdapters ??= false; + settings.MapZoomLevel ??= 12; Global.Settings = settings; diff --git a/InternetTest/InternetTest/InternetTest.csproj b/InternetTest/InternetTest/InternetTest.csproj index c581d64..f1d59bb 100644 --- a/InternetTest/InternetTest/InternetTest.csproj +++ b/InternetTest/InternetTest/InternetTest.csproj @@ -6,7 +6,7 @@ enable true True - 8.6.1.2409 + 8.7.0.2411 © 2024 Léo Corporation Taking you to another level. InternetTest can locate IP addresses, send ping request, recover your WiFi passwords and more! @@ -41,7 +41,7 @@ - + diff --git a/InternetTest/InternetTest/MainWindow.xaml b/InternetTest/InternetTest/MainWindow.xaml index d9b38c3..34e0504 100644 --- a/InternetTest/InternetTest/MainWindow.xaml +++ b/InternetTest/InternetTest/MainWindow.xaml @@ -257,20 +257,204 @@ - - - + + + + + + + + + - + VerticalAlignment="Center" + Orientation="Horizontal" Margin="0,0,10,0"> + + + + + + + + + + + + +