mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Tweak default capture save behaviour to 'soft' remember dir. Refs #335
* Rather than exclusively always opening at the default directory, it will only do that until a capture has been successfully saved - then it will re-use that previous directory. This is only remembered for as long as RenderDoc is open, thereafter it will revert back to the dir specified in the options.
This commit is contained in:
@@ -961,20 +961,42 @@ namespace renderdocui.Windows
|
||||
saveLogToolStripMenuItem.Enabled = false;
|
||||
}
|
||||
|
||||
private string lastSaveCapturePath = "";
|
||||
|
||||
public string GetSavePath()
|
||||
{
|
||||
try
|
||||
{
|
||||
saveDialog.InitialDirectory = m_Core.Config.DefaultCaptureSaveDirectory;
|
||||
}
|
||||
catch (Exception)
|
||||
if(m_Core.Config.DefaultCaptureSaveDirectory != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
if (lastSaveCapturePath == "")
|
||||
saveDialog.InitialDirectory = m_Core.Config.DefaultCaptureSaveDirectory;
|
||||
else
|
||||
saveDialog.InitialDirectory = lastSaveCapturePath;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
saveDialog.FileName = "";
|
||||
|
||||
DialogResult res = saveDialog.ShowDialog();
|
||||
|
||||
if (res == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
string dir = Path.GetDirectoryName(saveDialog.FileName);
|
||||
if(Directory.Exists(dir))
|
||||
lastSaveCapturePath = dir;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return saveDialog.FileName;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
@@ -1566,17 +1588,9 @@ namespace renderdocui.Windows
|
||||
|
||||
private bool PromptSaveLog()
|
||||
{
|
||||
try
|
||||
{
|
||||
saveDialog.InitialDirectory = m_Core.Config.DefaultCaptureSaveDirectory;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
string saveFilename = GetSavePath();
|
||||
|
||||
DialogResult res = saveDialog.ShowDialog();
|
||||
|
||||
if (res == DialogResult.OK)
|
||||
if (saveFilename != "")
|
||||
{
|
||||
if (m_Core.IsLogLocal && !File.Exists(m_Core.LogFileName))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user