Compare commits

..

19 Commits

Author SHA1 Message Date
emoose
ecbc27200a Settings: move smooth motion flip metering to Extra 2025-07-27 19:44:30 +01:00
emoose
06559a5512 Form: add search/filter textbox above setting list, improve high-DPI
frmDrvSettings AutoScaleDimensions changed to improve high DPI displays
2025-07-27 19:40:39 +01:00
emoose
04202e43c7 Reference: re-add pre-526.47 TILEDCACHE 2025-07-27 19:39:02 +01:00
emoose
cde038f53b Settings: correct TILEDCACHE setting ID for later drivers, add TILESIZE and VK settings
Thanks to Guzz on guru3d for pointing them out!
2025-07-26 18:18:30 +01:00
emoose
1980707c13 Settings: move smooth motion debug settings to Extra 2025-07-20 20:58:33 +01:00
emoose
f5e4d76388 Settings: add TILED_CACHE, 3 OpenGL settings, update smooth motion
default

Thanks to @Squall-Leonhart
2025-07-20 20:48:54 +01:00
emoose
89957fcbae Settings: update Smooth Motion settings, add debug settings/flip metering 2025-07-16 23:12:51 +01:00
emoose
0cbafd18a3 CustomSettings: add MinDriver 572.83 to forced DLSS scale 2025-03-20 16:33:34 +00:00
Warkratos
590125369d Update CustomSettingNames.xml
remove the "pre 571 drivers" notice
2025-03-20 16:29:50 +00:00
Warkratos
5a20139f8b Update CustomSettingNames.xml 2025-03-20 16:29:50 +00:00
emoose
a6fde2f6f8 Reference: add names from nvapi/nvcpl
scanner in NVPI didn't pick these up some reason, guess they might be flagged as hidden?
2025-02-23 00:35:53 +00:00
emoose
d5cae1000f Settings: add DLSS-FG flags, RTXHDR bits 2025-02-22 19:28:04 +00:00
emoose
73dbbbd66c Settings: add DXVK present promotion flag & extra DLSS/rBAR settings
thanks to aufkrawall for suggestions (https://github.com/Orbmu2k/nvidiaProfileInspector/issues/282)

- added DXVK flag to Reference.xml to let bit editor see it

- also added shader cache size 8GB / 0x2000 since that seemed default for me
2025-02-21 22:39:08 +00:00
emoose
64f626e8a0 Use InputBox with browse button to add app, add yes/no prompt to reset profile 2025-02-19 00:25:19 +00:00
emoose
f62aa86ccc InputBox: add browse button 2025-02-18 23:33:12 +00:00
emoose
345444619c Add tooltip to app paths label 2025-02-18 23:33:12 +00:00
emoose
50006f114a Allow adding app path by string when double-clicking apps label
Can be used to add UWP IDs to the profile without needing to edit exported .nip
2025-02-18 23:33:12 +00:00
emoose
a3b524e7d9 InputBox: fix DPI scaling on later Windows versions 2025-02-18 23:33:12 +00:00
Orbmu2k
109fdd066a Merge pull request #273 from Orbmu2k/master-pull
MERGE PRs
2025-02-15 12:30:06 +01:00
7 changed files with 2958 additions and 1119 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
@@ -9,13 +10,14 @@ namespace nspector.Common.Helper
internal class InputBox
{
internal static DialogResult Show(string title, string promptText, ref string value, List<string> invalidInputs, string mandatoryFormatRegExPattern, int maxLength)
internal static DialogResult Show(string title, string promptText, ref string value, List<string> invalidInputs, string mandatoryFormatRegExPattern, int maxLength, bool allowExeBrowse = false)
{
var form = new Form();
var label = new Label();
var textBox = new TextBox();
var buttonOk = new Button();
var buttonCancel = new Button();
var buttonBrowse = new Button();
var imageBox = new PictureBox();
EventHandler textchanged = delegate (object sender, EventArgs e)
@@ -43,10 +45,23 @@ namespace nspector.Common.Helper
buttonOk.Enabled = true;
};
EventHandler buttonBrowse_Click = delegate (object sender, EventArgs e)
{
var openDialog = new OpenFileDialog();
openDialog.DefaultExt = "*.exe";
openDialog.Filter = "Application EXE Name|*.exe|Application Absolute Path|*.exe";
if (openDialog.ShowDialog() == DialogResult.OK)
{
string applicationName = new FileInfo(openDialog.FileName).Name;
if (openDialog.FilterIndex == 2)
applicationName = openDialog.FileName;
textBox.Text = applicationName;
}
};
textBox.TextChanged += textchanged;
form.Text = title;
label.Text = promptText;
textBox.Text = value;
@@ -55,28 +70,47 @@ namespace nspector.Common.Helper
buttonOk.Text = "OK";
buttonCancel.Text = "Cancel";
buttonBrowse.Text = "Browse...";
buttonOk.DialogResult = DialogResult.OK;
buttonCancel.DialogResult = DialogResult.Cancel;
buttonOk.Enabled = false;
label.SetBounds(Dpi(9), Dpi(20), Dpi(372), Dpi(13));
textBox.SetBounds(Dpi(12), Dpi(36), Dpi(352), Dpi(20));
buttonOk.SetBounds(Dpi(228), Dpi(72), Dpi(75), Dpi(23));
buttonCancel.SetBounds(Dpi(309), Dpi(72), Dpi(75), Dpi(23));
textBox.SetBounds(Dpi(12), Dpi(44), Dpi(352), Dpi(20));
buttonOk.SetBounds(Dpi(224), Dpi(72), Dpi(75), Dpi(23));
buttonCancel.SetBounds(Dpi(305), Dpi(72), Dpi(75), Dpi(23));
imageBox.SetBounds(Dpi(368), Dpi(36), Dpi(16), Dpi(16));
if (allowExeBrowse)
{
textBox.SetBounds(Dpi(12), Dpi(44), Dpi(286), Dpi(20));
buttonBrowse.SetBounds(Dpi(305), Dpi(39), Dpi(75), Dpi(23));
buttonBrowse.Click += buttonBrowse_Click;
}
imageBox.SetBounds(Dpi(368), Dpi(44), Dpi(16), Dpi(16));
label.AutoSize = true;
label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
imageBox.Anchor = AnchorStyles.Top | AnchorStyles.Right;
textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
textBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonBrowse.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
form.ClientSize = new Size(Dpi(396), Dpi(107));
form.ClientSize = new Size(Math.Max(Dpi(300), label.Right + Dpi(10)), form.ClientSize.Height);
form.Controls.AddRange(new Control[] { label, textBox, imageBox, buttonOk, buttonCancel });
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.MinimumSize = form.Size;
form.MaximumSize = new Size(form.MinimumSize.Width * 2, form.MinimumSize.Height);
form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
if (!allowExeBrowse)
form.Controls.Add(imageBox);
else
form.Controls.Add(buttonBrowse);
form.ShowIcon = false;
form.FormBorderStyle = FormBorderStyle.Sizable;
form.StartPosition = FormStartPosition.CenterParent;
form.MinimizeBox = false;
form.MaximizeBox = false;

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,34 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace nspector
{
public class WatermarkTextBox : TextBox
{
private const int WM_PAINT = 0x000F;
private string _watermarkText;
[Category("Appearance")]
public string WatermarkText
{
get => _watermarkText;
set { _watermarkText = value; Invalidate(); }
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_PAINT && string.IsNullOrEmpty(this.Text) && !string.IsNullOrEmpty(_watermarkText))
{
using (Graphics g = this.CreateGraphics())
using (Brush brush = new SolidBrush(SystemColors.GrayText))
{
TextFormatFlags flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left;
TextRenderer.DrawText(g, _watermarkText, this.Font, this.ClientRectangle, SystemColors.GrayText, flags);
}
}
}
}
}

View File

@@ -77,6 +77,7 @@
this.chSettingValueHex = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tbSettingDescription = new System.Windows.Forms.TextBox();
this.pnlListview = new System.Windows.Forms.Panel();
this.txtFilter = new nspector.WatermarkTextBox();
this.tsMain.SuspendLayout();
this.pnlListview.SuspendLayout();
this.SuspendLayout();
@@ -94,10 +95,10 @@
//
this.pbMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pbMain.Location = new System.Drawing.Point(12, 475);
this.pbMain.Margin = new System.Windows.Forms.Padding(4);
this.pbMain.Location = new System.Drawing.Point(22, 877);
this.pbMain.Margin = new System.Windows.Forms.Padding(7);
this.pbMain.Name = "pbMain";
this.pbMain.Size = new System.Drawing.Size(840, 9);
this.pbMain.Size = new System.Drawing.Size(1540, 17);
this.pbMain.TabIndex = 19;
//
// tsMain
@@ -135,10 +136,11 @@
this.tsSep6,
this.tsbApplyProfile});
this.tsMain.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
this.tsMain.Location = new System.Drawing.Point(12, 4);
this.tsMain.Location = new System.Drawing.Point(22, 7);
this.tsMain.Name = "tsMain";
this.tsMain.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
this.tsMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.tsMain.Size = new System.Drawing.Size(840, 25);
this.tsMain.Size = new System.Drawing.Size(1540, 46);
this.tsMain.TabIndex = 24;
this.tsMain.Text = "toolStrip1";
//
@@ -147,7 +149,7 @@
this.tslProfiles.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.tslProfiles.Margin = new System.Windows.Forms.Padding(0, 5, 10, 2);
this.tslProfiles.Name = "tslProfiles";
this.tslProfiles.Size = new System.Drawing.Size(49, 18);
this.tslProfiles.Size = new System.Drawing.Size(86, 39);
this.tslProfiles.Text = "Profiles:";
//
// cbProfiles
@@ -159,7 +161,7 @@
this.cbProfiles.Margin = new System.Windows.Forms.Padding(1);
this.cbProfiles.MaxDropDownItems = 50;
this.cbProfiles.Name = "cbProfiles";
this.cbProfiles.Size = new System.Drawing.Size(290, 23);
this.cbProfiles.Size = new System.Drawing.Size(528, 38);
this.cbProfiles.SelectedIndexChanged += new System.EventHandler(this.cbProfiles_SelectedIndexChanged);
this.cbProfiles.TextChanged += new System.EventHandler(this.cbProfiles_TextChanged);
//
@@ -170,7 +172,7 @@
this.tsbModifiedProfiles.Image = global::nspector.Properties.Resources.home_sm;
this.tsbModifiedProfiles.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbModifiedProfiles.Name = "tsbModifiedProfiles";
this.tsbModifiedProfiles.Size = new System.Drawing.Size(36, 22);
this.tsbModifiedProfiles.Size = new System.Drawing.Size(44, 40);
this.tsbModifiedProfiles.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.tsbModifiedProfiles.ToolTipText = "Back to global profile (Home) / User modified profiles";
this.tsbModifiedProfiles.ButtonClick += new System.EventHandler(this.tsbModifiedProfiles_ButtonClick);
@@ -179,7 +181,7 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46);
//
// tsbRefreshProfile
//
@@ -187,7 +189,7 @@
this.tsbRefreshProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbRefreshProfile.Image")));
this.tsbRefreshProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRefreshProfile.Name = "tsbRefreshProfile";
this.tsbRefreshProfile.Size = new System.Drawing.Size(24, 22);
this.tsbRefreshProfile.Size = new System.Drawing.Size(40, 40);
this.tsbRefreshProfile.Text = "Refresh current profile.";
this.tsbRefreshProfile.Click += new System.EventHandler(this.tsbRefreshProfile_Click);
//
@@ -197,7 +199,7 @@
this.tsbRestoreProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbRestoreProfile.Image")));
this.tsbRestoreProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbRestoreProfile.Name = "tsbRestoreProfile";
this.tsbRestoreProfile.Size = new System.Drawing.Size(24, 22);
this.tsbRestoreProfile.Size = new System.Drawing.Size(40, 40);
this.tsbRestoreProfile.Text = "Restore current profile to NVIDIA defaults.";
this.tsbRestoreProfile.Click += new System.EventHandler(this.tsbRestoreProfile_Click);
//
@@ -207,7 +209,7 @@
this.tsbCreateProfile.Image = ((System.Drawing.Image)(resources.GetObject("tsbCreateProfile.Image")));
this.tsbCreateProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbCreateProfile.Name = "tsbCreateProfile";
this.tsbCreateProfile.Size = new System.Drawing.Size(24, 22);
this.tsbCreateProfile.Size = new System.Drawing.Size(40, 40);
this.tsbCreateProfile.Text = "Create new profile";
this.tsbCreateProfile.Click += new System.EventHandler(this.tsbCreateProfile_Click);
//
@@ -217,14 +219,14 @@
this.tsbDeleteProfile.Image = global::nspector.Properties.Resources.ieframe_1_18212;
this.tsbDeleteProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDeleteProfile.Name = "tsbDeleteProfile";
this.tsbDeleteProfile.Size = new System.Drawing.Size(24, 22);
this.tsbDeleteProfile.Size = new System.Drawing.Size(40, 40);
this.tsbDeleteProfile.Text = "Delete current Profile";
this.tsbDeleteProfile.Click += new System.EventHandler(this.tsbDeleteProfile_Click);
//
// tsSep2
//
this.tsSep2.Name = "tsSep2";
this.tsSep2.Size = new System.Drawing.Size(6, 25);
this.tsSep2.Size = new System.Drawing.Size(6, 46);
//
// tsbAddApplication
//
@@ -232,7 +234,7 @@
this.tsbAddApplication.Image = global::nspector.Properties.Resources.window_application_add;
this.tsbAddApplication.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbAddApplication.Name = "tsbAddApplication";
this.tsbAddApplication.Size = new System.Drawing.Size(24, 22);
this.tsbAddApplication.Size = new System.Drawing.Size(40, 40);
this.tsbAddApplication.Text = "Add application to current profile.";
this.tsbAddApplication.Click += new System.EventHandler(this.tsbAddApplication_Click);
//
@@ -242,7 +244,7 @@
this.tssbRemoveApplication.Image = global::nspector.Properties.Resources.window_application_delete;
this.tssbRemoveApplication.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tssbRemoveApplication.Name = "tssbRemoveApplication";
this.tssbRemoveApplication.Size = new System.Drawing.Size(36, 22);
this.tssbRemoveApplication.Size = new System.Drawing.Size(44, 40);
this.tssbRemoveApplication.Text = "Remove application from current profile";
this.tssbRemoveApplication.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.tssbRemoveApplication_DropDownItemClicked);
this.tssbRemoveApplication.Click += new System.EventHandler(this.tssbRemoveApplication_Click);
@@ -250,7 +252,7 @@
// tsSep3
//
this.tsSep3.Name = "tsSep3";
this.tsSep3.Size = new System.Drawing.Size(6, 25);
this.tsSep3.Size = new System.Drawing.Size(6, 46);
//
// tsbExportProfiles
//
@@ -263,35 +265,35 @@
this.tsbExportProfiles.Image = global::nspector.Properties.Resources.export1;
this.tsbExportProfiles.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbExportProfiles.Name = "tsbExportProfiles";
this.tsbExportProfiles.Size = new System.Drawing.Size(36, 22);
this.tsbExportProfiles.Size = new System.Drawing.Size(44, 40);
this.tsbExportProfiles.Text = "Export user defined profiles";
this.tsbExportProfiles.Click += new System.EventHandler(this.tsbExportProfiles_Click);
//
// exportCurrentProfileOnlyToolStripMenuItem
//
this.exportCurrentProfileOnlyToolStripMenuItem.Name = "exportCurrentProfileOnlyToolStripMenuItem";
this.exportCurrentProfileOnlyToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
this.exportCurrentProfileOnlyToolStripMenuItem.Size = new System.Drawing.Size(602, 40);
this.exportCurrentProfileOnlyToolStripMenuItem.Text = "Export current profile only";
this.exportCurrentProfileOnlyToolStripMenuItem.Click += new System.EventHandler(this.exportCurrentProfileOnlyToolStripMenuItem_Click);
//
// exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem
//
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Name = "exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem";
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Size = new System.Drawing.Size(602, 40);
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Text = "Export current profile including predefined settings";
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Click += new System.EventHandler(this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem_Click);
//
// exportUserdefinedProfilesToolStripMenuItem
//
this.exportUserdefinedProfilesToolStripMenuItem.Name = "exportUserdefinedProfilesToolStripMenuItem";
this.exportUserdefinedProfilesToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
this.exportUserdefinedProfilesToolStripMenuItem.Size = new System.Drawing.Size(602, 40);
this.exportUserdefinedProfilesToolStripMenuItem.Text = "Export all customized profiles";
this.exportUserdefinedProfilesToolStripMenuItem.Click += new System.EventHandler(this.exportUserdefinedProfilesToolStripMenuItem_Click);
//
// exportAllProfilesNVIDIATextFormatToolStripMenuItem
//
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Name = "exportAllProfilesNVIDIATextFormatToolStripMenuItem";
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(602, 40);
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Text = "Export all driver profiles (NVIDIA Text Format)";
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Click += new System.EventHandler(this.exportAllProfilesNVIDIATextFormatToolStripMenuItem_Click);
//
@@ -304,28 +306,28 @@
this.tsbImportProfiles.Image = global::nspector.Properties.Resources.import1;
this.tsbImportProfiles.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbImportProfiles.Name = "tsbImportProfiles";
this.tsbImportProfiles.Size = new System.Drawing.Size(36, 22);
this.tsbImportProfiles.Size = new System.Drawing.Size(44, 40);
this.tsbImportProfiles.Text = "Import user defined profiles";
this.tsbImportProfiles.Click += new System.EventHandler(this.tsbImportProfiles_Click);
//
// importProfilesToolStripMenuItem
//
this.importProfilesToolStripMenuItem.Name = "importProfilesToolStripMenuItem";
this.importProfilesToolStripMenuItem.Size = new System.Drawing.Size(363, 22);
this.importProfilesToolStripMenuItem.Size = new System.Drawing.Size(639, 40);
this.importProfilesToolStripMenuItem.Text = "Import profile(s)";
this.importProfilesToolStripMenuItem.Click += new System.EventHandler(this.importProfilesToolStripMenuItem_Click);
//
// importAllProfilesNVIDIATextFormatToolStripMenuItem
//
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Name = "importAllProfilesNVIDIATextFormatToolStripMenuItem";
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(363, 22);
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(639, 40);
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Text = "Import (replace) all driver profiles (NVIDIA Text Format)";
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Click += new System.EventHandler(this.importAllProfilesNVIDIATextFormatToolStripMenuItem_Click);
//
// tsSep4
//
this.tsSep4.Name = "tsSep4";
this.tsSep4.Size = new System.Drawing.Size(6, 25);
this.tsSep4.Size = new System.Drawing.Size(6, 46);
//
// tscbShowCustomSettingNamesOnly
//
@@ -334,14 +336,14 @@
this.tscbShowCustomSettingNamesOnly.Image = global::nspector.Properties.Resources.filter_user;
this.tscbShowCustomSettingNamesOnly.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tscbShowCustomSettingNamesOnly.Name = "tscbShowCustomSettingNamesOnly";
this.tscbShowCustomSettingNamesOnly.Size = new System.Drawing.Size(24, 22);
this.tscbShowCustomSettingNamesOnly.Size = new System.Drawing.Size(40, 40);
this.tscbShowCustomSettingNamesOnly.Text = "Show the settings and values from CustomSettingNames file only.";
this.tscbShowCustomSettingNamesOnly.CheckedChanged += new System.EventHandler(this.cbCustomSettingsOnly_CheckedChanged);
//
// tsSep5
//
this.tsSep5.Name = "tsSep5";
this.tsSep5.Size = new System.Drawing.Size(6, 25);
this.tsSep5.Size = new System.Drawing.Size(6, 46);
//
// tscbShowScannedUnknownSettings
//
@@ -351,7 +353,7 @@
this.tscbShowScannedUnknownSettings.Image = global::nspector.Properties.Resources.find_set2;
this.tscbShowScannedUnknownSettings.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tscbShowScannedUnknownSettings.Name = "tscbShowScannedUnknownSettings";
this.tscbShowScannedUnknownSettings.Size = new System.Drawing.Size(24, 22);
this.tscbShowScannedUnknownSettings.Size = new System.Drawing.Size(40, 40);
this.tscbShowScannedUnknownSettings.Text = "Show unknown settings from NVIDIA predefined profiles";
this.tscbShowScannedUnknownSettings.Click += new System.EventHandler(this.tscbShowScannedUnknownSettings_Click);
//
@@ -361,14 +363,14 @@
this.tsbBitValueEditor.Image = global::nspector.Properties.Resources.text_binary;
this.tsbBitValueEditor.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbBitValueEditor.Name = "tsbBitValueEditor";
this.tsbBitValueEditor.Size = new System.Drawing.Size(24, 22);
this.tsbBitValueEditor.Size = new System.Drawing.Size(40, 40);
this.tsbBitValueEditor.Text = "Show bit value editor.";
this.tsbBitValueEditor.Click += new System.EventHandler(this.tsbBitValueEditor_Click);
//
// tsSep6
//
this.tsSep6.Name = "tsSep6";
this.tsSep6.Size = new System.Drawing.Size(6, 25);
this.tsSep6.Size = new System.Drawing.Size(6, 46);
//
// tsbApplyProfile
//
@@ -377,7 +379,7 @@
this.tsbApplyProfile.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbApplyProfile.Name = "tsbApplyProfile";
this.tsbApplyProfile.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
this.tsbApplyProfile.Size = new System.Drawing.Size(109, 22);
this.tsbApplyProfile.Size = new System.Drawing.Size(173, 40);
this.tsbApplyProfile.Text = "Apply changes";
this.tsbApplyProfile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.tsbApplyProfile.Click += new System.EventHandler(this.tsbApplyProfile_Click);
@@ -387,10 +389,10 @@
this.btnResetValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnResetValue.Enabled = false;
this.btnResetValue.Image = global::nspector.Properties.Resources.nv_btn;
this.btnResetValue.Location = new System.Drawing.Point(732, 175);
this.btnResetValue.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
this.btnResetValue.Location = new System.Drawing.Point(1342, 323);
this.btnResetValue.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
this.btnResetValue.Name = "btnResetValue";
this.btnResetValue.Size = new System.Drawing.Size(25, 19);
this.btnResetValue.Size = new System.Drawing.Size(46, 35);
this.btnResetValue.TabIndex = 7;
this.btnResetValue.UseVisualStyleBackColor = true;
this.btnResetValue.Click += new System.EventHandler(this.btnResetValue_Click);
@@ -402,12 +404,13 @@
this.lblApplications.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(185)))), ((int)(((byte)(0)))));
this.lblApplications.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.lblApplications.ForeColor = System.Drawing.Color.White;
this.lblApplications.Location = new System.Drawing.Point(12, 32);
this.lblApplications.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblApplications.Location = new System.Drawing.Point(22, 59);
this.lblApplications.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblApplications.Name = "lblApplications";
this.lblApplications.Size = new System.Drawing.Size(840, 17);
this.lblApplications.Size = new System.Drawing.Size(1540, 31);
this.lblApplications.TabIndex = 25;
this.lblApplications.Text = "fsagame.exe, bond.exe, herozero.exe";
this.lblApplications.DoubleClick += new System.EventHandler(this.tsbAddApplication_Click);
//
// toolStripButton5
//
@@ -443,10 +446,10 @@
//
this.cbValues.BackColor = System.Drawing.SystemColors.Window;
this.cbValues.FormattingEnabled = true;
this.cbValues.Location = new System.Drawing.Point(524, 175);
this.cbValues.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cbValues.Location = new System.Drawing.Point(961, 323);
this.cbValues.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.cbValues.Name = "cbValues";
this.cbValues.Size = new System.Drawing.Size(72, 21);
this.cbValues.Size = new System.Drawing.Size(129, 32);
this.cbValues.TabIndex = 5;
this.cbValues.Visible = false;
this.cbValues.SelectedValueChanged += new System.EventHandler(this.cbValues_SelectedValueChanged);
@@ -454,40 +457,40 @@
//
// lblWidth96
//
this.lblWidth96.Location = new System.Drawing.Point(77, 233);
this.lblWidth96.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth96.Location = new System.Drawing.Point(141, 430);
this.lblWidth96.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth96.Name = "lblWidth96";
this.lblWidth96.Size = new System.Drawing.Size(96, 18);
this.lblWidth96.Size = new System.Drawing.Size(176, 33);
this.lblWidth96.TabIndex = 77;
this.lblWidth96.Text = "96";
this.lblWidth96.Visible = false;
//
// lblWidth330
//
this.lblWidth330.Location = new System.Drawing.Point(77, 210);
this.lblWidth330.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth330.Location = new System.Drawing.Point(141, 388);
this.lblWidth330.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth330.Name = "lblWidth330";
this.lblWidth330.Size = new System.Drawing.Size(330, 22);
this.lblWidth330.Size = new System.Drawing.Size(605, 41);
this.lblWidth330.TabIndex = 78;
this.lblWidth330.Text = "330 (Helper Labels for DPI Scaling)";
this.lblWidth330.Visible = false;
//
// lblWidth16
//
this.lblWidth16.Location = new System.Drawing.Point(77, 269);
this.lblWidth16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth16.Location = new System.Drawing.Point(141, 497);
this.lblWidth16.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth16.Name = "lblWidth16";
this.lblWidth16.Size = new System.Drawing.Size(16, 18);
this.lblWidth16.Size = new System.Drawing.Size(29, 33);
this.lblWidth16.TabIndex = 79;
this.lblWidth16.Text = "16";
this.lblWidth16.Visible = false;
//
// lblWidth30
//
this.lblWidth30.Location = new System.Drawing.Point(77, 251);
this.lblWidth30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth30.Location = new System.Drawing.Point(141, 463);
this.lblWidth30.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth30.Name = "lblWidth30";
this.lblWidth30.Size = new System.Drawing.Size(30, 18);
this.lblWidth30.Size = new System.Drawing.Size(55, 33);
this.lblWidth30.TabIndex = 80;
this.lblWidth30.Text = "30";
this.lblWidth30.Visible = false;
@@ -503,12 +506,12 @@
this.lvSettings.GridLines = true;
this.lvSettings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lvSettings.HideSelection = false;
this.lvSettings.Location = new System.Drawing.Point(0, 0);
this.lvSettings.Margin = new System.Windows.Forms.Padding(4);
this.lvSettings.Location = new System.Drawing.Point(0, 29);
this.lvSettings.Margin = new System.Windows.Forms.Padding(7);
this.lvSettings.MultiSelect = false;
this.lvSettings.Name = "lvSettings";
this.lvSettings.ShowItemToolTips = true;
this.lvSettings.Size = new System.Drawing.Size(840, 372);
this.lvSettings.Size = new System.Drawing.Size(1540, 661);
this.lvSettings.SmallImageList = this.ilListView;
this.lvSettings.TabIndex = 2;
this.lvSettings.UseCompatibleStateImageBehavior = false;
@@ -537,12 +540,13 @@
// tbSettingDescription
//
this.tbSettingDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tbSettingDescription.Location = new System.Drawing.Point(0, 372);
this.tbSettingDescription.Location = new System.Drawing.Point(0, 690);
this.tbSettingDescription.Margin = new System.Windows.Forms.Padding(6);
this.tbSettingDescription.Multiline = true;
this.tbSettingDescription.Name = "tbSettingDescription";
this.tbSettingDescription.ReadOnly = true;
this.tbSettingDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbSettingDescription.Size = new System.Drawing.Size(840, 44);
this.tbSettingDescription.Size = new System.Drawing.Size(1540, 78);
this.tbSettingDescription.TabIndex = 81;
this.tbSettingDescription.Visible = false;
//
@@ -552,17 +556,29 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlListview.Controls.Add(this.lvSettings);
this.pnlListview.Controls.Add(this.txtFilter);
this.pnlListview.Controls.Add(this.tbSettingDescription);
this.pnlListview.Location = new System.Drawing.Point(12, 52);
this.pnlListview.Location = new System.Drawing.Point(22, 96);
this.pnlListview.Margin = new System.Windows.Forms.Padding(6);
this.pnlListview.Name = "pnlListview";
this.pnlListview.Size = new System.Drawing.Size(840, 416);
this.pnlListview.Size = new System.Drawing.Size(1540, 768);
this.pnlListview.TabIndex = 82;
//
// txtFilter
//
this.txtFilter.Dock = System.Windows.Forms.DockStyle.Top;
this.txtFilter.Location = new System.Drawing.Point(0, 0);
this.txtFilter.Name = "txtFilter";
this.txtFilter.Size = new System.Drawing.Size(1540, 29);
this.txtFilter.TabIndex = 82;
this.txtFilter.WatermarkText = "Search for setting...";
this.txtFilter.TextChanged += new System.EventHandler(this.txtFilter_TextChanged);
//
// frmDrvSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 22F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(864, 492);
this.ClientSize = new System.Drawing.Size(1584, 908);
this.Controls.Add(this.pnlListview);
this.Controls.Add(this.lblWidth30);
this.Controls.Add(this.lblWidth16);
@@ -573,8 +589,8 @@
this.Controls.Add(this.pbMain);
this.Controls.Add(this.btnResetValue);
this.Controls.Add(this.cbValues);
this.Margin = new System.Windows.Forms.Padding(4);
this.MinimumSize = new System.Drawing.Size(879, 346);
this.Margin = new System.Windows.Forms.Padding(7);
this.MinimumSize = new System.Drawing.Size(1592, 585);
this.Name = "frmDrvSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "nSpector - Driver Profile Settings";
@@ -639,5 +655,6 @@
private System.Windows.Forms.ToolStripMenuItem exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem;
private System.Windows.Forms.TextBox tbSettingDescription;
private System.Windows.Forms.Panel pnlListview;
private WatermarkTextBox txtFilter;
}
}

