Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a copy logs command #1623

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

neilenns
Copy link
Contributor

@neilenns neilenns commented Jan 24, 2024

Fixes #1622

Add a "Copy logs to clipboard" command to the extras menu. Correctly handles the case of no log file being available, or other exceptions that might come up.

Animation

@@ -164,6 +164,20 @@ public LogAppenderFile()
File.Delete(FileName);
}

public void CopyToClipboard()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this here instead of in MainForm.cs so the knowledge of where the file is on disk is contained within the log class.

@@ -67,10 +68,11 @@ private void InitializeUILanguage()

public event EventHandler<ConfigFile> ConfigLoaded;

private readonly LogAppenderFile logAppenderFile = new LogAppenderFile();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This moved out of InitializeLogging() so it's available in the menu click handler.

@@ -20,6 +20,7 @@
using System.Threading.Tasks;
using MobiFlight.InputConfig;
using Newtonsoft.Json;
using System.IO;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required for FileLoadException

Copy link

Build for this pull request:
MobiFlightConnector.zip

@DocMoebiuz DocMoebiuz merged commit 5e13a20 into MobiFlight:main Jan 25, 2024
1 check passed
@DocMoebiuz DocMoebiuz added the feature A new feature label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a menu item to copy log file to clipboard
2 participants