mirror of
https://github.com/Orbmu2k/nvidiaProfileInspector.git
synced 2025-12-23 23:18:07 -05:00
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
This commit is contained in:
1
nspector/frmDrvSettings.Designer.cs
generated
1
nspector/frmDrvSettings.Designer.cs
generated
@@ -408,6 +408,7 @@
|
||||
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.lblApplications_DoubleClick);
|
||||
//
|
||||
// toolStripButton5
|
||||
//
|
||||
|
||||
@@ -1405,6 +1405,38 @@ namespace nspector
|
||||
Clipboard.SetText(sbSettings.ToString());
|
||||
|
||||
}
|
||||
|
||||
private void lblApplications_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
if (_CurrentProfile == GetBaseProfileName() || _CurrentProfile == _baseProfileName)
|
||||
return;
|
||||
if (_CurrentProfile.StartsWith("0x"))
|
||||
return; // monitor/device profile
|
||||
|
||||
var applications = new Dictionary<string, string>();
|
||||
_currentProfileSettingItems = _drs.GetSettingsForProfile(_CurrentProfile, GetSettingViewMode(), ref applications);
|
||||
|
||||
var existingPaths = new HashSet<string>(applications.Values, StringComparer.OrdinalIgnoreCase);
|
||||
var appPath = "";
|
||||
|
||||
if (InputBox.Show("Add App Path", "Enter application path/filename/UWP ID to add to the profile", ref appPath, new List<string>(), "", 2048) == DialogResult.OK)
|
||||
{
|
||||
// Add new application path
|
||||
if (!existingPaths.Contains(appPath))
|
||||
{
|
||||
try
|
||||
{
|
||||
_drs.AddApplication(_CurrentProfile, appPath);
|
||||
}
|
||||
catch (NvapiException ex) // NVAPI_EXECUTABLE_ALREADY_IN_USE etc
|
||||
{
|
||||
MessageBox.Show(ex.Message, "NvAPI Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
RefreshCurrentProfile();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user