|
1 | | -using System.Diagnostics; |
2 | 1 | using System.Runtime.InteropServices; |
3 | 2 | using System.Text.RegularExpressions; |
4 | 3 | using System.Web; |
@@ -118,8 +117,8 @@ public MainWindow() |
118 | 117 |
|
119 | 118 | _ = AutoUpdater.UpdateCheckLoop(this, UpdatesBanner); |
120 | 119 |
|
121 | | - if (!Settings.Get("TransferredOldSettings")) |
122 | | - TransferOldSettingsFormats(); |
| 120 | + |
| 121 | + TransferOldSettingsFormats(); |
123 | 122 |
|
124 | 123 | Activated += (_, e) => |
125 | 124 | { |
@@ -177,38 +176,55 @@ private void ClearSubtitle() |
177 | 176 |
|
178 | 177 | private static void TransferOldSettingsFormats() |
179 | 178 | { |
180 | | - foreach (IPackageManager Manager in PEInterface.Managers) |
| 179 | + if (!Settings.Get("TransferredOldSettings")) |
181 | 180 | { |
182 | | - string SettingName = "Disable" + Manager.Name; |
183 | | - if (Settings.Get(SettingName)) |
| 181 | + foreach (IPackageManager Manager in PEInterface.Managers) |
184 | 182 | { |
185 | | - Settings.SetDictionaryItem("DisabledManagers", Manager.Name, true); |
186 | | - Settings.Set(SettingName, false); |
| 183 | + string SettingName = "Disable" + Manager.Name; |
| 184 | + if (Settings.Get(SettingName)) |
| 185 | + { |
| 186 | + Settings.SetDictionaryItem("DisabledManagers", Manager.Name, true); |
| 187 | + Settings.Set(SettingName, false); |
| 188 | + } |
187 | 189 | } |
188 | | - } |
189 | 190 |
|
190 | | - // Dependency checks don't need to be transferred, because the worst case scenario is the user has to click the "don't show again" again |
| 191 | + // Dependency checks don't need to be transferred, because the worst case scenario is the user has to click the "don't show again" again |
191 | 192 |
|
192 | | - foreach (string Page in new[]{ "Discover", "Installed", "Bundles", "Updates"}) |
193 | | - { |
194 | | - if (Settings.Get($"HideToggleFilters{Page}Page")) |
| 193 | + foreach (string Page in new[]{ "Discover", "Installed", "Bundles", "Updates"}) |
195 | 194 | { |
196 | | - Settings.SetDictionaryItem("HideToggleFilters", Page, true); |
197 | | - Settings.Set($"HideToggleFilters{Page}Page", false); |
198 | | - } |
| 195 | + if (Settings.Get($"HideToggleFilters{Page}Page")) |
| 196 | + { |
| 197 | + Settings.SetDictionaryItem("HideToggleFilters", Page, true); |
| 198 | + Settings.Set($"HideToggleFilters{Page}Page", false); |
| 199 | + } |
199 | 200 |
|
200 | | - if (Settings.Get($"DisableInstantSearch{Page}Tab")) |
201 | | - { |
202 | | - Settings.SetDictionaryItem("DisableInstantSearch", Page, true); |
203 | | - Settings.Set($"DisableInstantSearch{Page}Tab", false); |
| 201 | + if (Settings.Get($"DisableInstantSearch{Page}Tab")) |
| 202 | + { |
| 203 | + Settings.SetDictionaryItem("DisableInstantSearch", Page, true); |
| 204 | + Settings.Set($"DisableInstantSearch{Page}Tab", false); |
| 205 | + } |
| 206 | + |
| 207 | + if (!int.TryParse(Settings.GetValue($"SidepanelWidth{Page}Page"), out int sidepanelWidth)) sidepanelWidth = 250; |
| 208 | + Settings.SetDictionaryItem("SidepanelWidths", Page, sidepanelWidth); |
| 209 | + Settings.Set($"SidepanelWidth{Page}Page", false); |
204 | 210 | } |
205 | 211 |
|
206 | | - if (!int.TryParse(Settings.GetValue($"SidepanelWidth{Page}Page"), out int sidepanelWidth)) sidepanelWidth = 250; |
207 | | - Settings.SetDictionaryItem("SidepanelWidths", Page, sidepanelWidth); |
208 | | - Settings.Set($"SidepanelWidth{Page}Page", false); |
| 212 | + Settings.Set("TransferredOldSettings", true); |
209 | 213 | } |
210 | 214 |
|
211 | | - Settings.Set("TransferredOldSettings", true); |
| 215 | + if (!Settings.Get("TransferredOldSettingsv2")) |
| 216 | + { |
| 217 | + foreach (IPackageManager Manager in PEInterface.Managers) |
| 218 | + { |
| 219 | + string SettingName = "AlwaysElevate" + Manager.Name; |
| 220 | + if (Settings.Get(SettingName)) |
| 221 | + { |
| 222 | + Settings.SetDictionaryItem("AlwaysElevate", Manager.Name, true); |
| 223 | + Settings.Set(SettingName, false); |
| 224 | + } |
| 225 | + } |
| 226 | + Settings.Set("TransferredOldSettingsv2", true); |
| 227 | + } |
212 | 228 | } |
213 | 229 |
|
214 | 230 | public void HandleNotificationActivation(AppNotificationActivatedEventArgs args) |
|
0 commit comments