Handle duplicate contents being returned and dummy them. Refs #310

* Unfortunately too late for v0.30, but at least this will help anyone
  who upgrades v0.29 -> v0.31 or such.
This commit is contained in:
baldurk
2016-08-01 22:22:50 +02:00
parent 39f453b166
commit 5508f9f599
2 changed files with 10 additions and 1 deletions
@@ -608,7 +608,7 @@ namespace WeifenLuo.WinFormsUI.Docking
for (int i = 0; i < contents.Length; i++)
{
IDockContent content = deserializeContent(contents[i].PersistString);
if (content == null)
if (content == null || dockPanel.Contents.IndexOf(content) >= 0)
content = new DummyContent();
content.DockHandler.DockPanel = dockPanel;
content.DockHandler.AutoHidePortion = contents[i].AutoHidePortion;
+9
View File
@@ -519,6 +519,15 @@ namespace renderdocui.Windows
// file is invalid
return false;
}
catch (Exception)
{
MessageBox.Show("Something went seriously wrong trying to load the window layout.\n" +
"Trying to recover now, but you might have to delete the layout file in %APPDATA%/renderdoc.\n",
"Error loading window layout",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}