Compare commits

...

16 Commits

Author SHA1 Message Date
emoose
985af53a27 Drs: update GetDrsProgramPath 2025-08-07 03:41:01 +01:00
emoose
c38992cd7c Settings: show DLSS override version in dropdown/description, and
remove unused mark from DLSS-RR preset E.

Tries to parse nvngx_config.txt and find the latest override version,
displays it in dropdown.

Needs testing with systems that have modified nvngx_config (eg. through
updating DLSS override with tools), may release test version for it
soon.
2025-08-06 23:30:42 +01:00
emoose
53ead6e9ef Form: disable text auto-complete in filter textbox
Thanks to Astyanax for posting fix on guru3d forums!
2025-08-06 23:05:09 +01:00
emoose
f35c4cda03 UserSettings: fix exception when settings.xml doesn't exist 2025-08-01 22:03:18 +01:00
emoose
a0207baafb Form: allow searching for profile by EXE name when Enter is pressed
If entered text isn't found as a profile-name, it'll now be searched as
an EXE filename/filepath

eg. can type mpc-hc64.exe and press Enter to open the Media Player
Classic profile.
2025-07-31 16:50:17 +01:00
emoose
689ad42bce Settings: add AlternateNames element, used in search filter
Should make renaming settings less painful in future, added a couple
common alt names people have used before
2025-07-31 02:07:53 +01:00
emoose
0a7003519a Form: allow CTRL+ALT+D when filter textbox is focused 2025-07-31 00:43:38 +01:00
emoose
fa01928689 Form: store collapsed groups in settings.xml, minor UI fixes
Makes more sense than storing as separate file, the online update check
can also be disabled in the settings.xml too

(xml is stored at AppData/Local/NVIDIA Profile Inspector/)

Also fixes minor UI issue with the highlight effect on toolstrip

Search filter is now applied as settings are being populated, rather
than afterward, might slightly help performance
2025-07-30 23:41:10 +01:00
emoose
9de53ac04d Add Min/Max driver versions for settings missing in R575
Haven't found which driver versions removed these yet, just compared
511.78 against 575

Probably a lot more obsolete settings still here too, just did a quick
grep against both driver versions
2025-07-30 23:37:22 +01:00
emoose
7b917d9b11 Add basic update check, show notice in titlebar when newer release available
Check can be disabled by creating DisableUpdateCheck.txt in NVPI folder.

Also added PS_CONST_FOLDING_GPU setting (thanks to Guzz at guru3d)
2025-07-29 22:12:46 +01:00
emoose
8ac48c2928 Drs: implement Min/Max driver version checking
Will also hide most 3D vision settings on driver above 425.31

CTRL+ALT+D can be used to unhide version-checked settings
2025-07-29 18:31:57 +01:00
emoose
84e138c1ae Form: allow ESC key to clear search filter 2025-07-29 15:46:52 +01:00
emoose
e3ff6d42ac Settings: add antialiasing/aniso settings for newer drivers
Renamed older settings to pre-526.47 (might be nice if we had a
MaxDriverVersion property in there)

Added TILEDCACHE_L2_USAGE to Reference too.

Thanks to Guzz from guru3d for these new settings!

Changed spaces -> tabs in XML, since that seems to be VS default
2025-07-29 15:44:59 +01:00
emoose
de9f86e878 Form: handle filtering inside RefreshCurrentProfile, handle backspace
Fixes momentary flicker when saving profile, also seemed to help with
the collapsible groups perf issue, so removed the 250ms wait before
applying filter

Updated with NVDRS_APPLICATION_V4 from nvapi r575
2025-07-28 11:04:35 +01:00
emoose
8e0360149c Form: revert DPI change 2025-07-28 10:26:19 +01:00
emoose
bf8aa6c124 Form: remove unused func 2025-07-28 00:37:00 +01:00
20 changed files with 7130 additions and 6321 deletions

View File

@@ -13,8 +13,10 @@ namespace nspector.Common.CustomSettings
public string HexSettingId { get; set; }
public string Description { get; set; }
public string GroupName { get; set; }
public string AlternateNames { get; set; }
public string OverrideDefault { get; set; }
public float MinRequiredDriverVersion { get; set; }
public float MaxRequiredDriverVersion { get; set; }
public bool Hidden { get; set; }
public bool HasConstraints { get; set; }
public string DataType { get; set; }

View File

@@ -106,6 +106,17 @@ namespace nspector.Common
return null;
}
private string GetAlternateNames(uint settingId)
{
foreach (var service in MetaServices.OrderBy(x => x.Service.Source))
{
var altNames = service.Service.GetAlternateNames(settingId);
if (altNames != null)
return altNames;
}
return null;
}
private uint GetDwordDefaultValue(uint settingId)
{
foreach (var service in MetaServices.OrderBy(x => x.Service.Source))
@@ -301,13 +312,12 @@ namespace nspector.Common
if (groupName == null)
groupName = GetLegacyGroupName(settingId, settingName);
var result = new SettingMeta()
{
SettingType = settingType,
SettingName = settingName,
GroupName = groupName,
AlternateNames = GetAlternateNames(settingId),
IsApiExposed = GetIsApiExposed(settingId),
IsSettingHidden = GetIsSettingHidden(settingId),
@@ -351,6 +361,7 @@ namespace nspector.Common
SettingName = settingMeta.SettingName,
SettingType = settingMeta.SettingType,
GroupName = settingMeta.GroupName,
AlternateNames = settingMeta.AlternateNames,
IsApiExposed = settingMeta.IsApiExposed,
IsSettingHidden = settingMeta.IsSettingHidden,
Description = settingMeta.Description,
@@ -421,7 +432,10 @@ namespace nspector.Common
private bool GetIsSettingHidden(uint settingId)
{
var csnMeta = MetaServices.FirstOrDefault(m => m.Service.Source == SettingMetaSource.CustomSettings);
return (csnMeta != null && ((CustomSettingMetaService)csnMeta.Service).IsSettingHidden(settingId));
var refMeta = MetaServices.FirstOrDefault(m => m.Service.Source == SettingMetaSource.ReferenceSettings);
return (csnMeta != null && ((CustomSettingMetaService)csnMeta.Service).IsSettingHidden(settingId)) ||
refMeta != null && ((CustomSettingMetaService)refMeta.Service).IsSettingHidden(settingId);
}
private string GetDescription(uint settingId)

View File

@@ -51,6 +51,11 @@ namespace nspector.Common
return fiDbInstaller.DirectoryName;
}
string sys32Path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), @"drivers\NVIDIA Corporation\Drs\dbInstaller.exe");
if (File.Exists(sys32Path))
return sys32Path;
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
@"NVIDIA Corporation\Drs");
}
@@ -141,6 +146,27 @@ namespace nspector.Common
}
public string GetProfileNameByExeName(string appName)
{
string profileName = string.Empty;
DrsSession((hSession) =>
{
var hProfile = FindApplicationByName(hSession, appName);
if (hProfile != IntPtr.Zero)
{
var profile = GetProfileInfo(hSession, hProfile);
if (profile.isPredefined == 0 || profile.numOfApps > 0)
{
profileName = profile.profileName;
}
}
});
return profileName;
}
public List<string> GetProfileNames(ref string baseProfileName)
{
var lstResult = new List<string>();
@@ -471,6 +497,7 @@ namespace nspector.Common
SettingId = setting.settingId,
SettingText = settingMeta.SettingName,
GroupName = settingMeta.GroupName,
AlternateNames = settingMeta.AlternateNames,
ValueRaw = valueRaw,
ValueText = valueText,
State = settingState,
@@ -549,7 +576,7 @@ namespace nspector.Common
});
}
private string GetApplicationFingerprint(NVDRS_APPLICATION_V3 application)
private string GetApplicationFingerprint(NVDRS_APPLICATION_V4 application)
{
return $"{application.appName}|{application.fileInFolder}|{application.userFriendlyName}|{application.launcher}";
}

View File

