Commit graph

10255 commits

Author SHA1 Message Date
Daniel Johnson c20aad4fbb Extend the search with '-' as a negation operator 2024-05-12 17:36:06 -07:00
Daniel Johnson c1082ab94a Replace split with a tokenization function that knows about quotations 2024-05-12 17:36:06 -07:00
Daniel Johnson e555175d91 Add 'hidden:maybe' support. This is just too cute to resist.
'installed:maybe' is also useful; you can override the UI menu settings with these.

'hidden:maybe' is useful to show hidden and non-hidden together.

You can use 'maybe' with other components, but it does nothing useful for them.
2024-05-12 17:36:06 -07:00
Daniel Johnson 8da7d719e3 Add 'hidden:yes/no' to the search
Also, make hidden and installed override the menu-based settings, so they can be used from the Game view freely.

This does mean doing less of the search in SQL, but I suspect this won't be a problem.
2024-05-12 17:36:06 -07:00
Daniel Johnson 1856e5e466 Add 'favorite:yes/no' to search for favorites. 2024-05-12 17:36:06 -07:00
Daniel Johnson cbd0e78653 Provide access to the search components; lazy load the predicates.
This should support editing searches later, even editing invalid ones.
2024-05-12 17:36:06 -07:00
Daniel Johnson f2c056be6d Add searches for 'runner:' and 'platform:' 2024-05-12 17:36:06 -07:00
Daniel Johnson d4d3959b05 Use a case-insensitive category name in the search.
More or less; SQLite COLLATE NOCASE is apparently crappy, but it's better than nothing.
2024-05-12 17:36:06 -07:00
Daniel Johnson fcfcdf8af5 Add additional game searches 'categorized:true/false' and 'category:x' to search categories.
Sadly the category is case-sensitive for now.
2024-05-12 17:36:06 -07:00
Daniel Johnson 901b5a0309 Create RunnerSearch and use it to search runners
This means you can now search for installed (or non-installed) runners. Yay!
2024-05-12 17:36:06 -07:00
Daniel Johnson 3cf7f28095 Generalize the BaseSearch class so it can work with non-games and without a service.
To do this, I've put a reference to the service in GameSearch as a field.
2024-05-12 17:36:06 -07:00
Daniel Johnson 1250dcbb84 Put search classes into search.py 2024-05-12 17:36:06 -07:00
Daniel Johnson 59b621a925 Break out a base class for searches that aren't of games.
I'm thinking runner search!
2024-05-12 17:36:06 -07:00
Daniel Johnson 8173d4098a Crude first cut at an "installed:yes/no" search term.
This sort of works, but sometimes the same game is both installed and not somehow.
2024-05-12 17:36:06 -07:00
Daniel Johnson b9cfaed683 Split game search logic into separate predicates, simplify the __init__ method. 2024-05-12 17:36:06 -07:00
Daniel Johnson 1bb998cda2 Generalize installer check so it works on non-service games and is clearer. 2024-05-12 17:36:06 -07:00
Daniel Johnson 5e93cac3ac Move the filter_games() matching logic into a new class GameSearch. 2024-05-12 17:36:06 -07:00
Daniel Johnson ce49b92904 Move the generation count out of NotificationSource.
This is used in only one place, and does not really fit with the argument-passing fire() method we have now, so I'll move it.
2024-05-12 08:41:52 -04:00
Daniel Johnson 189c02bf43 At last, Game can stop being a GObject. 2024-05-12 07:11:00 -04:00
Daniel Johnson b8af800c96 Convert "game-error" to a NotificationSource as well. 2024-05-12 07:07:53 -04:00
Daniel Johnson 2235a3d192 Convert "game-unhandled-error" to a NotificationSource 2024-05-12 06:50:01 -04:00
Daniel Johnson 26b1c33fc9 Convert "game-installed" into a NotificationSource 2024-05-12 06:43:56 -04:00
Daniel Johnson 4449dc8415 Convert "game-updated" into a NotificationSource.
I've also put MoveDialog into a separate module to break a circular dependency.
2024-05-12 06:40:28 -04:00
Daniel Johnson ace302a809 Convert "game-stopped" to a NotificationSource 2024-05-12 06:30:01 -04:00
Daniel Johnson c6bf26bb95 OK, PR #5421 looks nice to me, but it is not moving. Let's get Game.py off of GObject.
This commit replaces the game-start and game-started signals with NotificationSource.
2024-05-12 05:56:35 -04:00
Daniel Johnson cb147ee18e Move notification source to use registration objects.
This lets us avoid having to have None checks; we can initialize registration fields to EMPTY_NOTIFICATION_REGISTRATION and we can then blindly unregister them with no problems if they were never registered.
2024-05-12 05:49:48 -04:00
Daniel Johnson 28e5d2e35a Ubisoft YAML search should return its (None, None) signal value if any of the various keys or indices it looks for are missing.
Resolves #5469
2024-05-11 19:32:57 -04:00
Daniel Johnson 80fdb19c02 Change default 'Installed Games Only' to show those games in a new install.
I think default was flipped by commit 01340c3499, and it looks like it's just a bug.

