mirror of
https://github.com/Orbmu2k/nvidiaProfileInspector.git
synced 2026-05-19 12:25:27 -04:00
Only search by exe name if entered profile name doesn't exist
This was meant to be happening automatically, but seems WinForms also decides to send a KeyUp event with e.KeyCode == Keys.Enter when the user clicks an existing item (?)
This commit is contained in:
@@ -766,18 +766,20 @@ namespace nspector
|
||||
|
||||
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
|
||||
// Search by exe name if the text isn't already a valid profile name
|
||||
if (!_profileNames.Contains(cbProfiles.Text))
|
||||
{
|
||||
var profile = _drs.GetProfileNameByExeName(cbProfiles.Text);
|
||||
if (!string.IsNullOrEmpty(profile))
|
||||
try
|
||||
{
|
||||
cbProfiles.Text = profile;
|
||||
ChangeCurrentProfile(profile);
|
||||
var profile = _drs.GetProfileNameByExeName(cbProfiles.Text);
|
||||
if (!string.IsNullOrEmpty(profile))
|
||||
{
|
||||
cbProfiles.Text = profile;
|
||||
ChangeCurrentProfile(profile);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user