mirror of
https://github.com/fadden/6502bench.git
synced 2025-07-23 01:24:07 +00:00
Add warning to manual when viewed from web
Added a warning to the index page that only appears when viewing it over http/https. The issue is that the manual on the web reflects the tip-of-tree sources, which may be inaccurate for whatever version the user has. Also, provide an alternate path to opening the manual in-app when under development.
This commit is contained in:
@@ -84,6 +84,17 @@ namespace SourceGen {
|
||||
|
||||
string helpFilePath = Path.Combine(RuntimeDataAccess.GetDirectory(),
|
||||
HELP_DIR, fileName);
|
||||
if (!File.Exists(helpFilePath)) {
|
||||
// Alternate path, used during development. If it also doesn't exist, leave
|
||||
// the original path intact so the error message is useful.
|
||||
string altPath = Path.Combine(RuntimeDataAccess.GetDirectory() +
|
||||
"\\..\\..\\docs\\sgmanual",
|
||||
fileName);
|
||||
altPath = Path.GetFullPath(altPath); // normalize
|
||||
if (File.Exists(altPath)) {
|
||||
helpFilePath = altPath;
|
||||
}
|
||||
}
|
||||
string url = "file://" + helpFilePath;
|
||||
//url = url.Replace("#", "%23");
|
||||
Debug.WriteLine("Requesting help URL: " + url);
|
||||
|
Reference in New Issue
Block a user