Merge pull request #2857 from mRemoteNG/copilot/fix-default-panel-opening

Fix Update panel auto-loading on startup
This commit is contained in:
Dimitrij
2025-10-07 20:14:21 +01:00
committed by GitHub
5 changed files with 27 additions and 8 deletions

View File

@@ -84,10 +84,8 @@ namespace mRemoteNG.App
try
{
await _appUpdate.GetUpdateInfoAsync();
if (_appUpdate.IsUpdateAvailable())
{
Windows.Show(WindowType.Update);
}
// Update is available, but don't show the panel automatically at startup
// User can check for updates manually via Help > Check for Updates menu
}
catch (Exception ex)
{

View File

@@ -26,7 +26,7 @@ namespace mRemoteNG.App
internal static ConfigWindow ConfigForm { get; set; } = new ConfigWindow();
internal static ErrorAndInfoWindow ErrorsForm { get; set; } = new ErrorAndInfoWindow();
private static UpdateWindow UpdateForm { get; set; } = new UpdateWindow();
internal static UpdateWindow UpdateForm { get; set; } = new UpdateWindow();
internal static SSHTransferWindow SshtransferForm { get; private set; } = new SSHTransferWindow();
internal static OptionsWindow OptionsFormWindow { get; private set; }

View File

@@ -215,9 +215,14 @@ namespace mRemoteNG.UI.Forms.OptionsPages
InitialiseCheckForUpdatesOnStartupComboBox();
}
private void btnUpdateCheckNow_Click(object sender, EventArgs e)
private async void btnUpdateCheckNow_Click(object sender, EventArgs e)
{
App.Windows.Show(WindowType.Update);
var updateWindow = App.Windows.UpdateForm;
if (updateWindow != null && !updateWindow.IsDisposed)
{
await updateWindow.PerformUpdateCheckAsync();
}
}
private void chkUseProxyForAutomaticUpdates_CheckedChanged(object sender, EventArgs e)

View File

@@ -145,7 +145,15 @@ namespace mRemoteNG.UI.Menu
#region Info
private void mMenToolsUpdate_Click(object sender, EventArgs e) => App.Windows.Show(WindowType.Update);
private async void mMenToolsUpdate_Click(object sender, EventArgs e)
{
App.Windows.Show(WindowType.Update);
var updateWindow = App.Windows.UpdateForm;
if (updateWindow != null && !updateWindow.IsDisposed)
{
await updateWindow.PerformUpdateCheckAsync();
}
}
private void mMenInfoHelp_Click(object sender, EventArgs e) => Process.Start("explorer.exe", GeneralAppInfo.UrlDocumentation);

View File

@@ -35,6 +35,15 @@ namespace mRemoteNG.UI.Window
FontOverrider.FontOverride(this);
}
/// <summary>
/// Checks for updates and displays the results in the window.
/// Call this method when you want to trigger an update check.
/// </summary>
public async Task PerformUpdateCheckAsync()
{
await CheckForUpdateAsync();
}
#endregion
#region Form Stuff
@@ -44,7 +53,6 @@ namespace mRemoteNG.UI.Window
ApplyTheme();
ThemeManager.getInstance().ThemeChanged += ApplyTheme;
ApplyLanguage();
await CheckForUpdateAsync();
}
private new void ApplyTheme()