private void FileBug(object parameter) { string repo = KnownLinks.GitRepoUrl(); if (repo != null) { // NOTE: github claims to support paste for attachments, but it doesn't work so we have to drag and drop a file string fileName = PrepareStatusReportFile(out string tempPath); System.Diagnostics.Process.Start(tempPath); string encoded = Uri.EscapeDataString( $"[Helios has written the report to the file '{fileName}' and opened its containing folder in Explorer. Please drag and drop it from Explorer to here and replace this message with a description of the problem you are reporting.]\n\n"); // launch the default browser string url = $"{repo}issues/new?body={encoded}"; System.Diagnostics.Process.Start(url); } // close dialog if (parameter is IInputElement inputElement) { // fire a close command up the tree from the source of our command so it finds the right window SystemCommands.CloseWindowCommand.Execute(null, inputElement); } }
private void UpdateStatusMessage(Action <string, Uri> updateInfoStatus, Action <string, string, Uri> updateErrorStatus, Action <string> updatePopup) { // centralize all these messages, because they all need to fit in the same space switch (_status) { case StatusValue.Empty: // fall through case StatusValue.License: updateInfoStatus("", null); break; case StatusValue.Running: updateInfoStatus("Running Profile", null); break; case StatusValue.Loading: updateInfoStatus("Loading Profile...", null); break; case StatusValue.LoadError: updateInfoStatus("Error loading Profile", null); break; case StatusValue.RunningVersion: Version ver = RunningVersion.FromHeliosAssembly(); string message = $"Helios {ver.Major}.{ver.Minor}.{ver.Build:0000}.{ver.Revision:0000}"; message += $"\n{KnownLinks.GitRepoUrl() ?? "HeliosVirtualCockpit fork"}"; updateInfoStatus(message, new Uri(KnownLinks.GitRepoUrl())); break; case StatusValue.ProfileVersionHigher: updateErrorStatus( "Cannot display this profile because it was created with a newer version of Helios.", "Please upgrade to the latest version.", null); break; case StatusValue.BadMonitorConfig: updateErrorStatus( "Cannot display this profile because it has an invalid monitor configuration.", "Select reset monitors from the profile menu.", StatusReportItem.ProfileEditor); break; case StatusValue.FailedPreflight: updateErrorStatus( "Failed preflight check.", "Please resolve problems or disable preflight check in preferences.", null ); break; case StatusValue.UpgradeAvailable: updateInfoStatus("New Helios version available; check Console for details", null); break; } }
protected override void OnActivated(EventArgs e) { Version runningVersion = ConfigManager.VersionChecker.RunningVersion; VersionBlock.Text = runningVersion.Major.ToString() + "." + runningVersion.Minor.ToString() + "." + runningVersion.Build.ToString() + "." + runningVersion.Revision.ToString("0000"); AuthorsBlock.Text = string.Join("; ", Authors); ContributionBlock.Text = string.Join("; ", Contributors); StatusBlock.Text = RunningVersion.IsDevelopmentPrototype ? "Development Prototype" : "Released"; ForkBlock.Text = $"Fork: {KnownLinks.GitRepoUrl()}"; base.OnActivated(e); }