Commit graph

9502 commits

Author SHA1 Message Date
Daniel Johnson 7627fa47c1 Remove bogus libretro core installation
I don't know if we are supposed to be able to install individual cores, but we have no code to do it, so remove the call that tries to call that missing code.
2023-12-17 14:24:09 -05:00
Daniel Johnson d813b3390e Whoops! I should not have removed this return, it is required. 2023-12-17 13:23:38 -05:00
Daniel Johnson 0eef634bbf Do not attempt to stop the game-process if it is not running.
This makes the stop button switch back to play more promptly.
2023-12-17 09:40:57 -05:00
Daniel Johnson 3dcf146a94
Merge pull request #5190 from mbarrio/master
Updated Spanish translation
2023-12-17 05:36:10 -05:00
Miguel Barrio Orsikowsky 0a58d90fe2 Updated Spanish translation 2023-12-17 11:20:27 +01:00
Daniel Johnson 26d687faff Support reading playtimes in the form "6:32" as well. 2023-12-16 19:41:11 -05:00
Daniel Johnson 818ee07567 Restore the playtime widget.
The text is now formatted as Lutris does in the game bar, and I've added a function to parse this.

It's a bit picky, but should tolerate localization at least.

Resolves #5151
2023-12-16 19:32:08 -05:00
Daniel Johnson 32841b9ab6 Fix up the PCX2 test, so it will work even though PCSX2 is not there.
This isn't as fancy as MagicMock, but I need to stub out a couple of functions in the runner being testing, so MagicMock doesn't work.
2023-12-16 11:27:42 -05:00
Daniel Johnson 553b140b7a And the real fix - when applying launch config, we won't try to extract the runner's command from the existing command line. We'll get it afresh from the runner.
This way, if you are using a flatpak, you can have a command that's several 'args' long, and for Linux it is 0 args log. The launch configs exe and args go on the end of that.

This should fix #5148
2023-12-16 11:04:15 -05:00
Daniel Johnson 0de52b7045 REtouch various runner to call self.get_command() to generate the command line for play(), and in some cases implement that method to provide special stuff.
So, get_command() will return a suitable command for flatpak because the flatpak runner implements it to do so.

Linux returns [] for this now, since no prefix need be added to run a Linux game.

The rest just call get_command() to get the check that their exe exists.
2023-12-16 11:01:47 -05:00
Daniel Johnson 3e38cfdfd8 Change get_command() to throw, not return an empty list, if the runner exe can't be found and flatpak has not got the runner.
[] is no better than None here; all calls try to form command lines and run them, which only works for the Linux runner.
2023-12-16 10:58:48 -05:00
Daniel Johnson 73e17e7af1 Split system.execute() out, with system.execute_with_error() to retrieve stderr separately.
This way we can avoid running 'mame -listxml' twice when if fails.
2023-12-16 09:31:28 -05:00
Daniel Johnson ac98074614 Queue window redraw off the download_media stuff.
When media download completes, we queue an idle function that queues a redraw of all windows. This should generally wind up being a single redraw per window once the drawing finally hits.

This way, you can use AsyncCall to download media and not provide a callback that redraw the windows.
2023-12-16 08:53:08 -05:00
Daniel Johnson af25fafba1 Fix the handling for file-less importers.
If we found no files needed, we should skip ahead past the files page. Since the false return is now lost in the void of AsyncCall.

Instead, we'll just call launch_installer_commands in the callback.
2023-12-16 08:04:57 -05:00
Daniel Johnson a5591be909 Do not fetch the extras twice
This involves a web request, so we want to do it asynchronously. Doing it again synchronously defeats the purpose.
2023-12-16 07:59:17 -05:00
Daniel Johnson 45cfc1a68d Add plain old try-except handling for style_manager.py
The handlers log the error and continue; this prevents Lutris from crashing on startup, but leaves you insensitive to the system-wide dark-theme-light-theme setting.

We already handle errors this way for the TrashPortal.

I suspect the right answer here is to wrap DBus in some more civilized interface that could take care of this. But this commit will help until we figure that out.
2023-12-16 07:01:46 -05:00
Daniel Johnson ae57603254 Fix broken Back button in installerwindow.py.
If found a way to fake a repro; if an exception is handled after the installation starts, it needs to be handled with the error message page. This should not allow the back button at all - once the installation has begun there's no going back. But that page allows 'Back'.

So, turn that button off on that page.
2023-12-16 05:15:58 -05:00
Mathieu Comandon f287dfa072 Load service installers in a background task 2023-12-15 14:57:15 -08:00
Mathieu Comandon 0be4e4a4aa Run media download and shortcut creation in threads 2023-12-15 14:22:09 -08:00
Mathieu Comandon a97a81d3cd Fix most crashes with Wayland + high end mice in InstallerWindow (only one left) 2023-12-15 13:46:43 -08:00
Mathieu Comandon 5678e8cdf7 Remove watch_error usage from InstallerWindow 2023-12-15 12:37:16 -08:00
Mathieu Comandon 2c694d8f16 Revert "Add error handling for style_manager so failures (say, the interface is missing entirely) won't crash Lutris."
This reverts commit 6af136b0b9.
2023-12-15 12:04:27 -08:00
Daniel Johnson 6af136b0b9 Add error handling for style_manager so failures (say, the interface is missing entirely) won't crash Lutris.
You may still be able to engage dark mode, but if this class fails we won't detect the system dark modes settings.
2023-12-15 04:56:33 -05:00
Daniel Johnson e1330b3e9b Capture error output from mame -listxml. 2023-12-14 18:53:59 -05:00
Daniel Johnson bbab68a014 Fix blatant thread-safety error in SearchableCombobox
You can't configure a combo box from a worker thread. And there's no reason to - this is used only for the MAME 'Machine' entry that spawns its own thread to populate a file with the data anyway.
2023-12-14 18:51:00 -05:00
Daniel Johnson 6af123d773 Use lru_cache to avoid running 'flatpak list' over and over.
It's cheap and easy, and it improves performance opening config windows and updating the sidebar.

