Skip to content

Commit 2c05031

Browse files
Cancel button only enabled when changes made in the "Manually Installed" tab. Implemented for deleting a row.
1 parent b4ac31a commit 2c05031

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/Menu/ContentForm.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public partial class ContentForm : Form
6161
private bool In_dataGridViewManualInstall_SelectionChanged = false;
6262
private bool In_buttonManualInstallAdd_Click = false;
6363

64+
private bool ManualInstallChangesMade = false;
65+
6466
public ContentForm(UserSettings settings, string baseDocumentationUrl)
6567
{
6668
InitializeComponent();
@@ -134,6 +136,7 @@ public ContentForm(UserSettings settings, string baseDocumentationUrl)
134136
dataGridViewManualInstall.Sort(dataGridViewManualInstall.Columns[0], ListSortDirection.Ascending);
135137

136138
ManualInstallBrouwseDir = determineBrowseDir();
139+
buttonCancel.Enabled = false;
137140
}
138141

139142
private void tabControlContent_Selecting(object sender, TabControlCancelEventArgs e)
@@ -147,6 +150,7 @@ private void tabControlContent_Selecting(object sender, TabControlCancelEventArg
147150
case "tabPageManuallyInstall":
148151
dataGridViewManualInstall.Select();
149152
buttonCancel.Show();
153+
buttonCancel.Enabled = ManualInstallChangesMade;
150154
break;
151155
}
152156
}
@@ -1483,6 +1487,8 @@ private void buttonManualInstallDelete_Click(object sender, EventArgs e)
14831487
if (dataGridViewManualInstall.CurrentRow != null)
14841488
{
14851489
dataGridViewManualInstall.Rows.Remove(dataGridViewManualInstall.CurrentRow);
1490+
ManualInstallChangesMade = true;
1491+
buttonCancel.Enabled = ManualInstallChangesMade;
14861492
}
14871493
}
14881494

0 commit comments

Comments
 (0)