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

Configurable Help source #948

Open
thrust26 opened this issue Dec 25, 2022 · 9 comments
Open

Configurable Help source #948

thrust26 opened this issue Dec 25, 2022 · 9 comments

Comments

@thrust26
Copy link
Member

Currently all help is provided from the web. It should be possible to configure Stella so that it uses the local help instead.

@thrust26 thrust26 added this to the Prio 2 milestone Dec 25, 2022
@thrust26 thrust26 self-assigned this Dec 25, 2022
@sa666666
Copy link
Member

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.

@thrust26
Copy link
Member Author

Yes, but I suppose we know the defaults. And we can add a browser window which allows the user to correct the defaults.

@sa666666
Copy link
Member

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.

@thrust26
Copy link
Member Author

Would relative paths work?

@sa666666
Copy link
Member

sa666666 commented Dec 25, 2022

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.

@thrust26
Copy link
Member Author

I mean, wouldn't Stella know where its executable is? Or at least the relative path to the docs?

@sa666666
Copy link
Member

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.

@thrust26
Copy link
Member Author

thrust26 commented Dec 26, 2022

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.

@thrust26
Copy link
Member Author

thrust26 commented Dec 26, 2022

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?

@thrust26 thrust26 modified the milestones: Prio 2, Prio 3 Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants