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

Allow to add user games using commands in PATH #131

Closed
neuromancer opened this issue Nov 9, 2018 · 8 comments
Closed

Allow to add user games using commands in PATH #131

neuromancer opened this issue Nov 9, 2018 · 8 comments
Labels

Comments

@neuromancer
Copy link
Contributor

Adding user games that are already in the PATH (e.g using gzdoom) is very awkward with the current UI. You need to browse in /usr/bin and find the executable. It will be easier to allow the user to specify a command line (or browse for the executable file).

@tkashkin
Copy link
Owner

tkashkin commented Nov 9, 2018

I'll probably refactor that a bit and implement entry + file picker combo as a custom widget and use it everywhere.

It will probably be something like what's already implemented for #126.

That should also allow to get rid of some duplicated code.

@tkashkin
Copy link
Owner

@neuromancer test fca3a8a. It should replace every file picker with custom widget (if I haven't forgot to replace it somewhere).
It may be a bit buggy, so it needs some testing.

@neuromancer
Copy link
Contributor Author

It works, but the code to add user games needs some tweaks:

  • It will not look for the command in the $PATH so if I'm using gzdoom, the game won't be added. I have to use /usr/bin/gzdoom, otherwise, it won't work.
  • In some cases (e.g. gzdoom), the directory where it is executed is irrelevant, but it is still required to add a game. Using a sane default like $HOME could be a good idea.

@tkashkin
Copy link
Owner

Did you try to press Enter or unfocus executable entry? It should find executables in $PATH.

else if(allow_executable && text.length > 0)
{
var executable = Utils.find_executable(text);
if(executable != null && executable.query_exists())
{
chooser.select_file(executable);
}
else
{
chooser.select_filename("/usr/bin/" + text);
}
file = chooser.get_file();
file_set();
}

It may be a bit broken though, as I have probably did something wrong in FileChooserEntry.update.

@neuromancer
Copy link
Contributor Author

Did you try to press Enter or unfocus executable entry?

Using tab to change to the next field (arguments) is not triggering the PATH check. However, it will work, if you do it twice. After that, the directory is detected properly (e.g. /usr/bin) and you can add the game.

tkashkin added a commit that referenced this issue Nov 10, 2018
@tkashkin
Copy link
Owner

Should be fixed. It still needs testing though.

@neuromancer
Copy link
Contributor Author

Works great!

Since you fixed that, there is another minor issue that could be related: can you take a look to the "Image URL" field in game properties? It does not update the image if you close the dialog. It only works if you change the field.

@tkashkin
Copy link
Owner

Closing. Reopen if you find any issue with this.

Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Lucki pushed a commit to Lucki/GameHub that referenced this issue Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants