mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
Merge pull request #2857 from mRemoteNG/copilot/fix-default-panel-opening
Fix Update panel auto-loading on startup
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user