View File

@@ -537,6 +537,10 @@ namespace nspector
{
ScaleFactor = lblWidth330.Width / 330;
// Later Windows versions changed DPI scaling method, check with Graphics and use it if larger
using (Graphics g = CreateGraphics())
ScaleFactor = Math.Max(ScaleFactor, Math.Max(g.DpiX / 96f, g.DpiY / 96f));
chSettingID.Width = lblWidth330.Width;
chSettingValueHex.Width = lblWidth96.Width;
}
@@ -627,8 +631,12 @@ namespace nspector
ResetSelectedValue();
}
ToolTip appPathsTooltip = new ToolTip() { InitialDelay = 250 };
private void ChangeCurrentProfile(string profileName)
{
txtFilter.Text = "";
if (profileName == GetBaseProfileName() || profileName == _baseProfileName)
{
_CurrentProfile = _baseProfileName;
@@ -636,6 +644,7 @@ namespace nspector
tsbDeleteProfile.Enabled = false;
tsbAddApplication.Enabled = false;
tssbRemoveApplication.Enabled = false;
appPathsTooltip.SetToolTip(lblApplications, "");
}
else
{
@@ -643,9 +652,9 @@ namespace nspector
tsbDeleteProfile.Enabled = true;
tsbAddApplication.Enabled = true;
tssbRemoveApplication.Enabled = true;
appPathsTooltip.SetToolTip(lblApplications, "Double-click to add application");
}
RefreshCurrentProfile();
}
@@ -806,7 +815,15 @@ namespace nspector
}
}
else
ResetCurrentProfile();
{
if (MessageBox.Show(this,
"Restore profile to NVIDIA driver defaults?",
"Restore profile",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
ResetCurrentProfile();
}
}
}
private void tsbRefreshProfile_Click(object sender, EventArgs e)
@@ -917,15 +934,24 @@ namespace nspector
private void tsbAddApplication_Click(object sender, EventArgs e)
{
var openDialog = new OpenFileDialog();
openDialog.DefaultExt = "*.exe";
openDialog.Filter = "Application EXE Name|*.exe|Application Absolute Path|*.exe";
if (_CurrentProfile == GetBaseProfileName() || _CurrentProfile == _baseProfileName)
return;
if (openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
var applications = new Dictionary<string, string>();
_currentProfileSettingItems = _drs.GetSettingsForProfile(_CurrentProfile, GetSettingViewMode(), ref applications);
var existingPaths = new HashSet<string>(applications.Values, StringComparer.OrdinalIgnoreCase);
var applicationName = "";
if (InputBox.Show("Add Application", "Enter an application path/filename/UWP ID to add to the profile:", ref applicationName, new List<string>(), "", 2048, true) == DialogResult.OK)
{
string applicationName = new FileInfo(openDialog.FileName).Name;
if (openDialog.FilterIndex == 2)
applicationName = openDialog.FileName;
// Add new application path
if (existingPaths.Contains(applicationName))
{
MessageBox.Show("This application is already assigned to this profile!",
"Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
@@ -936,25 +962,26 @@ namespace nspector
if (ex.Status == Native.NVAPI2.NvAPI_Status.NVAPI_EXECUTABLE_ALREADY_IN_USE || ex.Status == Native.NVAPI2.NvAPI_Status.NVAPI_ERROR)
{
if (lblApplications.Text.ToUpper().IndexOf(" " + applicationName.ToUpper() + ",") != -1)
MessageBox.Show("This application executable is already assigned to this profile!",
MessageBox.Show("This application is already assigned to this profile!",
"Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
{
string profileNames = _scanner.FindProfilesUsingApplication(applicationName);
if (profileNames == "")
MessageBox.Show("This application executable might already be assigned to another profile!",
MessageBox.Show("This application might already be assigned to another profile!",
"Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
MessageBox.Show(
"This application executable is already assigned to the following profiles: " +
"This application is already assigned to the following profiles: " +
profileNames, "Error adding Application", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
throw;
}
RefreshCurrentProfile();
}
RefreshCurrentProfile();
}
private void tssbRemoveApplication_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
@@ -1079,6 +1106,8 @@ namespace nspector
private async void RefreshAll()
{
txtFilter.Text = "";
RefreshProfilesCombo();
await ScanProfilesSilentAsync(true, false);
@@ -1280,34 +1309,36 @@ namespace nspector
if (e.Control && e.KeyCode == Keys.F)
{
SearchSetting();
txtFilter.Focus();
}
if (e.KeyCode == Keys.Escape)
{
RefreshCurrentProfile();
}
}
private void SearchSetting()
private void txtFilter_TextChanged(object sender, EventArgs e)
{
string inputString = "";
if (InputBox.Show("Search Setting", "Please enter setting name:", ref inputString, new List<string>(), "", 2048) == System.Windows.Forms.DialogResult.OK)
RefreshCurrentProfile();
if (string.IsNullOrEmpty(txtFilter.Text.Trim()))
{
var lowerInput = inputString.Trim().ToLowerInvariant();
lvSettings.BeginUpdate();
foreach(ListViewItem itm in lvSettings.Items)
{
if (!itm.Text.ToLowerInvariant().Contains(lowerInput))
{
itm.Remove();
}
}
lvSettings.EndUpdate();
return;
}
var lowerInput = txtFilter.Text.Trim().ToLowerInvariant();
lvSettings.BeginUpdate();
foreach (ListViewItem itm in lvSettings.Items)
{
if (!itm.Text.ToLowerInvariant().Contains(lowerInput))
{
itm.Remove();
}
}
lvSettings.EndUpdate();
txtFilter.Focus(); // Setting listbox sometimes steals focus away
}
private void EnableDevmode()
@@ -1399,7 +1430,6 @@ namespace nspector
}
Clipboard.SetText(sbSettings.ToString());
}
}
}

View File

@@ -204,6 +204,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WatermarkTextBox.cs">
<SubType>Component</SubType>
</Compile>
<EmbeddedResource Include="frmBitEditor.resx">
<DependentUpon>frmBitEditor.cs</DependentUpon>
<SubType>Designer</SubType>