From 32eadbcade5f3bd843899071eb7673928e13c1a0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 14 Oct 2014 22:32:02 +0100 Subject: [PATCH] Remember last filename as well as last directory for capturing --- renderdocui/Code/PersistantConfig.cs | 1 + renderdocui/Windows/Dialogs/CaptureDialog.cs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/renderdocui/Code/PersistantConfig.cs b/renderdocui/Code/PersistantConfig.cs index 2a4dd5254..1539f148b 100644 --- a/renderdocui/Code/PersistantConfig.cs +++ b/renderdocui/Code/PersistantConfig.cs @@ -41,6 +41,7 @@ namespace renderdocui.Code public string LastLogPath = ""; public List RecentLogFiles = new List(); public string LastCapturePath = ""; + public string LastCaptureExe = ""; public List RecentCaptureSettings = new List(); public int CallstackLevelSkip = 0; diff --git a/renderdocui/Windows/Dialogs/CaptureDialog.cs b/renderdocui/Windows/Dialogs/CaptureDialog.cs index 3af0a5c56..332dd8369 100644 --- a/renderdocui/Windows/Dialogs/CaptureDialog.cs +++ b/renderdocui/Windows/Dialogs/CaptureDialog.cs @@ -326,9 +326,21 @@ namespace renderdocui.Windows.Dialogs try { if (exePath.Text.Length > 0 && Directory.Exists(Path.GetDirectoryName(exePath.Text))) + { exeBrowser.InitialDirectory = Path.GetDirectoryName(exePath.Text); + } else if (m_Core.Config.LastCapturePath.Length > 0) - exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + { + if (m_Core.Config.LastCaptureExe.Length > 0) + { + exeBrowser.FileName = m_Core.Config.LastCaptureExe; + exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + } + else + { + exeBrowser.InitialDirectory = m_Core.Config.LastCapturePath; + } + } } catch (ArgumentException) { @@ -345,6 +357,7 @@ namespace renderdocui.Windows.Dialogs UpdateWorkDirHint(); m_Core.Config.LastCapturePath = Path.GetDirectoryName(exeBrowser.FileName); + m_Core.Config.LastCaptureExe = Path.GetFileName(exeBrowser.FileName); } private void exePath_DragEnter(object sender, DragEventArgs e) @@ -365,6 +378,7 @@ namespace renderdocui.Windows.Dialogs UpdateWorkDirHint(); m_Core.Config.LastCapturePath = Path.GetDirectoryName(exeBrowser.FileName); + m_Core.Config.LastCaptureExe = Path.GetFileName(exeBrowser.FileName); } }