Commit graph

9502 commits

Author SHA1 Message Date
Mathieu Comandon f055e65ce0 Check for service_id presence 2024-01-07 17:27:47 -08:00
Daniel Johnson a903b67180 Download missing Lutris media when installing games during service refresh.
This extends sync_media() so it can download for a specific set of games, so we can download only the installed games, not games you had already.

Resolves #4545
2024-01-07 14:40:32 -05:00
Daniel Johnson 8cabab49c7 Disable the 'Show Hidden Games' checkbox when in a service view - we do not implement it there. 2024-01-07 10:33:39 -05:00
Daniel Johnson 0b9dfecb0c Reduce the number of special case checks for the service id 'lutris'. 2024-01-07 10:26:59 -05:00
Daniel Johnson 5ebebf41a6 Fix crash when hiding a game from the Lutris view specifically. 2024-01-07 10:07:07 -05:00
Daniel Johnson 858786decd Whoops; the 'appid' equivalent for the lutris service is the slug, of course. 2024-01-07 09:34:04 -05:00
Daniel Johnson 553db0fb46 Modify the 'installed' property on StoreItem to use the cached installed game data to check for installation.
Saves a database query to do this.
2024-01-07 09:23:13 -05:00
Daniel Johnson 5c26ebb90e Do not fall back to the installed game if the actual game_data has the key, even if it has a blank value. 2024-01-07 09:10:20 -05:00
Daniel Johnson 43489fb071 When loading the game list into the view, use single SQL query to load the installed games.
We generally need them all, and pounding the database over and over for each game *even if it has no installed game counterpart* we cause nasty concurrency issues when reloading the service at the same time.

Instead, we load them and all preload the StoreItem - even if there's no installed game, if the StoreItem knows this, there's no need to fetch that data for that game.
2024-01-07 08:41:23 -05:00
Daniel Johnson acfc74117a Consolidate the end-of-cycle checks for the launch animation. 2024-01-06 13:49:36 -05:00
Daniel Johnson 8b0819fa41 Add some handling so that if we do not understand /proc/driver/nvidia/version we just fall back to glxinfo instead. 2024-01-06 07:29:22 -05:00
Daniel Johnson 6e130124ce Cache NVidia driver info- this should not change while Lutris is running. 2024-01-06 07:17:28 -05:00
Mathieu Comandon fc261bdb0e Add taskmgr in Wine actions 2024-01-05 18:21:19 -08:00
Mathieu Comandon 9b31c55453 Add appid to service game list 2024-01-05 17:08:07 -08:00
Daniel Johnson bd390f2dc5 Since the runner versions dialog OK button does not work while installing, let's disable it at that time. 2024-01-05 18:56:31 -05:00
Daniel Johnson fc10bc01ed We need to reliably fire the completion and error functions from remove_folder.
If the folder being removed is missing, we consider that success, so the next callback needs to run at once.
2024-01-05 17:15:47 -05:00
Daniel Johnson 4d87e85af4 Runniner install dialog needs to handle TrashPortal asynchonous completion.
It should report errors, and should update the UI and clear the wine version cache when the trashifiation is done.
2024-01-05 17:07:47 -05:00
Daniel Johnson 56ad4c4be9 Missed a spot!
Need to get the runner version dialog's title from the runner, not the row.
2024-01-05 17:03:28 -05:00
Mathieu Comandon 70487c1ef9 Disable Lutris runtime for Citra (Conflicts with AppImage) 2024-01-03 21:29:30 -08:00
Mathieu Comandon 0a82b3bef2 Prevent multiplication of JSON runners when starting Lutris while it's already open 2024-01-03 20:59:03 -08:00
Daniel Johnson 91d820d537 Ensure sidebar buttons always use a fresh runner with an up-to-date config 2024-01-03 04:57:00 -05:00
Daniel Johnson f7af4b58c9 Move get_scale_factor() call a little for thread-safety
This is GTK method, so it's not safe to call this off of the main thread.

This fix looks ugly, but I've got a PR to rework this code for more PNG support that will improve this. This will do until that gets merged, I think.
2024-01-03 04:37:10 -05:00
Mathieu Comandon e201a5a638 Fix loading of slots arguments 2024-01-02 21:40:32 -08:00
telanus e6b771ea97 Add slot option for Removable media Slot devices
Add an option that allow the entry of slot devices that is needed on mame's romload
2024-01-02 21:35:28 -08:00
Daniel Johnson bcb36810dd Rework the way extra files are passed through to the installer script.
Instead of passing the extra-ids everwhere and hoping it lines up, we pass them to the installer to generate the InstallerFiles, but it provides the extra files separately.

We can then extract the download destination paths for each extra file we're downloading, and we can put those in the script.

This way, if there are more or fewer files than we expect, it will still work.

This may help with #4974, but it's hard to be sure.
2024-01-02 19:05:57 -05:00
Daniel Johnson a3c237b21f Avoid created the user's custom cache dir- we should only create our own private one if missing. 2024-01-02 04:46:57 -05:00
Daniel Johnson 70c483d8ff Fix issues with the custom cache-dir feature
The None result from get_cache_path() was leaking into the Preferences dialog, so now it never returns None - there's always ~/.cache/lutris/installer to fall back on, after all. A separate function checks if it is even configured.

