From 94cf36b991bbbec77d9bff3d7632b54bfe9a9539 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 29 Feb 2016 19:17:05 +0100 Subject: [PATCH] Add saved logs to recent file list immediately. Refs #197 --- renderdocui/Windows/Dialogs/LiveCapture.cs | 2 ++ renderdocui/Windows/MainWindow.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/renderdocui/Windows/Dialogs/LiveCapture.cs b/renderdocui/Windows/Dialogs/LiveCapture.cs index a10fd2b0f..b72f27111 100644 --- a/renderdocui/Windows/Dialogs/LiveCapture.cs +++ b/renderdocui/Windows/Dialogs/LiveCapture.cs @@ -395,6 +395,8 @@ namespace renderdocui.Windows { File.Copy(log.localpath, path, true); log.saved = true; + m_Core.Config.AddRecentFile(m_Core.Config.RecentLogFiles, path, 10); + m_Main.PopulateRecentFiles(); } catch (System.Exception ex) { diff --git a/renderdocui/Windows/MainWindow.cs b/renderdocui/Windows/MainWindow.cs index c0dc684fc..303c34460 100644 --- a/renderdocui/Windows/MainWindow.cs +++ b/renderdocui/Windows/MainWindow.cs @@ -788,7 +788,7 @@ namespace renderdocui.Windows statusText.Text = "Loading " + filename + "..."; } - private void PopulateRecentFiles() + public void PopulateRecentFiles() { while (recentFilesToolStripMenuItem.DropDownItems.Count > 0) { @@ -1247,6 +1247,8 @@ namespace renderdocui.Windows // we copy the (possibly) temp log to the desired path, but the log item remains referring to the original path. // This ensures that if the user deletes the saved path we can still open or re-save it. File.Copy(m_Core.LogFileName, saveDialog.FileName, true); + m_Core.Config.AddRecentFile(m_Core.Config.RecentLogFiles, saveDialog.FileName, 10); + PopulateRecentFiles(); SetTitle(saveDialog.FileName); } catch (System.Exception ex)