From 311f0cfb7efdadcee0036bd075389d065504d9a1 Mon Sep 17 00:00:00 2001 From: fenopy Date: Tue, 23 Dec 2025 09:26:35 -0600 Subject: [PATCH] feat: save selected mirror --- App.config | 3 +++ MainForm.cs | 13 ++++++++++++- Properties/Settings.settings | 2 ++ Utilities/SettingsManager.cs | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/App.config b/App.config index 058882e..0bc18aa 100644 --- a/App.config +++ b/App.config @@ -200,6 +200,9 @@ + + + diff --git a/MainForm.cs b/MainForm.cs index bceab0e..3a48ffd 100755 --- a/MainForm.cs +++ b/MainForm.cs @@ -2845,7 +2845,15 @@ namespace AndroidSideloader { await Task.Run(() => remotesList.Invoke(() => { - remotesList.SelectedIndex = 0; + if (!string.IsNullOrWhiteSpace(settings.selectedMirror)) + { + int i = remotesList.Items.IndexOf(settings.selectedMirror); + if (i >= 0) + remotesList.SelectedIndex = i; + else + remotesList.SelectedIndex = 0; + } + string selectedRemote = remotesList.SelectedItem.ToString(); currentRemote = ""; @@ -4645,6 +4653,9 @@ If the problem persists, visit our Telegram (https://t.me/VRPirates) or Discord remotesList.Invoke(() => { currentRemote = "VRP-mirror" + selectedRemote; }); } + settings.selectedMirror = selectedRemote; + settings.Save(); + await refreshCurrentMirror("Refreshing App List..."); UpdateStatusLabels(); } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 899d4fc..8f67ef7 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -191,5 +191,7 @@ + + \ No newline at end of file diff --git a/Utilities/SettingsManager.cs b/Utilities/SettingsManager.cs index e947d73..66fe222 100644 --- a/Utilities/SettingsManager.cs +++ b/Utilities/SettingsManager.cs @@ -135,6 +135,7 @@ namespace AndroidSideloader.Utilities public bool useProxy { get; set; } = false; public string ProxyAddress { get; set; } = string.Empty; public string ProxyPort { get; set; } = string.Empty; + public string selectedMirror { get; set; } = string.Empty; public bool TrailersEnabled { get; set; } = true; public bool UseGalleryView { get; set; } = true; private SettingsManager() @@ -259,6 +260,7 @@ namespace AndroidSideloader.Utilities useProxy = false; ProxyAddress = string.Empty; ProxyPort = string.Empty; + selectedMirror = string.Empty; TrailersEnabled = true; UseGalleryView = true;