Skip to content

Commit

Permalink
Fix unnecessary error log
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Apr 8, 2024
1 parent 41b8959 commit eda3c04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
13 changes: 0 additions & 13 deletions NAPS2.Lib.WinForms/EtoForms/Ui/WinFormsDesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace NAPS2.EtoForms.Ui;

public class WinFormsDesktopForm : DesktopForm
{
public static WF.ApplicationContext? ApplicationContext { get; set; }

private readonly Dictionary<DesktopToolbarMenuType, WF.ToolStripSplitButton> _menuButtons = new();
private readonly ToolbarFormatter _toolbarFormatter = new(new StringWrapper());
private readonly WF.Form _form;
Expand Down Expand Up @@ -109,17 +107,6 @@ protected override LayoutElement GetZoomButtons()

private WF.ListView NativeListView => ((WinFormsListView<UiImage>) _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();
Expand Down
7 changes: 1 addition & 6 deletions NAPS2.Lib/EtoForms/Ui/DesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ protected virtual void SetCulture(string cultureId)
FormStateController.DoSaveFormState();
var newDesktop = FormFactory.Create<DesktopForm>();
newDesktop.Show();
SetMainForm(newDesktop);
Application.Instance.MainForm = newDesktop;
Close();
}
finally
Expand All @@ -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
Expand Down

0 comments on commit eda3c04

Please sign in to comment.