Also, the sanity check for whether the custom dir even exists was inconsistently applied and would accept a file; it needs to be a directory. So now it checks with os.path.isdir().
2024-01-01 15:28:26 -05:00
Daniel Johnson 009e8cc1f2 service.get_game_platforms() should return an empty list not None; None was checked for, but treated as an empty list anyway. 2024-01-01 12:15:27 -05:00
Daniel Johnson 859b681388 None of the callers of get_runner_module() or import_runner() or import_task() check for None; so use an exception to crash with better style. 2024-01-01 10:28:47 -05:00
Daniel Johnson b047ef688d Add MissingMediaError to replace None returns from various media-loading methods
Some of these had been unchecked and would have failed anyway; others now use exception handling for fallbacks.
2024-01-01 10:19:03 -05:00
Daniel Johnson df3175d91f Replace None-returning method with a pair, one that returns bool and one that always returns a game. 2024-01-01 09:23:51 -05:00
Daniel Johnson f7991b3553 Replace Gio.ListStore with ordinary Python list for the list of running games. 2024-01-01 09:11:50 -05:00
Daniel Johnson 2bee169ed9 Replace None with empty dict; the caller should be able to handle that. 2024-01-01 08:50:40 -05:00
Daniel Johnson 0f8d89b00a Clean up exceptions and give them names ending in 'Error'.
Remove NoScreenDetected; this exception is just an if statement is disguise. We still need to handle GLib.Error though.

Rename ExtractFailure to ExtractError.

Rename AuthTokenExpired to AuthTokenExpiredError, provide a minimal message.

Replace InvalidPid with ValueError with the custom message. This is never caught, and it's misleading - it means the pid given isn't convertible to int, not that it's a valid PID.

Rename UnauthorizedAccess to UnauthorizedAccessError,
2024-01-01 08:40:06 -05:00
Daniel Johnson b6615b68d9 Fixes for ScriptingError; it should still have a message even if the repr(self.fault_data) is falsey. It should be a LutrisError for sure, too.
Remove FileNotAvailable; it's never used.

Rename MissingDependency to MissingGameDependencyError and ensure it has a message. We do put that message in the logs at least! It should be a LutrisError too.
2024-01-01 08:24:23 -05:00
Daniel Johnson 657cefedac Remove UnsupportedProvider error
This is really just an assertion and is pretty useless - we'd crash on the very next line anyway without it.

 But for documentation I'll leave a RuntimeError.
2024-01-01 08:11:48 -05:00
Daniel Johnson 051b031cb2 Remove redundant exception handler.
It's just doing what the backstop does anyway.
2024-01-01 07:40:35 -05:00
Daniel Johnson 165efbd9b1 Provide base classes for runner exceptions.
This way we need not duplicate the __init__ function in each.

Most are just LutrisError subclasses now, but InvalidRunnerError is a MisconfigurationError. I can't see a bogus runner name coming from anywhere but the configuration.
2024-01-01 07:35:27 -05:00
Daniel Johnson fd4a293f07 Rename the exception InvalidRunner to InvalidRunnerError 2024-01-01 07:29:10 -05:00
Daniel Johnson 87273c5bc0 Tighten up the typing of game.runner.
We use game.runner in many places without checking, so returning None is a bad thing here. Better to raise.

For the few places that check, I've added game.has_runner. Also added a few defensing checks and an exception handler for safety.
2024-01-01 07:28:00 -05:00
Daniel Johnson 79a31082d1 Rename "Notification" to a slightly less generic name 2023-12-31 13:02:00 -05:00
Daniel Johnson 81969e5d02 Fix updates of the list view when media are customized or reset
What an ugly mess!

queue_draw() on every window does not work on the ListView, though I don't understand why not.

This replaces that with a notification system so that the views can register callbacks to redraw themselves.

I've added a Notification class to tame this beast, in the hope that this will at least be reusable.
2023-12-31 12:08:58 -05:00
Daniel Johnson 8d665cd92a Slap a CSS class on the Steam accounts frame, so it looks like the other frames we use. 2023-12-31 07:30:45 -05:00
Daniel Johnson ad322eddca Populate the accounts and services pages in Preferences when they are selected.
It's not a big deal for the services, but we don't want a error parsing out the VDF file Steam uses to make Preference unusable.
2023-12-31 07:28:09 -05:00
Daniel Johnson 96413b3465 Generate plurals in a way that can be localized.
Lots of languages don't just append an 's'. And _(f"...") is always wrong- the string in the _() needs to be constant.
2023-12-31 07:12:11 -05:00
Daniel Johnson 88c7f276e5 Remove extra 'except' handler in get_runtime_versions_date(); handle the text in the update dialog with a separate method.
Resolves #5208
2023-12-30 19:25:44 -05:00
Daniel Johnson 53e88741ae
Merge pull request #5207 from gileri/ubisoft-translation
Untranslate Ubisoft connect
2023-12-30 10:11:47 -05:00
Daniel Johnson 030877ab61 Pause the launching animation while a modal dialog is open.
It looks a bit goofy to just cycle the animation while the launch config dialog is open, so we'll pause it.
2023-12-30 10:09:40 -05:00
gileri a02cdc6c4b
Untranslate Ubisoft connect 2023-12-30 16:00:27 +01:00
Daniel Johnson 09345bb284 Fix parse_installer_url() error handling
Returning False for bad URLS sometimes, but not always, is not sensible.

This commit makes it throw ValueError, which is what the only caller did with the False return anyway.
2023-12-30 09:56:14 -05:00