I also hope it will reduce crashyness.
2023-12-14 17:18:41 -05:00
Daniel Johnson 0e80dc85f1 Fix ineffective game options filter when adding a new game
There's a check that a game must be present, but we really just need a game _box_ to filter.
2023-12-14 16:44:56 -05:00
Daniel Johnson 2b65b971b7 Move the show-in-side-bar option from the system options to the runner options. 2023-12-14 12:01:56 -08:00
Daniel Johnson 3b08f69e2e Fix crash when you hide all runners; the 'Runners' header itself goes away in this case. 2023-12-14 12:01:56 -08:00
Daniel Johnson f4f37a0c40 Add caching for the runner visibility
We need to load each runner configuration, but we only do this for installed runners, and we cache the result until a runner config is changed to minimize performance impact.
2023-12-14 12:01:56 -08:00
Daniel Johnson db0eefb5c0 Add a signal so when a runner configuration is changed we update the sidebar.
This way the visibility flag takes effect as soon as you save the configuration.
2023-12-14 12:01:56 -08:00
Daniel Johnson fa70bb9c6b Add code to filter the sidebar based on the configuration of the runner. 2023-12-14 12:01:56 -08:00
Daniel Johnson f7832ffdde Add a system-level option for runners only to toggle visibility in the sidebar.
I'd make more sense in the "Lutris" section, but I promised to hide it so no-one would ever find it. So it's at the bottom and advanced as well.
2023-12-14 12:01:56 -08:00
Daniel Johnson f26120db3a Enable processing default values for various option types.
Notably, for 'bool' values. This did seem to work, as sometimes defaults got preloaded into the config. But not always, so let's consistently handle defaults for all option types.
2023-12-14 04:54:45 -05:00
Daniel Johnson e072ce8fdc Remove dynamically hidden configuration frames.
The frames around config options no longer disappear when they contain only one options; instead options appear in frames if they have a "section" option set for them, and not if they don't.

Some things don't, but if we want to put every option in a frame, we can do that now.
2023-12-14 04:22:21 -05:00
Daniel Johnson 87f6706a44 Instead of animating a certain amount on each call to animate(), we'll measure the time since the animation started - that should be stabler.
This also means I do not need to use nonlocal, since we don't keep mutable state in captured variables. Hope that makes this code clearer.
2023-12-13 16:29:44 -08:00
Daniel Johnson 58b1401774 Continue the bounciness so long as we're in the STATE_LAUNCHING state.
This is really while the prelaunch stuff is happening; there's no obvious way to wait until the game is really up and running.

Since this is often very quick, the animation will always perform one cycle, even if it goes directly to STATE_RUNNING.
2023-12-13 16:29:44 -08:00
Daniel Johnson a54fab130f First cut at a bouncy animation when a game starts. 2023-12-13 16:29:44 -08:00
Daniel Johnson 8ad4f16e18 Add function signature for prctl() 2023-12-13 16:54:21 -05:00
Daniel Johnson 23ff0e4082 Provide function signatures explicitly for libvulkan.
Without these, ctypes tries to go with var args, which is either sometimes or always broken, depending on the platform.
2023-12-13 16:49:40 -05:00
Daniel Johnson f4f9a12d47 No wait, & is more pythonic than intersection_update! Let's use that! 2023-12-12 20:03:29 -05:00
Daniel Johnson 13c07bd378 Mark section names in sysoptions.py for localization, just like other sections for runners and games. 2023-12-12 18:56:17 -05:00
Daniel Johnson 382d5681d5 Fix "scope" option and restore "Default installation folder"
This was the only option to use the 'scope' feature, and in 0.5.14 it was available in system and runner options, but not games.

This fix restores that behavior.

The trick is to pass the config_level through to the various option boxes, not just the config_section. The first is which dialog you are in (roughly) and the second is which tab.
2023-12-12 18:47:46 -05:00
Daniel Johnson f444a30a19 Make the pid list for a game stricter, so Stop doesn't get innocent processes.
We'll stop the game process (lutris-watcher, I think that is) and also any new process started since the game started, but those are counted only if they have the magic LUTRIS_GAME_UUID env var and also mention the game directory in the command line for the process.

Resolves #5181
2023-12-12 18:34:31 -05:00
Mathieu Comandon 087e235c36 Reverting 0c2d4bb1c3 should stop the crashes on Wayland if my bisect is correct 2023-12-12 02:21:39 -08:00
Mathieu Comandon 5ecfb95717 Remove remaining reference to InstallingDrivers 2023-12-11 20:27:53 -08:00
Daniel Johnson e5e1c64c17 Add two new sizes for itch.io banners
"banner_med" is 60% size (189, 150)
"banner_small" is 30% size (95, 75)

The original (315, 250) is still "banner" for compatibility.
2023-12-11 17:41:20 -08:00
marcin mikołajczak efba4a7a53 Update LINGUAS
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-12-11 16:18:48 -08:00
Marcin Mikołajczak abdbfbe630 po: Add Polish translation
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-12-11 16:18:48 -08:00
Daniel Johnson 9826f8a5fb Beef up the checks on the multi-game game-actions.
Yeah, some of these should not be available for multiple games at once, but better safe than sorry.
2023-12-11 17:05:36 -05:00