mirror of
https://github.com/cyanfish/naps2.git
synced 2024-10-04 19:37:15 +03:00
Disable "Set Default" context menu item when the selected profile is already the default
This commit is contained in:
parent
be7afcae29
commit
2f1e8764dc
@ -238,6 +238,10 @@ namespace NAPS2.WinForms
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctxSetDefault.Enabled = !SelectedProfile.IsDefault;
|
||||
}
|
||||
}
|
||||
|
||||
private void ctxScan_Click(object sender, EventArgs e)
|
||||
@ -257,10 +261,9 @@ namespace NAPS2.WinForms
|
||||
|
||||
private void ctxSetDefault_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lvProfiles.SelectedItems.Count == 1)
|
||||
if (SelectedProfile != null)
|
||||
{
|
||||
int profileIndex = lvProfiles.SelectedItems[0].Index;
|
||||
profileManager.DefaultProfile = profileManager.Profiles[profileIndex];
|
||||
profileManager.DefaultProfile = SelectedProfile;
|
||||
profileManager.Save();
|
||||
|
||||
UpdateProfiles();
|
||||
|
Loading…
Reference in New Issue
Block a user