Skip to content

Commit e3385b8

Browse files
committed
Update bloatware selection handling in remover form
Added SelectionChanged event handler to the bloatware list DataGridView to update selected rows dynamically. Improved feedback message for failed app actions and fixed logic to correctly gather selected rows. This enhances user interaction and error reporting in the BloatwareRemoverForm.
1 parent bb229c8 commit e3385b8

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

ATA-GUI/Forms/BloatwareRemoverForm.Designer.cs

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ATA-GUI/Forms/BloatwareRemoverForm.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private void buttonAction_Click(object sender, EventArgs e)
389389
string successMessage = string.Format("Following apps {0}:\n{1}\n{2}",
390390
comboBoxActionMode.Text,
391391
string.Join("\n", listSuccess),
392-
listFailed.Count > 0 ? $"ATA was not able to disable/remove the following apps:\n{string.Join("\n", listFailed)}" : "");
392+
listFailed.Count > 0 ? $"ATA was not able to {comboBoxActionMode.SelectedText} the following apps:\n{string.Join("\n", listFailed)}\nSome system application can be only removed and not disabled" : "");
393393

394394
MainForm.MessageShowBox(successMessage, 2);
395395
Close();
@@ -424,11 +424,11 @@ private void setWantedRows()
424424
{
425425
selectedRows.Clear();
426426

427-
foreach (DataGridViewRow item in dataGridViewBloatwareList.Rows)
427+
foreach (DataGridViewRow row in dataGridViewBloatwareList.SelectedRows)
428428
{
429-
if (item.Visible && item.Selected)
429+
if (row.Visible && !row.IsNewRow)
430430
{
431-
selectedRows.Add(item);
431+
selectedRows.Add(row);
432432
}
433433
}
434434
}
@@ -462,6 +462,9 @@ public async void RefreshList()
462462
await LoadAppAsync();
463463
}
464464

465-
465+
private void dataGridViewBloatwareList_SelectionChanged(object sender, EventArgs e)
466+
{
467+
setWantedRows();
468+
}
466469
}
467470
}

0 commit comments

Comments
 (0)