From 3e5d55d1d640319e1efc5fa83cfe5caf2ddd86fd Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 24 Aug 2016 11:46:33 +0200 Subject: [PATCH] Add an option to choose the default save folder for captures. Refs #335 --- docs/window/options_window.rst | 8 + renderdocui/Code/Core.cs | 2 +- renderdocui/Code/PersistantConfig.cs | 5 +- .../Dialogs/SettingsDialog.Designer.cs | 263 +++++++++++------- renderdocui/Windows/Dialogs/SettingsDialog.cs | 94 ++++++- .../Windows/Dialogs/SettingsDialog.resx | 46 ++- renderdocui/Windows/MainWindow.cs | 8 + 7 files changed, 317 insertions(+), 109 deletions(-) diff --git a/docs/window/options_window.rst b/docs/window/options_window.rst index fdbb25a2e..fad9e6da7 100644 --- a/docs/window/options_window.rst +++ b/docs/window/options_window.rst @@ -99,6 +99,14 @@ This allows you to choose where on disk temporary capture files are stored betwe By default the system temporary directory is used, but if this lies on drive with limited space, large captures could become a problem so here you can redirect the storage elsewhere. +--------------- + + | ``Default save directory for captures`` Default: ``Empty`` + +This allows you to choose which directory the save dialog will default to when prompting to save a capture file. By default the value is empty, which means that it follows the system behaviour (e.g. to begin on whichever folder was last browsed to in a file dialog). + +The folder must exist, it will not be created when browsed to. + --------------- | ``Allow global process hooking`` Default: ``Disabled`` diff --git a/renderdocui/Code/Core.cs b/renderdocui/Code/Core.cs index dce949284..5e8743eba 100644 --- a/renderdocui/Code/Core.cs +++ b/renderdocui/Code/Core.cs @@ -702,7 +702,7 @@ namespace renderdocui.Code public String TempLogFilename(String appname) { - string folder = Config.CaptureSavePath; + string folder = Config.TemporaryCaptureDirectory; try { if (folder.Length == 0 || !Directory.Exists(folder)) diff --git a/renderdocui/Code/PersistantConfig.cs b/renderdocui/Code/PersistantConfig.cs index 64263f760..6cfa59824 100644 --- a/renderdocui/Code/PersistantConfig.cs +++ b/renderdocui/Code/PersistantConfig.cs @@ -114,7 +114,10 @@ namespace renderdocui.Code public List RecentCaptureSettings = new List(); public int CallstackLevelSkip = 0; - public string CaptureSavePath = ""; + // for historical reasons, this was named CaptureSavePath + [XmlElement("CaptureSavePath")] + public string TemporaryCaptureDirectory = ""; + public string DefaultCaptureSaveDirectory = ""; public bool TextureViewer_ResetRange = false; public bool TextureViewer_PerTexSettings = true; diff --git a/renderdocui/Windows/Dialogs/SettingsDialog.Designer.cs b/renderdocui/Windows/Dialogs/SettingsDialog.Designer.cs index 93a25af42..0e8ff9388 100644 --- a/renderdocui/Windows/Dialogs/SettingsDialog.Designer.cs +++ b/renderdocui/Windows/Dialogs/SettingsDialog.Designer.cs @@ -32,6 +32,7 @@ System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; System.Windows.Forms.GroupBox groupBox1; System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + System.Windows.Forms.Label label20; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsDialog)); System.Windows.Forms.Label label13; System.Windows.Forms.Label label6; @@ -55,7 +56,7 @@ System.Windows.Forms.Label label9; System.Windows.Forms.Label label16; System.Windows.Forms.Label label17; - TreelistView.TreeListColumn treeListColumn1 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("Section", "Section"))); + TreelistView.TreeListColumn treeListColumn3 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("Section", "Section"))); this.ok = new System.Windows.Forms.Button(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.browserCaptureDialog = new System.Windows.Forms.FolderBrowserDialog(); @@ -69,9 +70,11 @@ this.Formatter_MaxFigures = new System.Windows.Forms.NumericUpDown(); this.Formatter_MinFigures = new System.Windows.Forms.NumericUpDown(); this.CheckUpdate_AllowChecks = new System.Windows.Forms.CheckBox(); - this.browseCaptureDirectory = new System.Windows.Forms.Button(); + this.browseTempCaptureDirectory = new System.Windows.Forms.Button(); this.Font_PreferMonospaced = new System.Windows.Forms.CheckBox(); this.AlwaysReplayLocally = new System.Windows.Forms.CheckBox(); + this.browseSaveCaptureDirectory = new System.Windows.Forms.Button(); + this.saveDirectory = new System.Windows.Forms.TextBox(); this.corePage = new System.Windows.Forms.TabPage(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.chooseSearchPaths = new System.Windows.Forms.Button(); @@ -90,9 +93,11 @@ this.EventBrowser_ApplyColours = new System.Windows.Forms.CheckBox(); this.EventBrowser_ColourEventRow = new System.Windows.Forms.CheckBox(); this.pagesTree = new TreelistView.TreeListView(); + this.tempDirectory = new System.Windows.Forms.TextBox(); tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); groupBox1 = new System.Windows.Forms.GroupBox(); tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + label20 = new System.Windows.Forms.Label(); label13 = new System.Windows.Forms.Label(); label6 = new System.Windows.Forms.Label(); label4 = new System.Windows.Forms.Label(); @@ -153,13 +158,13 @@ tableLayoutPanel1.RowCount = 2; tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - tableLayoutPanel1.Size = new System.Drawing.Size(580, 363); + tableLayoutPanel1.Size = new System.Drawing.Size(537, 451); tableLayoutPanel1.TabIndex = 1; // // ok // this.ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ok.Location = new System.Drawing.Point(502, 337); + this.ok.Location = new System.Drawing.Point(459, 425); this.ok.Name = "ok"; this.ok.Size = new System.Drawing.Size(75, 23); this.ok.TabIndex = 100; @@ -180,20 +185,20 @@ this.settingsTabs.Controls.Add(this.shadViewTab); this.settingsTabs.Controls.Add(this.eventTab); this.settingsTabs.Dock = System.Windows.Forms.DockStyle.Fill; - this.settingsTabs.Location = new System.Drawing.Point(177, 3); + this.settingsTabs.Location = new System.Drawing.Point(164, 3); this.settingsTabs.Multiline = true; this.settingsTabs.Name = "settingsTabs"; this.settingsTabs.SelectedIndex = 0; - this.settingsTabs.Size = new System.Drawing.Size(400, 328); + this.settingsTabs.Size = new System.Drawing.Size(370, 416); this.settingsTabs.TabIndex = 0; // // generalTab // this.generalTab.Controls.Add(groupBox1); - this.generalTab.Location = new System.Drawing.Point(42, 4); + this.generalTab.Location = new System.Drawing.Point(23, 4); this.generalTab.Name = "generalTab"; this.generalTab.Padding = new System.Windows.Forms.Padding(3); - this.generalTab.Size = new System.Drawing.Size(354, 320); + this.generalTab.Size = new System.Drawing.Size(343, 408); this.generalTab.TabIndex = 0; this.generalTab.Text = "General"; this.generalTab.UseVisualStyleBackColor = true; @@ -204,7 +209,7 @@ groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; groupBox1.Location = new System.Drawing.Point(3, 3); groupBox1.Name = "groupBox1"; - groupBox1.Size = new System.Drawing.Size(348, 314); + groupBox1.Size = new System.Drawing.Size(337, 402); groupBox1.TabIndex = 0; groupBox1.TabStop = false; groupBox1.Text = "General"; @@ -214,8 +219,9 @@ tableLayoutPanel2.ColumnCount = 2; tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - tableLayoutPanel2.Controls.Add(this.AllowGlobalHook, 1, 7); - tableLayoutPanel2.Controls.Add(label13, 0, 7); + tableLayoutPanel2.Controls.Add(label20, 0, 8); + tableLayoutPanel2.Controls.Add(this.AllowGlobalHook, 1, 10); + tableLayoutPanel2.Controls.Add(label13, 0, 10); tableLayoutPanel2.Controls.Add(this.Formatter_PosExp, 1, 5); tableLayoutPanel2.Controls.Add(this.Formatter_NegExp, 1, 4); tableLayoutPanel2.Controls.Add(label6, 0, 3); @@ -228,18 +234,24 @@ tableLayoutPanel2.Controls.Add(label7, 0, 5); tableLayoutPanel2.Controls.Add(this.Formatter_MaxFigures, 1, 3); tableLayoutPanel2.Controls.Add(this.Formatter_MinFigures, 1, 2); - tableLayoutPanel2.Controls.Add(label3, 0, 8); - tableLayoutPanel2.Controls.Add(this.CheckUpdate_AllowChecks, 1, 8); + tableLayoutPanel2.Controls.Add(label3, 0, 11); + tableLayoutPanel2.Controls.Add(this.CheckUpdate_AllowChecks, 1, 11); + tableLayoutPanel2.Controls.Add(this.browseTempCaptureDirectory, 1, 7); + tableLayoutPanel2.Controls.Add(label15, 0, 12); + tableLayoutPanel2.Controls.Add(this.Font_PreferMonospaced, 1, 12); + tableLayoutPanel2.Controls.Add(label18, 0, 13); + tableLayoutPanel2.Controls.Add(this.AlwaysReplayLocally, 1, 13); + tableLayoutPanel2.Controls.Add(this.browseSaveCaptureDirectory, 1, 9); + tableLayoutPanel2.Controls.Add(this.saveDirectory, 0, 9); tableLayoutPanel2.Controls.Add(label11, 0, 6); - tableLayoutPanel2.Controls.Add(this.browseCaptureDirectory, 1, 6); - tableLayoutPanel2.Controls.Add(label15, 0, 9); - tableLayoutPanel2.Controls.Add(this.Font_PreferMonospaced, 1, 9); - tableLayoutPanel2.Controls.Add(label18, 0, 10); - tableLayoutPanel2.Controls.Add(this.AlwaysReplayLocally, 1, 10); + tableLayoutPanel2.Controls.Add(this.tempDirectory, 0, 7); tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); tableLayoutPanel2.Name = "tableLayoutPanel2"; - tableLayoutPanel2.RowCount = 12; + tableLayoutPanel2.RowCount = 15; + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -252,15 +264,31 @@ tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - tableLayoutPanel2.Size = new System.Drawing.Size(342, 295); + tableLayoutPanel2.Size = new System.Drawing.Size(331, 383); tableLayoutPanel2.TabIndex = 0; + // + // label20 + // + label20.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + label20.AutoSize = true; + label20.Location = new System.Drawing.Point(3, 211); + label20.MinimumSize = new System.Drawing.Size(0, 20); + label20.Name = "label20"; + label20.Size = new System.Drawing.Size(229, 20); + label20.TabIndex = 21; + label20.Text = "Default save directory for captures"; + label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.toolTip.SetToolTip(label20, "Changes the default directory for the save dialog when saving capture files.\r\n\r\nD" + + "efaults to blank, which follows system default behaviour."); // // AllowGlobalHook // this.AllowGlobalHook.AutoSize = true; this.AllowGlobalHook.Checked = true; this.AllowGlobalHook.CheckState = System.Windows.Forms.CheckState.Checked; - this.AllowGlobalHook.Location = new System.Drawing.Point(249, 194); + this.AllowGlobalHook.Location = new System.Drawing.Point(238, 263); this.AllowGlobalHook.Name = "AllowGlobalHook"; this.AllowGlobalHook.Size = new System.Drawing.Size(15, 14); this.AllowGlobalHook.TabIndex = 16; @@ -274,9 +302,9 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); label13.AutoSize = true; - label13.Location = new System.Drawing.Point(3, 191); + label13.Location = new System.Drawing.Point(3, 260); label13.Name = "label13"; - label13.Size = new System.Drawing.Size(240, 20); + label13.Size = new System.Drawing.Size(229, 20); label13.TabIndex = 15; label13.Text = "Allow global process hooking - be careful!"; label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -284,7 +312,7 @@ // // Formatter_PosExp // - this.Formatter_PosExp.Location = new System.Drawing.Point(249, 139); + this.Formatter_PosExp.Location = new System.Drawing.Point(238, 139); this.Formatter_PosExp.Maximum = new decimal(new int[] { 20, 0, @@ -304,7 +332,7 @@ // // Formatter_NegExp // - this.Formatter_NegExp.Location = new System.Drawing.Point(249, 113); + this.Formatter_NegExp.Location = new System.Drawing.Point(238, 113); this.Formatter_NegExp.Maximum = new decimal(new int[] { 20, 0, @@ -331,7 +359,7 @@ label6.Location = new System.Drawing.Point(3, 87); label6.Margin = new System.Windows.Forms.Padding(3); label6.Name = "label6"; - label6.Size = new System.Drawing.Size(240, 20); + label6.Size = new System.Drawing.Size(229, 20); label6.TabIndex = 6; label6.Text = "Maximum significant figures on decimals"; label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -347,7 +375,7 @@ label4.Location = new System.Drawing.Point(3, 61); label4.Margin = new System.Windows.Forms.Padding(3); label4.Name = "label4"; - label4.Size = new System.Drawing.Size(240, 20); + label4.Size = new System.Drawing.Size(229, 20); label4.TabIndex = 4; label4.Text = "Minimum decimal places on float values"; label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -357,7 +385,7 @@ // rdcAssoc // this.rdcAssoc.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.rdcAssoc.Location = new System.Drawing.Point(249, 3); + this.rdcAssoc.Location = new System.Drawing.Point(238, 3); this.rdcAssoc.Name = "rdcAssoc"; this.rdcAssoc.Size = new System.Drawing.Size(90, 23); this.rdcAssoc.TabIndex = 1; @@ -374,7 +402,7 @@ label1.Location = new System.Drawing.Point(3, 3); label1.Margin = new System.Windows.Forms.Padding(3); label1.Name = "label1"; - label1.Size = new System.Drawing.Size(240, 23); + label1.Size = new System.Drawing.Size(229, 23); label1.TabIndex = 0; label1.Text = "Associate .rdc with RenderDoc"; label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -388,7 +416,7 @@ label2.Location = new System.Drawing.Point(3, 32); label2.Margin = new System.Windows.Forms.Padding(3); label2.Name = "label2"; - label2.Size = new System.Drawing.Size(240, 23); + label2.Size = new System.Drawing.Size(229, 23); label2.TabIndex = 2; label2.Text = "Associate .cap with RenderDoc"; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -396,7 +424,7 @@ // capAssoc // this.capAssoc.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.capAssoc.Location = new System.Drawing.Point(249, 32); + this.capAssoc.Location = new System.Drawing.Point(238, 32); this.capAssoc.Name = "capAssoc"; this.capAssoc.Size = new System.Drawing.Size(90, 23); this.capAssoc.TabIndex = 2; @@ -413,7 +441,7 @@ label5.Location = new System.Drawing.Point(3, 113); label5.Margin = new System.Windows.Forms.Padding(3); label5.Name = "label5"; - label5.Size = new System.Drawing.Size(240, 20); + label5.Size = new System.Drawing.Size(229, 20); label5.TabIndex = 5; label5.Text = "Negative exponential cutoff value"; label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -429,7 +457,7 @@ label7.Location = new System.Drawing.Point(3, 139); label7.Margin = new System.Windows.Forms.Padding(3); label7.Name = "label7"; - label7.Size = new System.Drawing.Size(240, 20); + label7.Size = new System.Drawing.Size(229, 20); label7.TabIndex = 7; label7.Text = "Positive exponential cutoff value"; label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -438,7 +466,7 @@ // // Formatter_MaxFigures // - this.Formatter_MaxFigures.Location = new System.Drawing.Point(249, 87); + this.Formatter_MaxFigures.Location = new System.Drawing.Point(238, 87); this.Formatter_MaxFigures.Maximum = new decimal(new int[] { 29, 0, @@ -464,7 +492,7 @@ // Formatter_MinFigures // this.Formatter_MinFigures.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.Formatter_MinFigures.Location = new System.Drawing.Point(249, 61); + this.Formatter_MinFigures.Location = new System.Drawing.Point(238, 61); this.Formatter_MinFigures.Maximum = new decimal(new int[] { 29, 0, @@ -488,9 +516,9 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); label3.AutoSize = true; - label3.Location = new System.Drawing.Point(3, 211); + label3.Location = new System.Drawing.Point(3, 280); label3.Name = "label3"; - label3.Size = new System.Drawing.Size(240, 20); + label3.Size = new System.Drawing.Size(229, 20); label3.TabIndex = 12; label3.Text = "Allow periodic anonymous update checks"; label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -502,7 +530,7 @@ this.CheckUpdate_AllowChecks.AutoSize = true; this.CheckUpdate_AllowChecks.Checked = true; this.CheckUpdate_AllowChecks.CheckState = System.Windows.Forms.CheckState.Checked; - this.CheckUpdate_AllowChecks.Location = new System.Drawing.Point(249, 214); + this.CheckUpdate_AllowChecks.Location = new System.Drawing.Point(238, 283); this.CheckUpdate_AllowChecks.Name = "CheckUpdate_AllowChecks"; this.CheckUpdate_AllowChecks.Size = new System.Drawing.Size(15, 14); this.CheckUpdate_AllowChecks.TabIndex = 8; @@ -518,26 +546,27 @@ | System.Windows.Forms.AnchorStyles.Right))); label11.AutoSize = true; label11.Location = new System.Drawing.Point(3, 162); + label11.MinimumSize = new System.Drawing.Size(0, 20); label11.Name = "label11"; - label11.Size = new System.Drawing.Size(240, 29); + label11.Size = new System.Drawing.Size(229, 20); label11.TabIndex = 14; label11.Text = "Directory for temporary capture files"; label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.toolTip.SetToolTip(label11, "Changes the directory where capture files are saved after being created, until sa" + "ved manually or deleted.\r\n\r\nDefaults to %TEMP%."); // - // browseCaptureDirectory + // browseTempCaptureDirectory // - this.browseCaptureDirectory.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.browseCaptureDirectory.Location = new System.Drawing.Point(249, 165); - this.browseCaptureDirectory.Name = "browseCaptureDirectory"; - this.browseCaptureDirectory.Size = new System.Drawing.Size(90, 23); - this.browseCaptureDirectory.TabIndex = 7; - this.browseCaptureDirectory.Text = "Browse"; - this.toolTip.SetToolTip(this.browseCaptureDirectory, "Changes the directory where capture files are saved after being created, until sa" + + this.browseTempCaptureDirectory.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.browseTempCaptureDirectory.Location = new System.Drawing.Point(238, 185); + this.browseTempCaptureDirectory.Name = "browseTempCaptureDirectory"; + this.browseTempCaptureDirectory.Size = new System.Drawing.Size(90, 23); + this.browseTempCaptureDirectory.TabIndex = 7; + this.browseTempCaptureDirectory.Text = "Browse"; + this.toolTip.SetToolTip(this.browseTempCaptureDirectory, "Changes the directory where capture files are saved after being created, until sa" + "ved manually or deleted.\r\n\r\nDefaults to %TEMP%."); - this.browseCaptureDirectory.UseVisualStyleBackColor = true; - this.browseCaptureDirectory.Click += new System.EventHandler(this.browseCaptureDirectory_Click); + this.browseTempCaptureDirectory.UseVisualStyleBackColor = true; + this.browseTempCaptureDirectory.Click += new System.EventHandler(this.browseTempCaptureDirectory_Click); // // label15 // @@ -545,9 +574,9 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); label15.AutoSize = true; - label15.Location = new System.Drawing.Point(3, 231); + label15.Location = new System.Drawing.Point(3, 300); label15.Name = "label15"; - label15.Size = new System.Drawing.Size(240, 20); + label15.Size = new System.Drawing.Size(229, 20); label15.TabIndex = 17; label15.Text = "Prefer monospaced fonts in UI (restart required)"; label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -558,7 +587,7 @@ this.Font_PreferMonospaced.AutoSize = true; this.Font_PreferMonospaced.Checked = true; this.Font_PreferMonospaced.CheckState = System.Windows.Forms.CheckState.Checked; - this.Font_PreferMonospaced.Location = new System.Drawing.Point(249, 234); + this.Font_PreferMonospaced.Location = new System.Drawing.Point(238, 303); this.Font_PreferMonospaced.Name = "Font_PreferMonospaced"; this.Font_PreferMonospaced.Size = new System.Drawing.Size(15, 14); this.Font_PreferMonospaced.TabIndex = 18; @@ -572,9 +601,9 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); label18.AutoSize = true; - label18.Location = new System.Drawing.Point(3, 251); + label18.Location = new System.Drawing.Point(3, 320); label18.Name = "label18"; - label18.Size = new System.Drawing.Size(240, 20); + label18.Size = new System.Drawing.Size(229, 26); label18.TabIndex = 19; label18.Text = "Always replay logs locally, never prompt about it"; label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -585,7 +614,7 @@ this.AlwaysReplayLocally.AutoSize = true; this.AlwaysReplayLocally.Checked = true; this.AlwaysReplayLocally.CheckState = System.Windows.Forms.CheckState.Checked; - this.AlwaysReplayLocally.Location = new System.Drawing.Point(249, 254); + this.AlwaysReplayLocally.Location = new System.Drawing.Point(238, 323); this.AlwaysReplayLocally.Name = "AlwaysReplayLocally"; this.AlwaysReplayLocally.Size = new System.Drawing.Size(15, 14); this.AlwaysReplayLocally.TabIndex = 20; @@ -593,13 +622,38 @@ this.AlwaysReplayLocally.UseVisualStyleBackColor = true; this.AlwaysReplayLocally.CheckedChanged += new System.EventHandler(this.AlwaysReplayLocally_CheckedChanged); // + // browseSaveCaptureDirectory + // + this.browseSaveCaptureDirectory.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.browseSaveCaptureDirectory.Location = new System.Drawing.Point(238, 234); + this.browseSaveCaptureDirectory.Name = "browseSaveCaptureDirectory"; + this.browseSaveCaptureDirectory.Size = new System.Drawing.Size(90, 23); + this.browseSaveCaptureDirectory.TabIndex = 22; + this.browseSaveCaptureDirectory.Text = "Browse"; + this.toolTip.SetToolTip(this.browseSaveCaptureDirectory, "Changes the default directory for the save dialog when saving capture files.\r\n\r\nD" + + "efaults to blank, which follows system default behaviour.\r\n"); + this.browseSaveCaptureDirectory.UseVisualStyleBackColor = true; + this.browseSaveCaptureDirectory.Click += new System.EventHandler(this.browseSaveCaptureDirectory_Click); + // + // saveDirectory + // + this.saveDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.saveDirectory.Location = new System.Drawing.Point(3, 234); + this.saveDirectory.Name = "saveDirectory"; + this.saveDirectory.Size = new System.Drawing.Size(229, 20); + this.saveDirectory.TabIndex = 23; + this.toolTip.SetToolTip(this.saveDirectory, "Changes the default directory for the save dialog when saving capture files.\r\n\r\nD" + + "efaults to blank, which follows system default behaviour."); + this.saveDirectory.TextChanged += new System.EventHandler(this.saveDirectory_TextChanged); + // // corePage // this.corePage.Controls.Add(this.groupBox5); - this.corePage.Location = new System.Drawing.Point(42, 4); + this.corePage.Location = new System.Drawing.Point(23, 4); this.corePage.Name = "corePage"; this.corePage.Padding = new System.Windows.Forms.Padding(3); - this.corePage.Size = new System.Drawing.Size(354, 320); + this.corePage.Size = new System.Drawing.Size(343, 408); this.corePage.TabIndex = 4; this.corePage.Text = "Core"; this.corePage.UseVisualStyleBackColor = true; @@ -610,7 +664,7 @@ this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox5.Location = new System.Drawing.Point(3, 3); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(348, 314); + this.groupBox5.Size = new System.Drawing.Size(337, 402); this.groupBox5.TabIndex = 0; this.groupBox5.TabStop = false; this.groupBox5.Text = "Core"; @@ -637,13 +691,13 @@ tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - tableLayoutPanel6.Size = new System.Drawing.Size(342, 295); + tableLayoutPanel6.Size = new System.Drawing.Size(331, 383); tableLayoutPanel6.TabIndex = 1; // // chooseSearchPaths // this.chooseSearchPaths.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.chooseSearchPaths.Location = new System.Drawing.Point(249, 3); + this.chooseSearchPaths.Location = new System.Drawing.Point(238, 3); this.chooseSearchPaths.Name = "chooseSearchPaths"; this.chooseSearchPaths.Size = new System.Drawing.Size(90, 23); this.chooseSearchPaths.TabIndex = 1; @@ -660,7 +714,7 @@ label19.Location = new System.Drawing.Point(3, 3); label19.Margin = new System.Windows.Forms.Padding(3); label19.Name = "label19"; - label19.Size = new System.Drawing.Size(240, 23); + label19.Size = new System.Drawing.Size(229, 23); label19.TabIndex = 0; label19.Text = "Shader debug search paths"; label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -668,10 +722,10 @@ // texViewTab // this.texViewTab.Controls.Add(groupBox2); - this.texViewTab.Location = new System.Drawing.Point(42, 4); + this.texViewTab.Location = new System.Drawing.Point(23, 4); this.texViewTab.Name = "texViewTab"; this.texViewTab.Padding = new System.Windows.Forms.Padding(3); - this.texViewTab.Size = new System.Drawing.Size(354, 320); + this.texViewTab.Size = new System.Drawing.Size(343, 408); this.texViewTab.TabIndex = 1; this.texViewTab.Text = "Texture Viewer"; this.texViewTab.UseVisualStyleBackColor = true; @@ -682,7 +736,7 @@ groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; groupBox2.Location = new System.Drawing.Point(3, 3); groupBox2.Name = "groupBox2"; - groupBox2.Size = new System.Drawing.Size(348, 314); + groupBox2.Size = new System.Drawing.Size(337, 402); groupBox2.TabIndex = 0; groupBox2.TabStop = false; groupBox2.Text = "Texture Viewer"; @@ -703,16 +757,16 @@ this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(342, 295); + this.tableLayoutPanel3.Size = new System.Drawing.Size(331, 383); this.tableLayoutPanel3.TabIndex = 0; // // TextureViewer_ResetRange // this.TextureViewer_ResetRange.AutoSize = true; this.TextureViewer_ResetRange.Dock = System.Windows.Forms.DockStyle.Fill; - this.TextureViewer_ResetRange.Location = new System.Drawing.Point(276, 3); + this.TextureViewer_ResetRange.Location = new System.Drawing.Point(267, 3); this.TextureViewer_ResetRange.Name = "TextureViewer_ResetRange"; - this.TextureViewer_ResetRange.Size = new System.Drawing.Size(63, 14); + this.TextureViewer_ResetRange.Size = new System.Drawing.Size(61, 14); this.TextureViewer_ResetRange.TabIndex = 20; this.toolTip.SetToolTip(this.TextureViewer_ResetRange, "Reset visible range when changing event or texture"); this.TextureViewer_ResetRange.UseVisualStyleBackColor = true; @@ -722,9 +776,9 @@ // this.TextureViewer_PerTexSettings.AutoSize = true; this.TextureViewer_PerTexSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.TextureViewer_PerTexSettings.Location = new System.Drawing.Point(276, 23); + this.TextureViewer_PerTexSettings.Location = new System.Drawing.Point(267, 23); this.TextureViewer_PerTexSettings.Name = "TextureViewer_PerTexSettings"; - this.TextureViewer_PerTexSettings.Size = new System.Drawing.Size(63, 14); + this.TextureViewer_PerTexSettings.Size = new System.Drawing.Size(61, 14); this.TextureViewer_PerTexSettings.TabIndex = 20; this.toolTip.SetToolTip(this.TextureViewer_PerTexSettings, "The visible channels (RGBA) and selected mip/slice are remembered and restored pe" + "r-texture."); @@ -740,7 +794,7 @@ label10.Location = new System.Drawing.Point(3, 3); label10.Margin = new System.Windows.Forms.Padding(3); label10.Name = "label10"; - label10.Size = new System.Drawing.Size(267, 14); + label10.Size = new System.Drawing.Size(258, 14); label10.TabIndex = 4; label10.Text = "Reset Range on changing selection"; label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -754,7 +808,7 @@ this.label14.Location = new System.Drawing.Point(3, 23); this.label14.Margin = new System.Windows.Forms.Padding(3); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(267, 14); + this.label14.Size = new System.Drawing.Size(258, 14); this.label14.TabIndex = 4; this.label14.Text = "Visible channels && mip/slice saved per-texture"; this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -762,10 +816,10 @@ // shadViewTab // this.shadViewTab.Controls.Add(groupBox3); - this.shadViewTab.Location = new System.Drawing.Point(42, 4); + this.shadViewTab.Location = new System.Drawing.Point(23, 4); this.shadViewTab.Name = "shadViewTab"; this.shadViewTab.Padding = new System.Windows.Forms.Padding(3); - this.shadViewTab.Size = new System.Drawing.Size(354, 320); + this.shadViewTab.Size = new System.Drawing.Size(343, 408); this.shadViewTab.TabIndex = 2; this.shadViewTab.Text = "Shader Viewer"; this.shadViewTab.UseVisualStyleBackColor = true; @@ -776,7 +830,7 @@ groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; groupBox3.Location = new System.Drawing.Point(3, 3); groupBox3.Name = "groupBox3"; - groupBox3.Size = new System.Drawing.Size(348, 314); + groupBox3.Size = new System.Drawing.Size(337, 402); groupBox3.TabIndex = 0; groupBox3.TabStop = false; groupBox3.Text = "Shader Viewer"; @@ -794,13 +848,13 @@ this.tableLayoutPanel4.RowCount = 2; this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(342, 295); + this.tableLayoutPanel4.Size = new System.Drawing.Size(331, 383); this.tableLayoutPanel4.TabIndex = 1; // // ShaderViewer_FriendlyNaming // this.ShaderViewer_FriendlyNaming.AutoSize = true; - this.ShaderViewer_FriendlyNaming.Location = new System.Drawing.Point(276, 3); + this.ShaderViewer_FriendlyNaming.Location = new System.Drawing.Point(267, 3); this.ShaderViewer_FriendlyNaming.Name = "ShaderViewer_FriendlyNaming"; this.ShaderViewer_FriendlyNaming.Size = new System.Drawing.Size(15, 14); this.ShaderViewer_FriendlyNaming.TabIndex = 40; @@ -818,7 +872,7 @@ label12.Location = new System.Drawing.Point(3, 3); label12.Margin = new System.Windows.Forms.Padding(3); label12.Name = "label12"; - label12.Size = new System.Drawing.Size(267, 14); + label12.Size = new System.Drawing.Size(258, 14); label12.TabIndex = 6; label12.Text = "Rename disassembly registers"; label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -826,10 +880,10 @@ // eventTab // this.eventTab.Controls.Add(groupBox4); - this.eventTab.Location = new System.Drawing.Point(42, 4); + this.eventTab.Location = new System.Drawing.Point(23, 4); this.eventTab.Name = "eventTab"; this.eventTab.Padding = new System.Windows.Forms.Padding(3); - this.eventTab.Size = new System.Drawing.Size(354, 320); + this.eventTab.Size = new System.Drawing.Size(343, 408); this.eventTab.TabIndex = 3; this.eventTab.Text = "Event Browser"; this.eventTab.UseVisualStyleBackColor = true; @@ -840,7 +894,7 @@ groupBox4.Dock = System.Windows.Forms.DockStyle.Fill; groupBox4.Location = new System.Drawing.Point(3, 3); groupBox4.Name = "groupBox4"; - groupBox4.Size = new System.Drawing.Size(348, 314); + groupBox4.Size = new System.Drawing.Size(337, 402); groupBox4.TabIndex = 1; groupBox4.TabStop = false; groupBox4.Text = "Event Browser"; @@ -867,7 +921,7 @@ this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(342, 295); + this.tableLayoutPanel5.Size = new System.Drawing.Size(331, 383); this.tableLayoutPanel5.TabIndex = 0; // // label8 @@ -879,7 +933,7 @@ label8.Location = new System.Drawing.Point(3, 3); label8.Margin = new System.Windows.Forms.Padding(3); label8.Name = "label8"; - label8.Size = new System.Drawing.Size(267, 21); + label8.Size = new System.Drawing.Size(258, 21); label8.TabIndex = 3; label8.Text = "Time unit used for event browser timings"; label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -888,9 +942,9 @@ // this.EventBrowser_TimeUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.EventBrowser_TimeUnit.FormattingEnabled = true; - this.EventBrowser_TimeUnit.Location = new System.Drawing.Point(276, 3); + this.EventBrowser_TimeUnit.Location = new System.Drawing.Point(267, 3); this.EventBrowser_TimeUnit.Name = "EventBrowser_TimeUnit"; - this.EventBrowser_TimeUnit.Size = new System.Drawing.Size(63, 21); + this.EventBrowser_TimeUnit.Size = new System.Drawing.Size(61, 21); this.EventBrowser_TimeUnit.TabIndex = 50; this.toolTip.SetToolTip(this.EventBrowser_TimeUnit, "The time unit to use when displaying the duration column in the event browser"); this.EventBrowser_TimeUnit.SelectionChangeCommitted += new System.EventHandler(this.EventBrowser_TimeUnit_SelectionChangeCommitted); @@ -904,7 +958,7 @@ label9.Location = new System.Drawing.Point(3, 30); label9.Margin = new System.Windows.Forms.Padding(3); label9.Name = "label9"; - label9.Size = new System.Drawing.Size(267, 14); + label9.Size = new System.Drawing.Size(258, 14); label9.TabIndex = 7; label9.Text = "Hide empty marker sections (requires log reload)"; label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -912,7 +966,7 @@ // EventBrowser_HideEmpty // this.EventBrowser_HideEmpty.AutoSize = true; - this.EventBrowser_HideEmpty.Location = new System.Drawing.Point(276, 30); + this.EventBrowser_HideEmpty.Location = new System.Drawing.Point(267, 30); this.EventBrowser_HideEmpty.Name = "EventBrowser_HideEmpty"; this.EventBrowser_HideEmpty.Size = new System.Drawing.Size(15, 14); this.EventBrowser_HideEmpty.TabIndex = 51; @@ -930,7 +984,7 @@ label16.Location = new System.Drawing.Point(3, 50); label16.Margin = new System.Windows.Forms.Padding(3); label16.Name = "label16"; - label16.Size = new System.Drawing.Size(267, 14); + label16.Size = new System.Drawing.Size(258, 14); label16.TabIndex = 52; label16.Text = "Apply marker colours (requires log reload)"; label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -945,7 +999,7 @@ label17.Margin = new System.Windows.Forms.Padding(3); label17.Name = "label17"; label17.Padding = new System.Windows.Forms.Padding(15, 0, 0, 0); - label17.Size = new System.Drawing.Size(267, 14); + label17.Size = new System.Drawing.Size(258, 14); label17.TabIndex = 53; label17.Text = "- Colourise whole row for marker regions"; label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -953,7 +1007,7 @@ // EventBrowser_ApplyColours // this.EventBrowser_ApplyColours.AutoSize = true; - this.EventBrowser_ApplyColours.Location = new System.Drawing.Point(276, 50); + this.EventBrowser_ApplyColours.Location = new System.Drawing.Point(267, 50); this.EventBrowser_ApplyColours.Name = "EventBrowser_ApplyColours"; this.EventBrowser_ApplyColours.Size = new System.Drawing.Size(15, 14); this.EventBrowser_ApplyColours.TabIndex = 54; @@ -965,7 +1019,7 @@ // EventBrowser_ColourEventRow // this.EventBrowser_ColourEventRow.AutoSize = true; - this.EventBrowser_ColourEventRow.Location = new System.Drawing.Point(276, 70); + this.EventBrowser_ColourEventRow.Location = new System.Drawing.Point(267, 70); this.EventBrowser_ColourEventRow.Name = "EventBrowser_ColourEventRow"; this.EventBrowser_ColourEventRow.Size = new System.Drawing.Size(15, 14); this.EventBrowser_ColourEventRow.TabIndex = 55; @@ -976,11 +1030,11 @@ // // pagesTree // - treeListColumn1.AutoSize = true; - treeListColumn1.AutoSizeMinSize = 0; - treeListColumn1.Width = 50; + treeListColumn3.AutoSize = true; + treeListColumn3.AutoSizeMinSize = 0; + treeListColumn3.Width = 50; this.pagesTree.Columns.AddRange(new TreelistView.TreeListColumn[] { - treeListColumn1}); + treeListColumn3}); this.pagesTree.ColumnsOptions.HeaderHeight = 1; this.pagesTree.Cursor = System.Windows.Forms.Cursors.Arrow; this.pagesTree.Dock = System.Windows.Forms.DockStyle.Fill; @@ -988,18 +1042,30 @@ this.pagesTree.MultiSelect = false; this.pagesTree.Name = "pagesTree"; this.pagesTree.RowOptions.ShowHeader = false; - this.pagesTree.Size = new System.Drawing.Size(168, 328); + this.pagesTree.Size = new System.Drawing.Size(155, 416); this.pagesTree.TabIndex = 0; this.pagesTree.ViewOptions.ShowGridLines = false; this.pagesTree.ViewOptions.ShowLine = false; this.pagesTree.ViewOptions.ShowPlusMinus = false; this.pagesTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.pagesTree_AfterSelect); // + // tempDirectory + // + this.tempDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tempDirectory.Location = new System.Drawing.Point(3, 185); + this.tempDirectory.Name = "tempDirectory"; + this.tempDirectory.Size = new System.Drawing.Size(229, 20); + this.tempDirectory.TabIndex = 24; + this.toolTip.SetToolTip(this.tempDirectory, "Changes the directory where capture files are saved after being created, until sa" + + "ved manually or deleted.\r\n\r\nDefaults to %TEMP%."); + this.tempDirectory.TextChanged += new System.EventHandler(this.tempDirectory_TextChanged); + // // SettingsDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(580, 363); + this.ClientSize = new System.Drawing.Size(537, 451); this.Controls.Add(tableLayoutPanel1); this.MinimumSize = new System.Drawing.Size(500, 300); this.Name = "SettingsDialog"; @@ -1061,7 +1127,7 @@ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; private System.Windows.Forms.ComboBox EventBrowser_TimeUnit; private System.Windows.Forms.CheckBox EventBrowser_HideEmpty; - private System.Windows.Forms.Button browseCaptureDirectory; + private System.Windows.Forms.Button browseTempCaptureDirectory; private System.Windows.Forms.FolderBrowserDialog browserCaptureDialog; private System.Windows.Forms.CheckBox AllowGlobalHook; private System.Windows.Forms.CheckBox Font_PreferMonospaced; @@ -1072,5 +1138,8 @@ private System.Windows.Forms.CheckBox EventBrowser_ApplyColours; private System.Windows.Forms.CheckBox EventBrowser_ColourEventRow; private System.Windows.Forms.CheckBox AlwaysReplayLocally; + private System.Windows.Forms.Button browseSaveCaptureDirectory; + private System.Windows.Forms.TextBox saveDirectory; + private System.Windows.Forms.TextBox tempDirectory; } } \ No newline at end of file diff --git a/renderdocui/Windows/Dialogs/SettingsDialog.cs b/renderdocui/Windows/Dialogs/SettingsDialog.cs index a7e1bf5d6..b98361c0e 100644 --- a/renderdocui/Windows/Dialogs/SettingsDialog.cs +++ b/renderdocui/Windows/Dialogs/SettingsDialog.cs @@ -58,6 +58,9 @@ namespace renderdocui.Windows.Dialogs pagesTree.EndUpdate(); pagesTree.FocusedNode = pagesTree.Nodes[0]; + saveDirectory.Text = m_Core.Config.DefaultCaptureSaveDirectory; + tempDirectory.Text = m_Core.Config.TemporaryCaptureDirectory; + TextureViewer_ResetRange.Checked = m_Core.Config.TextureViewer_ResetRange; TextureViewer_PerTexSettings.Checked = m_Core.Config.TextureViewer_PerTexSettings; ShaderViewer_FriendlyNaming.Checked = m_Core.Config.ShaderViewer_FriendlyNaming; @@ -218,14 +221,36 @@ namespace renderdocui.Windows.Dialogs m_Core.Config.Serialize(Core.ConfigFilename); } - private void browseCaptureDirectory_Click(object sender, EventArgs e) + private void tempDirectory_TextChanged(object sender, EventArgs e) { try { - if (Directory.Exists(m_Core.Config.CaptureSavePath)) - browserCaptureDialog.SelectedPath = m_Core.Config.CaptureSavePath; + if (Directory.Exists(tempDirectory.Text)) + m_Core.Config.TemporaryCaptureDirectory = tempDirectory.Text; else - browserCaptureDialog.SelectedPath = Path.GetTempPath(); + m_Core.Config.TemporaryCaptureDirectory = ""; + + m_Core.Config.Serialize(Core.ConfigFilename); + } + catch (Exception) + { + } + } + + private void browseTempCaptureDirectory_Click(object sender, EventArgs e) + { + try + { + try + { + if (Directory.Exists(m_Core.Config.TemporaryCaptureDirectory)) + browserCaptureDialog.SelectedPath = m_Core.Config.TemporaryCaptureDirectory; + else + browserCaptureDialog.SelectedPath = Path.GetTempPath(); + } + catch (Exception) + { + } } catch (ArgumentException) { @@ -236,7 +261,66 @@ namespace renderdocui.Windows.Dialogs if (res == DialogResult.Yes || res == DialogResult.OK) { - m_Core.Config.CaptureSavePath = browserCaptureDialog.SelectedPath; + try + { + m_Core.Config.TemporaryCaptureDirectory = browserCaptureDialog.SelectedPath; + + m_Core.Config.Serialize(Core.ConfigFilename); + } + catch (Exception) + { + } + } + } + + private void saveDirectory_TextChanged(object sender, EventArgs e) + { + try + { + if (Directory.Exists(saveDirectory.Text)) + m_Core.Config.DefaultCaptureSaveDirectory = saveDirectory.Text; + + m_Core.Config.Serialize(Core.ConfigFilename); + } + catch (Exception) + { + } + } + + private void browseSaveCaptureDirectory_Click(object sender, EventArgs e) + { + try + { + try + { + if (Directory.Exists(m_Core.Config.DefaultCaptureSaveDirectory)) + browserCaptureDialog.SelectedPath = m_Core.Config.DefaultCaptureSaveDirectory; + else + browserCaptureDialog.SelectedPath = ""; + } + catch (Exception) + { + } + } + catch (ArgumentException) + { + // invalid path or similar + } + + var res = browserCaptureDialog.ShowDialog(); + + if (res == DialogResult.Yes || res == DialogResult.OK) + { + try + { + m_Core.Config.DefaultCaptureSaveDirectory = browserCaptureDialog.SelectedPath; + saveDirectory.Text = browserCaptureDialog.SelectedPath; + + m_Core.Config.Serialize(Core.ConfigFilename); + } + catch (Exception) + { + } } } diff --git a/renderdocui/Windows/Dialogs/SettingsDialog.resx b/renderdocui/Windows/Dialogs/SettingsDialog.resx index 18a272209..3f198e3a7 100644 --- a/renderdocui/Windows/Dialogs/SettingsDialog.resx +++ b/renderdocui/Windows/Dialogs/SettingsDialog.resx @@ -126,6 +126,9 @@ False + + False + 17, 17 @@ -170,9 +173,6 @@ Since this is a global system hook it must be used carefully and only when neces False - - False - False @@ -191,9 +191,30 @@ as is currently running, then by default the UI will prompt to ask if you want t This option overrides that and will always replay locally if the local context is selected. + + False + + + False + + + False + + + False + + + 102, 17 + False + + False + + + False + False @@ -203,12 +224,18 @@ This option overrides that and will always replay locally if the local context i False + + False + False False + + False + False @@ -224,7 +251,16 @@ This option overrides that and will always replay locally if the local context i False - - 102, 17 + + False + + + False + + + False + + + False \ No newline at end of file diff --git a/renderdocui/Windows/MainWindow.cs b/renderdocui/Windows/MainWindow.cs index 4f5b079a8..e6c7984b1 100644 --- a/renderdocui/Windows/MainWindow.cs +++ b/renderdocui/Windows/MainWindow.cs @@ -1515,6 +1515,14 @@ namespace renderdocui.Windows private bool PromptSaveLog() { + try + { + saveDialog.InitialDirectory = m_Core.Config.DefaultCaptureSaveDirectory; + } + catch (Exception) + { + } + DialogResult res = saveDialog.ShowDialog(); if (res == DialogResult.OK)