diff --git a/NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs b/NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs index c14515bc8c..4366204f75 100644 --- a/NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs +++ b/NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs @@ -16,8 +16,6 @@ namespace NAPS2.EtoForms.Ui; public class WinFormsDesktopForm : DesktopForm { - public static WF.ApplicationContext? ApplicationContext { get; set; } - private readonly Dictionary _menuButtons = new(); private readonly ToolbarFormatter _toolbarFormatter = new(new StringWrapper()); private readonly WF.Form _form; @@ -109,17 +107,6 @@ protected override LayoutElement GetZoomButtons() private WF.ListView NativeListView => ((WinFormsListView) _listView).NativeControl; - protected override void SetMainForm(Form newMainForm) - { - base.SetMainForm(newMainForm); - if (ApplicationContext == null) - { - Log.Error("ApplicationContext should not be null"); - return; - } - ApplicationContext.MainForm = newMainForm.ToSWF(); - } - protected override void SetCulture(string cultureId) { SaveToolStripLocation(); diff --git a/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs b/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs index c6463a9db6..14d6c44857 100644 --- a/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs +++ b/NAPS2.Lib/EtoForms/Ui/DesktopForm.cs @@ -454,7 +454,7 @@ protected virtual void SetCulture(string cultureId) FormStateController.DoSaveFormState(); var newDesktop = FormFactory.Create(); newDesktop.Show(); - SetMainForm(newDesktop); + Application.Instance.MainForm = newDesktop; Close(); } finally @@ -464,11 +464,6 @@ protected virtual void SetCulture(string cultureId) // TODO: If we make any other forms non-modal, we will need to refresh them too } - protected virtual void SetMainForm(Form newMainForm) - { - Application.Instance.MainForm = newMainForm; - } - protected virtual void UpdateToolbar() { // Top-level toolbar items