mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
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:
@@ -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
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace mRemoteNG.UI.Tabs
|
||||
if (CTaskDialog.VerificationChecked)
|
||||
{
|
||||
Settings.Default.ConfirmCloseConnection = (int)ConfirmCloseEnum.Never;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
if (result == DialogResult.No)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user