@@ -14,6 +14,7 @@ namespace nspector.Common
{
internal abstract class DrsSettingsServiceBase
{
public static readonly float DriverVersion = GetDriverVersionInternal();
protected DrsSettingsMetaService meta;
protected DrsDecrypterService decrypter;
@@ -22,11 +23,9 @@ namespace nspector.Common
{
meta = metaService;
decrypter = decrpterService;
DriverVersion = GetDriverVersionInternal();
}
public readonly float DriverVersion;
private float GetDriverVersionInternal()
private static float GetDriverVersionInternal()
{
float result = 0f;
uint sysDrvVersion = 0;
@@ -215,9 +214,9 @@ namespace nspector.Common
protected void AddApplication(IntPtr hSession, IntPtr hProfile, string applicationName)
{
var newApp = new NVDRS_APPLICATION_V3()
var newApp = new NVDRS_APPLICATION_V4()
{
version = nvw.NVDRS_APPLICATION_VER_V3,
version = nvw.NVDRS_APPLICATION_VER_V4,
appName = applicationName,
};
@@ -227,7 +226,7 @@ namespace nspector.Common
}
protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, NVDRS_APPLICATION_V3 application)
protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, NVDRS_APPLICATION_V4 application)
{
var caRes = nvw.DRS_DeleteApplicationEx(hSession, hProfile, ref application);
if (caRes != NvAPI_Status.NVAPI_OK)
@@ -285,16 +284,16 @@ namespace nspector.Common
return settings.ToList();
}
protected List<NVDRS_APPLICATION_V3> GetProfileApplications(IntPtr hSession, IntPtr hProfile)
protected List<NVDRS_APPLICATION_V4> GetProfileApplications(IntPtr hSession, IntPtr hProfile)
{
uint appCount = 512;
var apps = new NVDRS_APPLICATION_V3[512];
apps[0].version = NvapiDrsWrapper.NVDRS_APPLICATION_VER_V3;
var apps = new NVDRS_APPLICATION_V4[512];
apps[0].version = NvapiDrsWrapper.NVDRS_APPLICATION_VER_V4;
var esRes = NvapiDrsWrapper.DRS_EnumApplications(hSession, hProfile, 0, ref appCount, ref apps);
if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION)
return new List<NVDRS_APPLICATION_V3>();
return new List<NVDRS_APPLICATION_V4>();
if (esRes != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_EnumApplications", esRes);
@@ -302,6 +301,20 @@ namespace nspector.Common
return apps.ToList();
}
protected IntPtr FindApplicationByName(IntPtr hSession, string appName)
{
IntPtr hProfile = IntPtr.Zero;
NVDRS_APPLICATION_V4 app = new NVDRS_APPLICATION_V4();
app.version = NvapiDrsWrapper.NVDRS_APPLICATION_VER_V4;
var res = NvapiDrsWrapper.DRS_FindApplicationByName(hSession, new StringBuilder(appName), ref hProfile, ref app);
if (res != NvAPI_Status.NVAPI_OK)
throw new NvapiException("DRS_FindApplicationByName", res);
return hProfile;
}
protected void SaveSettings(IntPtr hSession)
{
var nvRes = nvw.DRS_SaveSettings(hSession);

View File

@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace nspector.Common.Helper
{
public class IniParser
{
public Dictionary<string, Dictionary<string, string>> Data { get; } = new();
public void Load(string filePath)
{
using var reader = new StreamReader(filePath);
string? line;
string? currentSection = null;
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
// Skip empty lines and comments
if (string.IsNullOrEmpty(line) || line.StartsWith(";") || line.StartsWith("#"))
continue;
// Section
if (line.StartsWith("[") && line.EndsWith("]"))
{
currentSection = line.Substring(1, line.Length - 2).Trim();
if (!Data.ContainsKey(currentSection))
Data[currentSection] = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
// Key=Value
else if (currentSection != null && line.Contains('='))
{
int idx = line.IndexOf('=');
var key = line.Substring(0, idx).Trim();
var value = line.Substring(idx + 1).Trim();
Data[currentSection][key] = value;
}
}
}
public string? GetValue(string section, string key)
{
if (Data.TryGetValue(section, out var sectionDict) &&
sectionDict.TryGetValue(key, out var value))
{
return value;
}
return null;
}
public List<string> GetSections()
{
return Data.Keys.ToList();
}
}
public static class DlssHelper
{
private static Dictionary<string, Version> _ngxVersions = FetchVersions();
// Fetches latest versions installed in C:\ProgramData\NVIDIA\NGX\models\ folder
private static Dictionary<string, Version> FetchVersions()
{
Dictionary<string, Version> versions = new Dictionary<string, Version>();
try
{
string ngxDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"NVIDIA\NGX\models\");
string ngxConfigPath = Path.Combine(ngxDataPath, "nvngx_config.txt");
if (!File.Exists(ngxConfigPath))
return versions;
var ini = new IniParser();
ini.Load(ngxConfigPath);
foreach (string section in ini.GetSections())
{
string versionStr = ini.GetValue(section, "app_E658700");
if (string.IsNullOrEmpty(versionStr))
continue;
Version ver = new Version(versionStr.Trim());
versions[section] = ver;
}
}
catch
{
versions.Clear();
}
return versions;
}
public static string GetSnippetLatestVersion(string snippet)
{
if (!_ngxVersions.ContainsKey(snippet))
return "unknown";
return "v" + _ngxVersions[snippet].ToString();
}
public static string ReplaceDlssVersions(string str)
{
if (string.IsNullOrEmpty(str))
return str;
if (str.Contains("${DlssVersion}"))
str = str.Replace("${DlssVersion}", DlssHelper.GetSnippetLatestVersion("dlss").ToString());
if (str.Contains("${DlssgVersion}"))
str = str.Replace("${DlssgVersion}", DlssHelper.GetSnippetLatestVersion("dlssg").ToString());
if (str.Contains("${DlssdVersion}"))
str = str.Replace("${DlssdVersion}", DlssHelper.GetSnippetLatestVersion("dlssd").ToString());
return str;
}
}
}

View File

@@ -0,0 +1,70 @@
using System;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace nspector.Common.Helper
{
public static class GithubVersionHelper
{
// Check latest release info (ignores pre-release versions)
private const string _repoUrl = "https://api.github.com/repos/Orbmu2k/nvidiaProfileInspector/releases/latest";
public static async Task<bool> IsUpdateAvailableAsync()
{
try
{
var currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
using var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(10);
httpClient.DefaultRequestHeaders.Add("User-Agent", "nvidiaProfileInspector/" + currentVersion.ToString());
var response = await httpClient.GetAsync(_repoUrl);
if (!response.IsSuccessStatusCode)
return false;
var content = await response.Content.ReadAsStringAsync();
var tagName = ExtractJsonString(content, "tag_name");
if (string.IsNullOrEmpty(tagName))
return false;
var versionString = tagName.TrimStart('v').Trim();
if (Version.TryParse(versionString, out Version latestVersion))
{
return latestVersion > currentVersion;
}
return false;
}
catch
{
return false;
}
}
private static string ExtractJsonString(string json, string fieldName)
{
var pattern = $"\"{fieldName}\"\\s*:\\s*\"([^\"\\\\]*(\\\\.[^\"\\\\]*)*)\"";
var match = Regex.Match(json, pattern);
if (match.Success)
{
var value = match.Groups[1].Value;
value = value.Replace("\\\"", "\"");
value = value.Replace("\\\\", "\\");
value = value.Replace("\\n", "\n");
value = value.Replace("\\r", "\r");
value = value.Replace("\\t", "\t");
return value;
}
return null;
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
@@ -21,6 +22,10 @@ namespace nspector.Common.Helper
public bool ShowScannedUnknownSettings { get; set; } = false;
public List<string> HiddenSettingGroups { get; set; } = new List<string>();
public bool DisableUpdateCheck { get; set; } = false;
private static string GetSettingsFilename()
{
var fiPortalbleSettings = new FileInfo("settings.xml");

View File

@@ -157,6 +157,11 @@ namespace nspector.Common.Meta
return null;
}
public string GetAlternateNames(uint settingId)
{
return null;
}
public byte[] GetBinaryDefaultValue(uint settingId)
{
return null;

View File

@@ -3,6 +3,7 @@ using nspector.Native.NVAPI2;
using System;
using System.Collections.Generic;
using System.Linq;
using nspector.Common.Helper;
namespace nspector.Common.Meta
{
@@ -42,13 +43,19 @@ namespace nspector.Common.Meta
}
}
private string ProcessNameReplacements(string friendlyName)
{
// Apply string version replacements here before settings are fully loaded, so that string-to-value mappings can be preserved
return DlssHelper.ReplaceDlssVersions(friendlyName);
}
public string GetSettingName(uint settingId)
{
var setting = customSettings.Settings
.FirstOrDefault(x => x.SettingId.Equals(settingId));
if (setting != null)
return setting.UserfriendlyName;
return ProcessNameReplacements(setting.UserfriendlyName);
return null;
}
@@ -86,7 +93,7 @@ namespace nspector.Common.Meta
{
ValuePos = i++,
Value = x.SettingValue,
ValueName = _source == SettingMetaSource.CustomSettings ? x.UserfriendlyName : DrsUtil.GetDwordString(x.SettingValue) + " " + x.UserfriendlyName,
ValueName = _source == SettingMetaSource.CustomSettings ? ProcessNameReplacements(x.UserfriendlyName) : DrsUtil.GetDwordString(x.SettingValue) + " " + ProcessNameReplacements(x.UserfriendlyName),
}).ToList();
}
@@ -111,6 +118,14 @@ namespace nspector.Common.Meta
return null;
}
public string GetAlternateNames(uint settingId)
{
var setting = customSettings.Settings
.FirstOrDefault(x => x.SettingId.Equals(settingId));
return setting?.AlternateNames;
}
public byte[] GetBinaryDefaultValue(uint settingId)
{
return null;
@@ -126,6 +141,21 @@ namespace nspector.Common.Meta
var setting = customSettings.Settings
.FirstOrDefault(x => x.SettingId.Equals(settingId));
if (DrsSettingsServiceBase.DriverVersion > 0)
{
if (DrsSettingsServiceBase.DriverVersion > 425.31 && (settingId & 0xFF000000) == 0x70000000)
return true; // 3D vision settings removed after 425.31
if (setting == null)
return false;
if (setting.MinRequiredDriverVersion > 0 && setting.MinRequiredDriverVersion > DrsSettingsServiceBase.DriverVersion)
return true;
if (setting.MaxRequiredDriverVersion > 0 && setting.MaxRequiredDriverVersion < DrsSettingsServiceBase.DriverVersion)
return true;
}
return setting?.Hidden ?? false;
}

View File

@@ -201,6 +201,11 @@ namespace nspector.Common.Meta
return null;
}
public string GetAlternateNames(uint settingId)
{
return null;
}
public byte[] GetBinaryDefaultValue(uint settingId)
{
var settingMeta = GetSettingsMeta(settingId);

View File

@@ -16,6 +16,8 @@ namespace nspector.Common.Meta
string GetGroupName(uint settingId);
string GetAlternateNames(uint settingId);
uint? GetDwordDefaultValue(uint settingId);
string GetStringDefaultValue(uint settingId);

View File

@@ -43,6 +43,11 @@ namespace nspector.Common.Meta
return null;
}
public string GetAlternateNames(uint settingId)
{
return null;
}
public uint? GetDwordDefaultValue(uint settingId)
{
return null;

View File

@@ -9,6 +9,8 @@ namespace nspector.Common.Meta
public string GroupName { get; set; }
public string AlternateNames { get; set; }
public string SettingName { get; set; }
public string DefaultStringValue { get; set; }

View File

@@ -21,6 +21,8 @@
public string GroupName { get; set; }
public string AlternateNames { get; set; }
public SettingState State { get; set; }
public bool IsStringValue { get; set; }

View File

@@ -6,13 +6,14 @@
<HexSettingID>0x10E41E01</HexSettingID>
<GroupName>5 - Common</GroupName>
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
<Description>If enabled, overrides DLSS with the latest global version installed (${DlssVersion}).\r\nNVIDIA periodically push OTA updates for the global version, though it often lags behind the actual latest available online.\r\nOnly DLSS2+ games support the global override, certain games may also disallow using it.</Description>
<SettingValues>
<CustomSettingValue>
<UserfriendlyName>Off</UserfriendlyName>
<HexValue>0x00000000</HexValue>
</CustomSettingValue>
<CustomSettingValue>
<UserfriendlyName>On - DLSS overridden by latest available</UserfriendlyName>
<UserfriendlyName>On - DLSS overridden by latest installed (${DlssVersion})</UserfriendlyName>
<HexValue>0x00000001</HexValue>
</CustomSettingValue>
</SettingValues>
@@ -23,13 +24,14 @@
<HexSettingID>0x10E41E02</HexSettingID>
<GroupName>5 - Common</GroupName>
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
<Description>If enabled, overrides DLSS-RR with the latest global version installed (${DlssdVersion}).\r\nNVIDIA periodically push OTA updates for the global version, though it often lags behind the actual latest available online.\r\nOnly DLSS2+ games support the global override, certain games may also disallow using it.</Description>
<SettingValues>
<CustomSettingValue>
<UserfriendlyName>Off</UserfriendlyName>
<HexValue>0x00000000</HexValue>
</CustomSettingValue>
<CustomSettingValue>
<UserfriendlyName>On - DLSS-RR overridden by latest available</UserfriendlyName>
<UserfriendlyName>On - DLSS-RR overridden by latest installed (${DlssdVersion})</UserfriendlyName>
<HexValue>0x00000001</HexValue>
</CustomSettingValue>
</SettingValues>
@@ -40,13 +42,14 @@
<HexSettingID>0x10E41E03</HexSettingID>
<GroupName>5 - Common</GroupName>
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
<Description>If enabled, overrides DLSS-FG with the latest global version installed (${DlssgVersion}).\r\nNVIDIA periodically push OTA updates for the global version, though it often lags behind the actual latest available online.\r\nOnly DLSS2+ games support the global override, certain games may also disallow using it.</Description>
<SettingValues>
<CustomSettingValue>
<UserfriendlyName>Off</UserfriendlyName>
<HexValue>0x00000000</HexValue>
</CustomSettingValue>
<CustomSettingValue>
<UserfriendlyName>On - DLSS-FG overridden by latest available</UserfriendlyName>
<UserfriendlyName>On - DLSS-FG overridden by latest installed (${DlssgVersion})</UserfriendlyName>
<HexValue>0x00000001</HexValue>
</CustomSettingValue>
</SettingValues>
@@ -156,7 +159,7 @@
<HexValue>0x00000004</HexValue>
</CustomSettingValue>
<CustomSettingValue>
<UserfriendlyName>Preset E (unused)</UserfriendlyName>
<UserfriendlyName>Preset E</UserfriendlyName>
<HexValue>0x00000005</HexValue>
</CustomSettingValue>
<CustomSettingValue>
@@ -1508,6 +1511,7 @@
<UserfriendlyName>rBAR - Enable</UserfriendlyName>
<HexSettingID>0x000F00BA</HexSettingID>
<GroupName>5 - Common</GroupName>
<AlternateNames>ReBAR - Enable, Resizable Bar - Enable</AlternateNames>
<SettingValues>
<CustomSettingValue>
<UserfriendlyName>Disabled</UserfriendlyName>
@@ -1523,30 +1527,35 @@
<UserfriendlyName>rBAR - Options</UserfriendlyName>
<HexSettingID>0x000F00BB</HexSettingID>
<GroupName>5 - Common</GroupName>
<AlternateNames>ReBAR - Options, Resizable Bar - Options</AlternateNames>
<DataType>DWORD</DataType>
</CustomSetting>
<CustomSetting>
<UserfriendlyName>rBAR - Intel CPU Exclusion</UserfriendlyName>
<HexSettingID>0x00E942FC</HexSettingID>
<GroupName>5 - Common</GroupName>
<AlternateNames>ReBAR - Intel CPU Exclusion, Resizable Bar - Intel CPU Exclusion</AlternateNames>
<DataType>DWORD</DataType>
</CustomSetting>
<CustomSetting>
<UserfriendlyName>rBAR - Size Limit</UserfriendlyName>
<HexSettingID>0x000F00FF</HexSettingID>
<GroupName>5 - Common</GroupName>
<AlternateNames>ReBAR - Size Limit, Resizable Bar - Size Limit</AlternateNames>
<DataType>BINARY</DataType>
</CustomSetting>
<CustomSetting>
<UserfriendlyName>rBAR - Flags (0x000F00BE)</UserfriendlyName>
<HexSettingID>0x000F00BE</HexSettingID>
<GroupName>8 - Extra</GroupName>
<AlternateNames>ReBAR - Flags (0x000F00BE), Resizable Bar - Flags (0x000F00BE)</AlternateNames>
<DataType>DWORD</DataType>
</CustomSetting>
<CustomSetting>
<UserfriendlyName>rBAR - Flags (0x000F00BF)</UserfriendlyName>
<HexSettingID>0x000F00BF</HexSettingID>
<GroupName>8 - Extra</GroupName>
<AlternateNames>ReBAR - Flags (0x000F00BF), Resizable Bar - Flags (0x000F00BF)</AlternateNames>
<DataType>DWORD</DataType>
</CustomSetting>
@@ -1612,6 +1621,7 @@
<UserfriendlyName>SLI - CFR Mode</UserfriendlyName>
<HexSettingID>0x20343843</HexSettingID>
<GroupName>6 - SLI</GroupName>
<MaxRequiredDriverVersion>575.00</MaxRequiredDriverVersion> <!-- Removed between 511.79 and R575 -->
</CustomSetting>
<CustomSetting>
<UserfriendlyName>Ansel - Enabled</UserfriendlyName>
@@ -7439,6 +7449,7 @@
<UserfriendlyName>SLI - Compatibility Bits (OGL)</UserfriendlyName>
<HexSettingID>0x209746C1</HexSettingID>
<GroupName>1 - Compatibility</GroupName>
<MaxRequiredDriverVersion>511.78</MaxRequiredDriverVersion> <!-- Removed before 511.79 -->
<SettingValues/>
</CustomSetting>
<CustomSetting>
@@ -8196,6 +8207,7 @@
<UserfriendlyName>Multi-Display / Mixed-GPU Acceleration</UserfriendlyName>
<HexSettingID>0x200AEBFC</HexSettingID>
<GroupName>5 - Common</GroupName>
<MaxRequiredDriverVersion>511.78</MaxRequiredDriverVersion> <!-- Removed before 511.79 -->
<SettingValues>
<CustomSettingValue>
<UserfriendlyName>Single display performance mode</UserfriendlyName>
@@ -8303,6 +8315,7 @@
<UserfriendlyName>Vulkan/OpenGL Present Method - Flags</UserfriendlyName>
<HexSettingID>0x20324987</HexSettingID>
<GroupName>2 - Sync and Refresh</GroupName>
<AlternateNames>OGL_DX_PRESENT_DEBUG</AlternateNames>
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
<SettingValues>
<CustomSettingValue>

View File

@@ -344,7 +344,8 @@ namespace nspector.Native.NVAPI2
[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)]
internal struct NVDRS_APPLICATION_V3
{
public uint isMetro { get { return ((uint)((bitvector1 & 1))); } set { bitvector1 = ((uint)((value | bitvector1))); } }
public bool isMetro { get { return (bitvector1 & 1) != 0; } set { if (value) bitvector1 |= 1; else bitvector1 &= ~1u; } }
public bool isCommandLine { get { return (bitvector1 & 2) != 0; } set { if (value) bitvector1 |= 2; else bitvector1 &= ~2u; } }
public uint version;
public uint isPredefined;
@@ -359,6 +360,27 @@ namespace nspector.Native.NVAPI2
private uint bitvector1;
}
[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)]
internal struct NVDRS_APPLICATION_V4
{
public bool isMetro { get { return (bitvector1 & 1) != 0; } set { if (value) bitvector1 |= 1; else bitvector1 &= ~1u; } }
public bool isCommandLine { get { return (bitvector1 & 2) != 0; } set { if (value) bitvector1 |= 2; else bitvector1 &= ~2u; } }
public uint version;
public uint isPredefined;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]
public string appName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]
public string userFriendlyName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]
public string launcher;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]
public string fileInFolder;
private uint bitvector1;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]
public string commandLine;
}
[StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Unicode)]
internal struct NVDRS_PROFILE
{
@@ -388,7 +410,8 @@ namespace nspector.Native.NVAPI2
public static uint NVDRS_APPLICATION_VER_V1 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V1>(1);
public static uint NVDRS_APPLICATION_VER_V2 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V2>(2);
public static uint NVDRS_APPLICATION_VER_V3 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V3>(3);
public static uint NVDRS_APPLICATION_VER = NVDRS_APPLICATION_VER_V3;
public static uint NVDRS_APPLICATION_VER_V4 = MAKE_NVAPI_VERSION<NVDRS_APPLICATION_V4>(4);
public static uint NVDRS_APPLICATION_VER = NVDRS_APPLICATION_VER_V4;
public static uint NVDRS_PROFILE_VER = MAKE_NVAPI_VERSION<NVDRS_PROFILE>(1);
public const uint OGL_IMPLICIT_GPU_AFFINITY_NUM_VALUES = 1;
@@ -549,11 +572,11 @@ namespace nspector.Native.NVAPI2
public static readonly DRS_GetNumProfilesDelegate DRS_GetNumProfiles;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate NvAPI_Status DRS_CreateApplicationDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V3 pApplication);
public delegate NvAPI_Status DRS_CreateApplicationDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V4 pApplication);
public static readonly DRS_CreateApplicationDelegate DRS_CreateApplication;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate NvAPI_Status DRS_DeleteApplicationExDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V3 pApp);
public delegate NvAPI_Status DRS_DeleteApplicationExDelegate(IntPtr hSession, IntPtr hProfile, ref NVDRS_APPLICATION_V4 pApp);
public static readonly DRS_DeleteApplicationExDelegate DRS_DeleteApplicationEx;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -561,7 +584,7 @@ namespace nspector.Native.NVAPI2
public static readonly DRS_DeleteApplicationDelegate DRS_DeleteApplication;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate NvAPI_Status DRS_GetApplicationInfoDelegate(IntPtr hSession, IntPtr hProfile, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref NVDRS_APPLICATION_V3 pApplication);
public delegate NvAPI_Status DRS_GetApplicationInfoDelegate(IntPtr hSession, IntPtr hProfile, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref NVDRS_APPLICATION_V4 pApplication);
public static readonly DRS_GetApplicationInfoDelegate DRS_GetApplicationInfo;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -587,7 +610,7 @@ namespace nspector.Native.NVAPI2
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate NvAPI_Status DRS_FindApplicationByNameDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref IntPtr phProfile, ref NVDRS_APPLICATION_V3 pApplication);
public delegate NvAPI_Status DRS_FindApplicationByNameDelegate(IntPtr hSession, [MarshalAs(UnmanagedType.LPWStr, SizeConst = (int)NvapiDrsWrapper.NVAPI_UNICODE_STRING_MAX)]StringBuilder appName, ref IntPtr phProfile, ref NVDRS_APPLICATION_V4 pApplication);
public static readonly DRS_FindApplicationByNameDelegate DRS_FindApplicationByName;
public static NvAPI_Status DRS_SetSetting(IntPtr hSession, IntPtr hProfile, ref NVDRS_SETTING pSetting)

