Fix Options page not showing correct ConfirmCloseConnection value

- Add VisibleChanged event handler to ConnectionsPage to reload settings when page becomes visible
- Save settings immediately when user checks "Don't show this message again" checkbox during connection close
- Ensures Options dialog always displays current setting value, even if changed outside the dialog

Co-authored-by: Kvarkas <3611964+Kvarkas@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-16 19:51:02 +00:00
parent 6b52b6b062
commit 01e22740ce
3 changed files with 14 additions and 0 deletions

View File

@@ -29,6 +29,17 @@ namespace mRemoteNG.UI.Forms.OptionsPages
* 1) chkSaveConnectionsAfterEveryEdit: never used
*/
chkSaveConnectionsAfterEveryEdit.Visible = false; // Temporary hide control, never used, added: Jun 15, 2024
// Reload settings when page becomes visible to reflect any changes made outside the Options dialog
VisibleChanged += ConnectionsPage_VisibleChanged;
}
private void ConnectionsPage_VisibleChanged(object sender, EventArgs e)
{
if (Visible)
{
LoadSettings();
}
}
public override string PageName

View File

@@ -56,6 +56,7 @@ namespace mRemoteNG.UI.Tabs
if (CTaskDialog.VerificationChecked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Never;
Settings.Default.Save();
}
if (result == DialogResult.No)

View File

@@ -298,6 +298,7 @@ namespace mRemoteNG.UI.Window
if (CTaskDialog.VerificationChecked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Never;
Settings.Default.Save();
}
if (result == DialogResult.No)
@@ -663,6 +664,7 @@ namespace mRemoteNG.UI.Window
if (CTaskDialog.VerificationChecked)
{
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Never;
Settings.Default.Save();
}
if (result == DialogResult.No)