From 944906a594183f46c9cafa1c2ba2cc925d369503 Mon Sep 17 00:00:00 2001 From: Riley McArdle Date: Thu, 12 May 2011 17:50:45 -0500 Subject: [PATCH] Safely migrate panel layout file from Local to Roaming folder. --- mRemoteV1/Config/Config.Settings.Load.vb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/Config/Config.Settings.Load.vb b/mRemoteV1/Config/Config.Settings.Load.vb index 11a1c766b..481002039 100644 --- a/mRemoteV1/Config/Config.Settings.Load.vb +++ b/mRemoteV1/Config/Config.Settings.Load.vb @@ -160,8 +160,13 @@ Namespace Config Loop Startup.CreatePanels() - If File.Exists(App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName) And My.Settings.ResetPanels = False Then - .pnlDock.LoadFromXml(App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName, AddressOf GetContentFromPersistString) + + Dim oldPath As String = GetFolderPath(SpecialFolder.LocalApplicationData) & "\" & My.Application.Info.ProductName & "\" & App.Info.Settings.LayoutFileName + Dim newPath As String = App.Info.Settings.SettingsPath & "\" & App.Info.Settings.LayoutFileName + If File.Exists(newPath) Then + .pnlDock.LoadFromXml(newPath, AddressOf GetContentFromPersistString) + ElseIf File.Exists(oldPath) Then + .pnlDock.LoadFromXml(oldPath, AddressOf GetContentFromPersistString) Else Startup.SetDefaultLayout() End If