View File

File diff suppressed because it is too large Load Diff

View File

@@ -93,18 +93,18 @@
//
// pbMain
//
this.pbMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
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(22, 877);
this.pbMain.Margin = new System.Windows.Forms.Padding(7);
this.pbMain.Location = new System.Drawing.Point(12, 475);
this.pbMain.Margin = new System.Windows.Forms.Padding(4);
this.pbMain.Name = "pbMain";
this.pbMain.Size = new System.Drawing.Size(1540, 17);
this.pbMain.Size = new System.Drawing.Size(840, 9);
this.pbMain.TabIndex = 19;
//
// tsMain
//
this.tsMain.AllowMerge = false;
this.tsMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.tsMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tsMain.AutoSize = false;
this.tsMain.BackgroundImage = global::nspector.Properties.Resources.transparent16;
@@ -136,11 +136,10 @@
this.tsSep6,
this.tsbApplyProfile});
this.tsMain.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
this.tsMain.Location = new System.Drawing.Point(22, 7);
this.tsMain.Location = new System.Drawing.Point(12, 4);
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(1540, 46);
this.tsMain.Size = new System.Drawing.Size(840, 25);
this.tsMain.TabIndex = 24;
this.tsMain.Text = "toolStrip1";
//
@@ -149,7 +148,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(86, 39);
this.tslProfiles.Size = new System.Drawing.Size(49, 18);
this.tslProfiles.Text = "Profiles:";
//
// cbProfiles
@@ -161,7 +160,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(528, 38);
this.cbProfiles.Size = new System.Drawing.Size(290, 23);
this.cbProfiles.SelectedIndexChanged += new System.EventHandler(this.cbProfiles_SelectedIndexChanged);
this.cbProfiles.TextChanged += new System.EventHandler(this.cbProfiles_TextChanged);
//
@@ -172,7 +171,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(44, 40);
this.tsbModifiedProfiles.Size = new System.Drawing.Size(36, 22);
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);
@@ -181,7 +180,7 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 46);
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// tsbRefreshProfile
//
@@ -189,7 +188,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(40, 40);
this.tsbRefreshProfile.Size = new System.Drawing.Size(24, 22);
this.tsbRefreshProfile.Text = "Refresh current profile.";
this.tsbRefreshProfile.Click += new System.EventHandler(this.tsbRefreshProfile_Click);
//
@@ -199,7 +198,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(40, 40);
this.tsbRestoreProfile.Size = new System.Drawing.Size(24, 22);
this.tsbRestoreProfile.Text = "Restore current profile to NVIDIA defaults.";
this.tsbRestoreProfile.Click += new System.EventHandler(this.tsbRestoreProfile_Click);
//
@@ -209,7 +208,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(40, 40);
this.tsbCreateProfile.Size = new System.Drawing.Size(24, 22);
this.tsbCreateProfile.Text = "Create new profile";
this.tsbCreateProfile.Click += new System.EventHandler(this.tsbCreateProfile_Click);
//
@@ -219,14 +218,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(40, 40);
this.tsbDeleteProfile.Size = new System.Drawing.Size(24, 22);
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, 46);
this.tsSep2.Size = new System.Drawing.Size(6, 25);
//
// tsbAddApplication
//
@@ -234,7 +233,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(40, 40);
this.tsbAddApplication.Size = new System.Drawing.Size(24, 22);
this.tsbAddApplication.Text = "Add application to current profile.";
this.tsbAddApplication.Click += new System.EventHandler(this.tsbAddApplication_Click);
//
@@ -244,7 +243,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(44, 40);
this.tssbRemoveApplication.Size = new System.Drawing.Size(36, 22);
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);
@@ -252,7 +251,7 @@
// tsSep3
//
this.tsSep3.Name = "tsSep3";
this.tsSep3.Size = new System.Drawing.Size(6, 46);
this.tsSep3.Size = new System.Drawing.Size(6, 25);
//
// tsbExportProfiles
//
@@ -265,35 +264,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(44, 40);
this.tsbExportProfiles.Size = new System.Drawing.Size(36, 22);
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(602, 40);
this.exportCurrentProfileOnlyToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
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(602, 40);
this.exportCurrentProfileIncludingPredefinedSettingsToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
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(602, 40);
this.exportUserdefinedProfilesToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
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(602, 40);
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(343, 22);
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Text = "Export all driver profiles (NVIDIA Text Format)";
this.exportAllProfilesNVIDIATextFormatToolStripMenuItem.Click += new System.EventHandler(this.exportAllProfilesNVIDIATextFormatToolStripMenuItem_Click);
//
@@ -306,28 +305,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(44, 40);
this.tsbImportProfiles.Size = new System.Drawing.Size(36, 22);
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(639, 40);
this.importProfilesToolStripMenuItem.Size = new System.Drawing.Size(363, 22);
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(639, 40);
this.importAllProfilesNVIDIATextFormatToolStripMenuItem.Size = new System.Drawing.Size(363, 22);
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, 46);
this.tsSep4.Size = new System.Drawing.Size(6, 25);
//
// tscbShowCustomSettingNamesOnly
//
@@ -336,14 +335,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(40, 40);
this.tscbShowCustomSettingNamesOnly.Size = new System.Drawing.Size(24, 22);
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, 46);
this.tsSep5.Size = new System.Drawing.Size(6, 25);
//
// tscbShowScannedUnknownSettings
//
@@ -353,7 +352,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(40, 40);
this.tscbShowScannedUnknownSettings.Size = new System.Drawing.Size(24, 22);
this.tscbShowScannedUnknownSettings.Text = "Show unknown settings from NVIDIA predefined profiles";
this.tscbShowScannedUnknownSettings.Click += new System.EventHandler(this.tscbShowScannedUnknownSettings_Click);
//
@@ -363,14 +362,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(40, 40);
this.tsbBitValueEditor.Size = new System.Drawing.Size(24, 22);
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, 46);
this.tsSep6.Size = new System.Drawing.Size(6, 25);
//
// tsbApplyProfile
//
@@ -379,7 +378,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(173, 40);
this.tsbApplyProfile.Size = new System.Drawing.Size(109, 22);
this.tsbApplyProfile.Text = "Apply changes";
this.tsbApplyProfile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.tsbApplyProfile.Click += new System.EventHandler(this.tsbApplyProfile_Click);
@@ -389,25 +388,25 @@
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(1342, 323);
this.btnResetValue.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
this.btnResetValue.Location = new System.Drawing.Point(732, 175);
this.btnResetValue.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
this.btnResetValue.Name = "btnResetValue";
this.btnResetValue.Size = new System.Drawing.Size(46, 35);
this.btnResetValue.Size = new System.Drawing.Size(25, 19);
this.btnResetValue.TabIndex = 7;
this.btnResetValue.UseVisualStyleBackColor = true;
this.btnResetValue.Click += new System.EventHandler(this.btnResetValue_Click);
//
// lblApplications
//
this.lblApplications.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.lblApplications.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
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(22, 59);
this.lblApplications.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblApplications.Location = new System.Drawing.Point(12, 32);
this.lblApplications.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblApplications.Name = "lblApplications";
this.lblApplications.Size = new System.Drawing.Size(1540, 31);
this.lblApplications.Size = new System.Drawing.Size(840, 17);
this.lblApplications.TabIndex = 25;
this.lblApplications.Text = "fsagame.exe, bond.exe, herozero.exe";
this.lblApplications.DoubleClick += new System.EventHandler(this.tsbAddApplication_Click);
@@ -446,10 +445,10 @@
//
this.cbValues.BackColor = System.Drawing.SystemColors.Window;
this.cbValues.FormattingEnabled = true;
this.cbValues.Location = new System.Drawing.Point(961, 323);
this.cbValues.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.cbValues.Location = new System.Drawing.Point(524, 175);
this.cbValues.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cbValues.Name = "cbValues";
this.cbValues.Size = new System.Drawing.Size(129, 32);
this.cbValues.Size = new System.Drawing.Size(72, 21);
this.cbValues.TabIndex = 5;
this.cbValues.Visible = false;
this.cbValues.SelectedValueChanged += new System.EventHandler(this.cbValues_SelectedValueChanged);
@@ -457,40 +456,40 @@
//
// lblWidth96
//
this.lblWidth96.Location = new System.Drawing.Point(141, 430);
this.lblWidth96.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth96.Location = new System.Drawing.Point(77, 233);
this.lblWidth96.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth96.Name = "lblWidth96";
this.lblWidth96.Size = new System.Drawing.Size(176, 33);
this.lblWidth96.Size = new System.Drawing.Size(96, 18);
this.lblWidth96.TabIndex = 77;
this.lblWidth96.Text = "96";
this.lblWidth96.Visible = false;
//
// lblWidth330
//
this.lblWidth330.Location = new System.Drawing.Point(141, 388);
this.lblWidth330.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth330.Location = new System.Drawing.Point(77, 210);
this.lblWidth330.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth330.Name = "lblWidth330";
this.lblWidth330.Size = new System.Drawing.Size(605, 41);
this.lblWidth330.Size = new System.Drawing.Size(330, 22);
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(141, 497);
this.lblWidth16.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth16.Location = new System.Drawing.Point(77, 269);
this.lblWidth16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth16.Name = "lblWidth16";
this.lblWidth16.Size = new System.Drawing.Size(29, 33);
this.lblWidth16.Size = new System.Drawing.Size(16, 18);
this.lblWidth16.TabIndex = 79;
this.lblWidth16.Text = "16";
this.lblWidth16.Visible = false;
//
// lblWidth30
//
this.lblWidth30.Location = new System.Drawing.Point(141, 463);
this.lblWidth30.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.lblWidth30.Location = new System.Drawing.Point(77, 251);
this.lblWidth30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblWidth30.Name = "lblWidth30";
this.lblWidth30.Size = new System.Drawing.Size(55, 33);
this.lblWidth30.Size = new System.Drawing.Size(30, 18);
this.lblWidth30.TabIndex = 80;
this.lblWidth30.Text = "30";
this.lblWidth30.Visible = false;
@@ -506,16 +505,17 @@
this.lvSettings.GridLines = true;
this.lvSettings.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lvSettings.HideSelection = false;
this.lvSettings.Location = new System.Drawing.Point(0, 29);
this.lvSettings.Margin = new System.Windows.Forms.Padding(7);
this.lvSettings.Location = new System.Drawing.Point(0, 0);
this.lvSettings.Margin = new System.Windows.Forms.Padding(4);
this.lvSettings.MultiSelect = false;
this.lvSettings.Name = "lvSettings";
this.lvSettings.ShowItemToolTips = true;
this.lvSettings.Size = new System.Drawing.Size(1540, 661);
this.lvSettings.Size = new System.Drawing.Size(840, 372);
this.lvSettings.SmallImageList = this.ilListView;
this.lvSettings.TabIndex = 2;
this.lvSettings.UseCompatibleStateImageBehavior = false;
this.lvSettings.View = System.Windows.Forms.View.Details;
this.lvSettings.GroupStateChanged += new System.EventHandler<nspector.GroupStateChangedEventArgs>(this.lvSettings_GroupStateChanged);
this.lvSettings.ColumnWidthChanging += new System.Windows.Forms.ColumnWidthChangingEventHandler(this.lvSettings_ColumnWidthChanging);
this.lvSettings.SelectedIndexChanged += new System.EventHandler(this.lvSettings_SelectedIndexChanged);
this.lvSettings.DoubleClick += new System.EventHandler(this.lvSettings_DoubleClick);
@@ -540,47 +540,49 @@
// tbSettingDescription
//
this.tbSettingDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tbSettingDescription.Location = new System.Drawing.Point(0, 690);
this.tbSettingDescription.Margin = new System.Windows.Forms.Padding(6);
this.tbSettingDescription.Location = new System.Drawing.Point(0, 372);
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(1540, 78);
this.tbSettingDescription.Size = new System.Drawing.Size(840, 44);
this.tbSettingDescription.TabIndex = 81;
this.tbSettingDescription.Visible = false;
//
// pnlListview
//
this.pnlListview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
this.pnlListview.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)));
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(22, 96);
this.pnlListview.Margin = new System.Windows.Forms.Padding(6);
this.pnlListview.Location = new System.Drawing.Point(12, 52);
this.pnlListview.Name = "pnlListview";
this.pnlListview.Size = new System.Drawing.Size(1540, 768);
this.pnlListview.Size = new System.Drawing.Size(840, 416);
this.pnlListview.TabIndex = 82;
//
// txtFilter
//
//
this.txtFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtFilter.Dock = System.Windows.Forms.DockStyle.Top;
this.txtFilter.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtFilter.Location = new System.Drawing.Point(0, 0);
this.txtFilter.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.txtFilter.Name = "txtFilter";
this.txtFilter.Size = new System.Drawing.Size(1540, 29);
this.txtFilter.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.txtFilter.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.txtFilter.Size = new System.Drawing.Size(2118, 35);
this.txtFilter.TabIndex = 82;
this.txtFilter.WatermarkText = "Search for setting...";
this.txtFilter.TextChanged += new System.EventHandler(this.txtFilter_TextChanged);
this.txtFilter.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtFilter_KeyUp);
//
// frmDrvSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 22F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1584, 908);
this.ClientSize = new System.Drawing.Size(864, 492);
this.Controls.Add(this.pnlListview);
this.Controls.Add(this.lblWidth30);
this.Controls.Add(this.lblWidth16);
@@ -591,8 +593,8 @@
this.Controls.Add(this.pbMain);
this.Controls.Add(this.btnResetValue);
this.Controls.Add(this.cbValues);
this.Margin = new System.Windows.Forms.Padding(7);
this.MinimumSize = new System.Drawing.Size(1592, 585);
this.Margin = new System.Windows.Forms.Padding(4);
this.MinimumSize = new System.Drawing.Size(879, 346);
this.Name = "frmDrvSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "nSpector - Driver Profile Settings";

