stella
stella copied to clipboard
Configurable Help source
Currently all help is provided from the web. It should be possible to configure Stella so that it uses the local help instead.
Maybe instead of using a web address, it can use the local path instead. The problem here is that it's different for every OS, so that's a complication.
Yes, but I suppose we know the defaults. And we can add a browser window which allows the user to correct the defaults.
We don't know it from within Stella. For Windows at least, the install path is set by the installer (InnoSetup), which is separate from Stella. Similarly in Linux, it's determined by the configure
script. About the only one we know for certain programatically is macOS, since the files are part of the app bundle.
Would relative paths work?
Only if the user doesn't change where Stella is installed, since that happens at install-time, long after Stella has been compiled.
I ran into similar issues with HarmonyCart
software, and where to install the arm
directory and then have the app auto-magically find it. In that case, though, I was using Qt, and it helped with this somewhat. The logic to do this correctly and cross-platform isn't easy.
I mean, wouldn't Stella know where its executable is? Or at least the relative path to the docs?
Not easily in a cross-platform way. Here's the relevant code from the big 3 OS's:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OSystemUNIX::OSystemUNIX()
{
// Hardcoded for now, since that's what the installer always uses
// At some point, it would be better to query the OS directly
myARMPath = "/usr/share/harmonycart/";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OSystemMACOS::OSystemMACOS()
{
QDir dir = QDir(QCoreApplication::applicationDirPath());
dir.cdUp();
dir.cdUp();
dir.cd("arm");
myARMPath = dir.absolutePath();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OSystemWindows::OSystemWindows()
: OSystem()
{
QDir dir = QDir(QCoreApplication::applicationDirPath());
dir.cd("arm");
myARMPath = dir.absolutePath();
}
Windows and macOS are using Qt-specific code, and Linux doesn't even have access to that. I guess we could look at the Qt source and see how it's done there. But that still doesn't solve the problem for Linux.
We either find out or let the user navigate to the correct spot. I suppose he should know were the documentation is, no?
At least for Windows we seem to already have the code (baseinappdir
). Though I have looked into the code yet.
Maybe SDL_GetBasePath
will do for all? Were is the documentation put for Linux and MacOS? In Windows it is simply a subdirectory of the application directory.
I now remember that Windows is having problems passing parameters when opening a file. In our case it will then simply open the doc, but not navigate to the given context. The user can change this behavior by editing the registry, but I suppose that's not feasible here.
How are Linux and MacOS behaving here?