But with the new library-sync feature, which we guide users towards, the Lutris service is now gone, so 'Installed Games Only' effectively hides what used to be the Lutris service. I see this confusing users on Discord at least.

This only affects new installations of Lutris; the saved setting is still respected.
2024-05-11 05:56:13 -04:00
nierozec c833cd8853 Added foot terminal support 2024-05-08 14:14:01 -07:00
Daniel Johnson 6fc1684afb Keep an extra file in ~/.cache/lutris when in the process of logging in with WebConnectDialog; is_authenticated() is then false when this file is present, so even though we have cookies at this time, Lutris won't think we're already authenticated.
This means if you just close out of the WebConnectDialog, you are not considered to be logged in anyway- this extra file remains in that case.

Should help with #5406
2024-05-04 08:57:54 -04:00
Daniel Johnson f3218bddc8 When you click Refresh on a source but are no longer connected, let's log you out and back in; this will ask for new credentials and then reload anyway.
Should help with #5406
2024-05-04 08:21:02 -04:00
Daniel Johnson 59ed0335f0 Turns out pefile leaves attributes off entirely if the data wasn't found in the PE file; I'll add a check for that.
Also, index() does not return None, it raises an exception. I'll add handling for that case too.

Resolves #5460
2024-05-01 17:16:54 -04:00
Frost Core 31dfcd281d Fixed incorrect package manager in the OpenSUSE Note 2024-04-29 16:54:36 -07:00
Daniel Johnson cce8ef7ef0 Make SteamInstaller not a GObject and change it to use NotificationSource instead of signals. 2024-04-29 19:37:17 -04:00
Daniel Johnson 070d1f0837 BaseService is no longer a GObject. 2024-04-29 19:37:17 -04:00
Daniel Johnson f61df62c0a Replace BaseService signals with NotificationSource objects.
Also, extend NotificationSource to pass through arguments from the fire method.

This way, we can have global notifications and pass the service as an argument.
2024-04-29 19:37:17 -04:00
Mathieu Comandon f213290c89 Fix Steam Flatpak check 2024-04-29 16:21:38 -07:00
Daniel Johnson f7a47ffecd Use display_error() instead of ErrorDialog whenever handling an exception.
This will also special cases like KeyError to be handled specially.
2024-04-28 19:16:47 -04:00
Daniel Johnson bcbb95ff3f Move the error handlers dict into the dialogs module, so we can just use it wherever we had been using ErrorDialog.
This lets us display special dialogs (or at least special messages) for particular exceptions.
2024-04-28 19:12:46 -04:00
Daniel Johnson 8b6654a62a Fix KeyError handler so that it reports the traceback. 2024-04-28 18:54:22 -04:00
Daniel Johnson 245959c492 Move some of the idle_add() calls to scheduled_at_idle to simplify unscheduling. 2024-04-28 09:51:55 -04:00
Daniel Johnson 094fe7ad3f Update remaining timeout_add() calls to schedule_*_at_idle, except for Game.py where there's an outstanding PR I don't want to break. 2024-04-28 08:13:33 -04:00
Daniel Johnson 79ea234e35 Use word wrap on the results of updates in the preferences dialog
The actual list of updates is just too long for one line.
2024-04-28 07:26:23 -04:00
Daniel Johnson 3e42e79413 Use the IdleTask for the ProgressBox, using during runtime updates.
Also, fix a race in the IdleTask initialization, in case idle_add winds up running its idle function immediately- in this case the task is completed before it can be connected to its source.
2024-04-28 07:20:13 -04:00
Daniel Johnson 409397894a Rename "Unscheduler" to "IdleTask"
This isn't a function anymore, and can do a bit more than just unscheduling the things.
2024-04-28 07:03:03 -04:00
Daniel Johnson 4bc0f830e8 Use schedule_repeating_ functions for progress reporting and such. 2024-04-27 15:03:20 -04:00
Daniel Johnson b3b748cf32 Make remove_unused_categories() more thorough.
This will now delete any game_categories row that are orphaned - that is, are for a game or category that is not there. This will then allow the category itself to go, if all its games have been deleted.
2024-04-27 09:52:55 -04:00
Daniel Johnson 4061105d87 Use schedule_repeating_at_idle() for the heartbeat for installer commands.
Better to use it so it can be tested.
2024-04-27 09:32:29 -04:00
Daniel Johnson 1c231c16f7 Beef up the schedule_at_idle stuff to be more robust and simpler to use, and to avoid using None.
It now supports delay and has a version fo repeating tasks.

It returns an Unscheduler that can stop it from running, but this has interlocks so it is safer to use- it becomes disconnected and harmless after being used or if the task completes, so you can just unschedule all you want - no need to clear out source_id fields.

There's also a COMPLETED_UNSCHEDULER to use instead of None- already disconnected, this can be used when there's nothing to unschedule.

All this, and using this moves away from a direct dependency on GLib.
2024-04-27 09:23:05 -04:00
Daniel Johnson 760b99e708 Fix the fix! Made a type-o in the fix I just did. 2024-04-27 07:54:06 -04:00