View File

@@ -14,7 +14,6 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static nspector.ListViewEx;
namespace nspector
{
@@ -40,7 +39,9 @@ namespace nspector
public string _CurrentProfile = "";
private bool isDevMode = false;
private bool _isDevMode = false;
private UserSettings _settings = null;
protected override void WndProc(ref Message m)
{
@@ -79,7 +80,9 @@ namespace nspector
{
var group = FindOrCreateGroup(setting.GroupName);
var settingName = isDevMode ? $"0x{setting.SettingId:X8} {setting.SettingText}" : setting.SettingText;
var settingName = _isDevMode ? $"0x{setting.SettingId:X8} {setting.SettingText}" : setting.SettingText;
if (setting.IsSettingHidden)
settingName = "[H] " + settingName;
var item = new ListViewItem(settingName);
item.Tag = setting.SettingId;
@@ -154,14 +157,28 @@ namespace nspector
_currentProfileSettingItems = _drs.GetSettingsForProfile(_CurrentProfile, GetSettingViewMode(), ref applications);
RefreshApplicationsCombosAndText(applications);
var searchFilter = txtFilter.Text.Trim();
foreach (var settingItem in _currentProfileSettingItems)
{
if (settingItem.IsSettingHidden) continue;
if (settingItem.IsSettingHidden && !_isDevMode) continue;
var item = CreateListViewItem(settingItem);
// Apply search filter if set
if (!string.IsNullOrEmpty(searchFilter) &&
item.Text.IndexOf(searchFilter, StringComparison.OrdinalIgnoreCase) < 0 &&
(settingItem.AlternateNames == null ||
settingItem.AlternateNames.IndexOf(searchFilter, StringComparison.OrdinalIgnoreCase) < 0))
{
continue;
}
lvSettings.Items.Add(item);
var itm = lvSettings.Items.Add(CreateListViewItem(settingItem));
if (Debugger.IsAttached && !settingItem.IsApiExposed)
{
itm.ForeColor = Color.LightCoral;
item.ForeColor = Color.LightCoral;
}
}
@@ -180,13 +197,13 @@ namespace nspector
foreach (ListViewGroup group in lvSettings.Groups)
{
if (_groupCollapsedStates.TryGetValue(group.Header, out bool isCollapsed))
if (_settings.HiddenSettingGroups.Contains(group.Header))
{
lvSettings.SetGroupState(group, isCollapsed ? ListViewGroupState.Collapsed | ListViewGroupState.Collapsible : ListViewGroupState.Normal | ListViewGroupState.Collapsible);
lvSettings.SetGroupState(group, ListViewGroupState.Collapsed | ListViewGroupState.Collapsible);
}
else
{
lvSettings.SetGroupState(group, ListViewGroupState.Collapsible);
lvSettings.SetGroupState(group, ListViewGroupState.Normal | ListViewGroupState.Collapsible);
}
}
@@ -209,7 +226,6 @@ namespace nspector
}
}
}
}
private void RefreshProfilesCombo()
@@ -285,7 +301,11 @@ namespace nspector
var referenceSettings = DrsServiceLocator.ReferenceSettings?.Settings.FirstOrDefault(s => s.SettingId == settingid);
if (string.IsNullOrEmpty(settingMeta.Description) && !(referenceSettings?.HasConstraints ?? false))
var description = DlssHelper.ReplaceDlssVersions(settingMeta.Description);
if (!string.IsNullOrEmpty(settingMeta.AlternateNames))
description = $"Alternate names: {settingMeta.AlternateNames}\r\n{description}";
if (string.IsNullOrEmpty(description) && !(referenceSettings?.HasConstraints ?? false))
{
tbSettingDescription.Text = "";
tbSettingDescription.Visible = false;
@@ -293,7 +313,7 @@ namespace nspector
}
else
{
tbSettingDescription.Text = settingMeta.Description;
tbSettingDescription.Text = description.Replace("\\r\\n", "\r\n");
tbSettingDescription.Visible = true;
tbSettingDescription.BackColor = (referenceSettings?.HasConstraints ?? false) ? Color.LightCoral : SystemColors.Control;
}
@@ -507,13 +527,13 @@ namespace nspector
}
}
private void SetTitleVersion()
private void SetTitleVersion(bool isUpdateAvailable = false)
{
var numberFormat = new NumberFormatInfo() { NumberDecimalSeparator = "." };
var version = Assembly.GetExecutingAssembly().GetName().Version;
var version = Assembly.GetExecutingAssembly().GetName().Version.ToString() + (isUpdateAvailable ? " (update available on GitHub)" : "");
var fileVersionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
var externalCsn = DrsServiceLocator.IsExternalCustomSettings ? " - CSN OVERRIDE!" : "";
Text = $"{Application.ProductName} {version} - Geforce {_drs.DriverVersion.ToString("#.00", numberFormat)} - Profile Settings - {fileVersionInfo.LegalCopyright}{externalCsn}";
Text = $"{Application.ProductName} {version} - Geforce {DrsSettingsServiceBase.DriverVersion.ToString("#.00", numberFormat)} - Profile Settings - {fileVersionInfo.LegalCopyright}{externalCsn}";
}
private static void InitMessageFilter(IntPtr handle)
@@ -537,6 +557,8 @@ namespace nspector
{
_skipScan = skipScan;
InitializeComponent();
lblApplications.Text = "";
InitTaskbarList();
SetupDropFilesNative();
SetupToolbar();
@@ -545,68 +567,8 @@ namespace nspector
tscbShowCustomSettingNamesOnly.Checked = showCsnOnly;
Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
lvSettings.GroupStateChanged += lvSettings_GroupStateChanged;
LoadGroupStates(Path.Combine(AppContext.BaseDirectory, "HiddenGroups.ini"));
}
private Dictionary<string, bool> _groupCollapsedStates = new();
private void lvSettings_GroupStateChanged(object sender, GroupStateChangedEventArgs e)
{
_groupCollapsedStates[e.Group.Header] = e.IsCollapsed;
SaveGroupStates(Path.Combine(AppContext.BaseDirectory, "HiddenGroups.ini"));
}
private bool SaveGroupStates(string filePath)
{
try
{
using (var writer = new StreamWriter(filePath))
{
foreach (var kvp in _groupCollapsedStates)
{
writer.WriteLine($"{kvp.Key}={kvp.Value}");
}
}
return true;
}
catch
{
return false;
}
}
private bool LoadGroupStates(string filePath)
{
_groupCollapsedStates.Clear();
if (!File.Exists(filePath))
return false;
try
{
foreach (var line in File.ReadAllLines(filePath))
{
int lastEqualIndex = line.LastIndexOf('=');
if (lastEqualIndex != -1)
{
var key = line.Substring(0, lastEqualIndex).Trim();
var valueStr = line.Substring(lastEqualIndex + 1).Trim();
if (bool.TryParse(valueStr, out bool value))
{
_groupCollapsedStates[key] = value;
}
}
}
return true;
}
catch
{
return false;
}
// KeyUp has to be set on the inner control for us to receive Enter key...
cbProfiles.Control.KeyUp += cbProfiles_KeyUp;
}
public static double ScaleFactor = 1;
@@ -663,7 +625,7 @@ namespace nspector
tsbModifiedProfiles.Enabled = true;
}
private void frmDrvSettings_Load(object sender, EventArgs e)
private async void frmDrvSettings_Load(object sender, EventArgs e)
{
SetupLayout();
SetTitleVersion();
@@ -678,6 +640,39 @@ namespace nspector
tssbRemoveApplication.Enabled = false;
InitResetValueTooltip();
await CheckForUpdatesAsync();
}
private async Task CheckForUpdatesAsync()
{
// Allow disabling update check in case user doesn't want us to access internet, or just wants to stick to a certain version
if (_settings.DisableUpdateCheck || File.Exists(Path.Combine(AppContext.BaseDirectory, "DisableUpdateCheck.txt")))
return;
try
{
bool updateAvailable = await GithubVersionHelper.IsUpdateAvailableAsync();
if (updateAvailable)
{
SetTitleVersion(updateAvailable);
}
}
catch
{
// Ignore update check failures
}
}
private void lvSettings_GroupStateChanged(object sender, GroupStateChangedEventArgs e)
{
if (e.IsCollapsed && !_settings.HiddenSettingGroups.Contains(e.Group.Header))
_settings.HiddenSettingGroups.Add(e.Group.Header);
else if (!e.IsCollapsed && _settings.HiddenSettingGroups.Contains(e.Group.Header))
_settings.HiddenSettingGroups.Remove(e.Group.Header);
SaveSettings();
}
private void InitResetValueTooltip()
@@ -707,16 +702,12 @@ namespace nspector
DeleteSelectedValue();
else
ResetSelectedValue();
ApplySearchFilter();
}
ToolTip appPathsTooltip = new ToolTip() { InitialDelay = 250 };
private void ChangeCurrentProfile(string profileName)
{
txtFilter.Text = "";
if (profileName == GetBaseProfileName() || profileName == _baseProfileName)
{
_CurrentProfile = _baseProfileName;
@@ -728,13 +719,15 @@ namespace nspector
}
else
{
_CurrentProfile = cbProfiles.Text;
_CurrentProfile = profileName;
tsbDeleteProfile.Enabled = true;
tsbAddApplication.Enabled = true;
tssbRemoveApplication.Enabled = true;
appPathsTooltip.SetToolTip(lblApplications, "Double-click to add application");
}
txtFilter.Text = "";
RefreshCurrentProfile();
}
@@ -744,6 +737,26 @@ namespace nspector
{
ChangeCurrentProfile(cbProfiles.Text);
}
lvSettings.Focus(); // Unfocus cbProfiles to fix toolstrip hover highlight
}
private void cbProfiles_KeyUp(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
// KeyUp event is only fired when combobox item doesn't exist with the entered text
// Try searching for text as an exe/application name
try
{
var profile = _drs.GetProfileNameByExeName(cbProfiles.Text);
if (!string.IsNullOrEmpty(profile))
{
cbProfiles.Text = profile;
ChangeCurrentProfile(profile);
}
}
catch { }
}
}
private void SetTaskbarProgress(int progress)
@@ -921,8 +934,6 @@ namespace nspector
catch { }
StoreChangesOfProfileToDriver();
ApplySearchFilter();
}
private void tsbBitValueEditor_Click(object sender, EventArgs e)
@@ -1001,7 +1012,7 @@ namespace nspector
}
else if (MessageBox.Show(this, "Really delete this profile?\r\n\r\nNote: NVIDIA predefined profiles can not be restored until next driver installation!", "Delete Profile", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
{
if (_drs.DriverVersion > 280 && _drs.DriverVersion < 310)
if (DrsSettingsServiceBase.DriverVersion > 280 && DrsSettingsServiceBase.DriverVersion < 310)
// hack for driverbug
_drs.DeleteProfileHard(_CurrentProfile);
else
@@ -1276,7 +1287,6 @@ namespace nspector
return;
}
var profileName = "";
var exeFile = ShortcutResolver.ResolveExecuteable(files[0], out profileName);
if (exeFile != "")
@@ -1306,7 +1316,7 @@ namespace nspector
private void lvSettings_DoubleClick(object sender, EventArgs e)
{
if (isDevMode && lvSettings.SelectedItems != null && lvSettings.SelectedItems.Count == 1)
if (_isDevMode && lvSettings.SelectedItems != null && lvSettings.SelectedItems.Count == 1)
{
var settingId = ((uint)lvSettings.SelectedItems[0].Tag);
var settingName = lvSettings.SelectedItems[0].Text;
@@ -1334,36 +1344,36 @@ namespace nspector
private void SaveSettings()
{
var settings = UserSettings.LoadSettings();
if(_settings == null)
_settings = UserSettings.LoadSettings();
if (WindowState == FormWindowState.Normal)
{
settings.WindowTop = Top;
settings.WindowLeft = Left;
settings.WindowHeight = Height;
settings.WindowWidth = Width;
_settings.WindowTop = Top;
_settings.WindowLeft = Left;
_settings.WindowHeight = Height;
_settings.WindowWidth = Width;
}
else
{
settings.WindowTop = RestoreBounds.Top;
settings.WindowLeft = RestoreBounds.Left;
settings.WindowHeight = RestoreBounds.Height;
settings.WindowWidth = RestoreBounds.Width;
_settings.WindowTop = RestoreBounds.Top;
_settings.WindowLeft = RestoreBounds.Left;
_settings.WindowHeight = RestoreBounds.Height;
_settings.WindowWidth = RestoreBounds.Width;
}
settings.WindowState = WindowState;
settings.ShowCustomizedSettingNamesOnly = tscbShowCustomSettingNamesOnly.Checked;
settings.ShowScannedUnknownSettings = tscbShowScannedUnknownSettings.Checked;
settings.SaveSettings();
_settings.WindowState = WindowState;
_settings.ShowCustomizedSettingNamesOnly = tscbShowCustomSettingNamesOnly.Checked;
_settings.ShowScannedUnknownSettings = tscbShowScannedUnknownSettings.Checked;
_settings.SaveSettings();
}
private void LoadSettings()
{
var settings = UserSettings.LoadSettings();
SetBounds(settings.WindowLeft, settings.WindowTop, settings.WindowWidth, settings.WindowHeight);
WindowState = settings.WindowState != FormWindowState.Minimized ? settings.WindowState : FormWindowState.Normal;
_settings = UserSettings.LoadSettings();
SetBounds(_settings.WindowLeft, _settings.WindowTop, _settings.WindowWidth, _settings.WindowHeight);
WindowState = _settings.WindowState != FormWindowState.Minimized ? _settings.WindowState : FormWindowState.Normal;
HandleScreenConstraints();
tscbShowCustomSettingNamesOnly.Checked = settings.ShowCustomizedSettingNamesOnly;
tscbShowScannedUnknownSettings.Checked = !_skipScan && settings.ShowScannedUnknownSettings;
tscbShowCustomSettingNamesOnly.Checked = _settings.ShowCustomizedSettingNamesOnly;
tscbShowScannedUnknownSettings.Checked = !_skipScan && _settings.ShowScannedUnknownSettings;
}
private void frmDrvSettings_FormClosed(object sender, FormClosedEventArgs e)
@@ -1381,7 +1391,7 @@ namespace nspector
else if (e.Control && e.Alt && e.KeyCode == Keys.D)
{
EnableDevmode();
ToggleDevMode();
}
else if (Debugger.IsAttached && e.Control && e.KeyCode == Keys.T)
@@ -1396,106 +1406,57 @@ namespace nspector
else if (e.KeyCode == Keys.Escape)
{
txtFilter.Text = "";
RefreshCurrentProfile();
}
else if (!e.Control && (e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z ||
e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9 ||
e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9 ||
e.KeyCode == Keys.Space || e.KeyCode == Keys.OemPeriod))
e.KeyCode == Keys.Space || e.KeyCode == Keys.OemPeriod ||
e.KeyCode == Keys.Back))
{
txtFilter.Visible = true;
txtFilter.Focus();
txtFilter.Text += e.Shift ? e.KeyCode.ToString() : e.KeyCode.ToString().ToLower();
if (e.KeyCode == Keys.Back)
{
if (txtFilter.Text.Length > 0)
{
txtFilter.Text = txtFilter.Text.Substring(0, txtFilter.Text.Length - 1);
}
}
else
{
txtFilter.Text += e.Shift ? e.KeyCode.ToString() : e.KeyCode.ToString().ToLower();
}
txtFilter.SelectionStart = txtFilter.Text.Length;
e.SuppressKeyPress = true;
e.Handled = true;
}
}
private CancellationTokenSource cts;
private void ApplySearchFilter(CancellationTokenSource cts = null)
{
var lowerInput = txtFilter.Text.Trim().ToLowerInvariant();
if (cts != null && cts.Token.IsCancellationRequested) return;
Invoke(new Action(() =>
{
RefreshCurrentProfile();
if (string.IsNullOrEmpty(lowerInput))
{
return;
}
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 async void txtFilter_TextChanged(object sender, EventArgs e)
{
cts?.Cancel();
cts = new CancellationTokenSource();
try
{
await Task.Delay(250, cts.Token); // search filter can be slow, wait for user to stop typing for ~250ms before we start refresh
if (cts.Token.IsCancellationRequested) return;
await Task.Run(() =>
{
ApplySearchFilter(cts);
});
}
catch (TaskCanceledException)
{
// Ignore cancellation
}
}
private void txtFilter_TextChangedD(object sender, EventArgs e)
{
RefreshCurrentProfile();
if (string.IsNullOrEmpty(txtFilter.Text.Trim()))
{
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
if(!string.IsNullOrEmpty(txtFilter.Text))
txtFilter.Focus(); // Setting listbox sometimes steals focus away
}
private void EnableDevmode()
private void ToggleDevMode()
{
isDevMode = true;
lvSettings.Font = new Font("Consolas", 9);
cbValues.Font = new Font("Consolas", 9);
lvSettings.HeaderStyle = ColumnHeaderStyle.Nonclickable;
_isDevMode = !_isDevMode;
if (_isDevMode)
{
lvSettings.Font = new Font("Consolas", 9);
cbValues.Font = new Font("Consolas", 9);
lvSettings.HeaderStyle = ColumnHeaderStyle.Nonclickable;
}
else
{
lvSettings.Font = null;
cbValues.Font = null;
lvSettings.HeaderStyle = ColumnHeaderStyle.None;
}
RefreshCurrentProfile();
}
@@ -1580,6 +1541,18 @@ namespace nspector
Clipboard.SetText(sbSettings.ToString());
}
private void txtFilter_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
txtFilter.Text = "";
}
else if (e.Control && e.Alt && e.KeyCode == Keys.D)
{
ToggleDevMode();
}
}
}
}

View File

@@ -123,6 +123,7 @@
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
@@ -135,7 +136,9 @@
<Compile Include="Common\DrsSessionScope.cs" />
<Compile Include="Common\DrsSettingsMetaService.cs" />
<Compile Include="Common\DrsUtil.cs" />
<Compile Include="Common\Helper\DlssHelper.cs" />
<Compile Include="Common\Helper\DropDownMenuScrollWheelHandler.cs" />
<Compile Include="Common\Helper\GithubVersionHelper.cs" />
<Compile Include="Common\Helper\ListViewGroupSorter.cs" />
<Compile Include="Common\Helper\ShortcutResolver.cs" />
<Compile Include="Common\Helper\SteamAppResolver.cs" />