1
0
Fork 0
mirror of synced 2024-06-27 18:51:06 +12:00
Commit graph

1539 commits

Author SHA1 Message Date
Stelios Tsampas cda4668486
Update rare/components/tabs/games/game_widgets/game_widget.py
Co-authored-by: multisn8 <contact@multisamplednight.com>
2023-02-20 11:28:53 +02:00
loathingKernel 4ef73b48ef Dialogs: Homogenize dialog titles 2023-02-18 19:36:49 +02:00
loathingKernel e6c703f873 ExtraWidgets: Cleanup some code 2023-02-18 18:16:29 +02:00
loathingKernel dd6df40e40 ExtraWidgets: Remove SideTab widgets and update imports 2023-02-18 17:33:25 +02:00
loathingKernel 5938835249 ExtraWidgets: Remove IndicatorLineEdit and PathEdit and update imports 2023-02-18 17:29:41 +02:00
loathingKernel 97def45a7e Cleanup: Remove some unused imports 2023-02-18 17:27:18 +02:00
loathingKernel ff81f38dd4 Misc: Shellcheck 2023-02-18 17:25:55 +02:00
loathingKernel f8c0ffd938 ExtraWidgets: Copy SideTab widgets into their own file
The new file is unused at the moment
2023-02-18 16:44:09 +02:00
loathingKernel 2d0f7aa51d ExtraWidgets: Copy IndicatorLineEdit and PathEdit into their own file.
The new file is not used at the moment.
2023-02-18 16:40:30 +02:00
loathingKernel ecc1bd8d5c IndicatorLineEdit: Run edit callback function asynchronously
Execute the edit callback function in a thread. By executing it in a thread
we don't have to wait for longer validation procedures to finish to
continue updating the UI. This is most notable in the MoveGamePopUp
which is heavy on disk IO.

Because we cannot use special text formatting in a thread, the
indicator messages have been reworked while also becoming extensible.

A dictionary of extended reasons can be specified through the
`IndicatorLineEdit.extend_reasons()` method.

The dictionary has to follow the following format
```
python
{
	MyIndicatorReasons.REASON: self.tr("Reason message")
	MyIndicatorReasons.OTHER_REASON: self.tr("Other reason message")
}
```

In the above example `MyIndicatorReasons` is a subclass of `IndicatorReasons`
which should be specified as follows

```
python
MyIndicatorReasons(IndicatorReasons):
	REASON = auto()
	OTHER_REASON = auto()
```
2023-02-18 14:37:37 +02:00
loathingKernel 7e4ded70b5 MoveGamePopUp: Don't translate or do any text formatting in path_edit callback function 2023-02-17 13:29:59 +02:00
loathingKernel da49a91a03 Utils: return correct value type string for get_size() 2023-02-17 13:23:44 +02:00
loathingKernel 922b1472dd IconWidget: Fix typo in install_btn css selector 2023-02-17 10:49:34 +02:00
loathingKernel 9b856e5f8e InstallDialog: Allow downloading 0 size DLCs
There are DLCs (for example KingletAztec) which are essentially
entitlements, a single file the allows access to already downloaded
content. Updates for such DLCs only change the metadata version number
without any actual new data. These DLCs are handled correctly by the
DLM, but our dialog would refuse to allow installing them due to 0 download
size. This change allows them to pass through the InstallDialog.

The other issue, which I don't know if it was only a result of our faulty
validation at startup or could occur in legendary too, is that a DLC might
be marked with needing verification. Currently we don't have a way of
verifying DLCs, so when verifying the game, we will also set the same
state for any installed DLCs. In effect verifying the game successfully
will also mark any DLCs as correct.
2023-02-17 10:37:44 +02:00
loathingKernel e9cbdb22bc RareCore: add dequeue_worker() method to RareCore
It will "properly" remove a worker and update the connected widgets.
2023-02-16 17:07:02 +02:00
loathingKernel b405ff615e RareCore: Return a list instead of an iterator to freely use remove() 2023-02-16 16:42:32 +02:00
loathingKernel d8c31a05c2 GamesTab: Remove timing debug message 2023-02-16 16:22:31 +02:00
loathingKernel 5593dfb984 MainWindow: Don't wait for the workers to finish.
Instead ask the user if the queue should be cleared and return to normal execution.
2023-02-16 16:19:52 +02:00
loathingKernel e40cfaafac MainWindow: Implement worker queue in status bar
The active workers are placed in a static container on the left side.
The queued workers are placed in a scrollarea on the right side of the
status bar. The scrollbars are disabled but dragging works.

Exiting with active workers will pop up a message for confirmation. Rare
will clean the queued workers but the active ones will be waited on until
they finish.
2023-02-16 10:52:13 +02:00
loathingKernel f2dedaaefc ElideLabel: Set text on resizeEvent 2023-02-16 10:47:23 +02:00
loathingKernel a438eb764b MoveGamePopUp: Don't refresh indicator on widget.update 2023-02-16 10:46:47 +02:00
loathingKernel e34800cfd3 LibraryWidgets: Remove unused code and use multiline f-strings for css text 2023-02-15 20:40:20 +02:00
loathingKernel 0bd7af3d77 MoveGamePopUp: Use ElideLabel for the warning 2023-02-15 19:58:28 +02:00
loathingKernel 6e4081177d VerifyWorker: Remove unused imports 2023-02-15 19:49:04 +02:00
loathingKernel efcbea91cf MoveGamePopUp: Make the warning label always visible 2023-02-15 19:48:48 +02:00
loathingKernel 6c0663771c GameInfo: Make widgets react to changes from RareGame's widget.update signal
Note: the `__update_widget()` method, while it doesn't have any visible delay
has the potential for improvement. I didn't do it because it felt like
premature optimization.

MoveGamePopUp: update it to use RareGame and it's signals

RareGame: Add `install_path` attribute and change `needs_verification` setter
Now both setters will update the local `igame` attribute and save it too.

MoveWorker: Update it to use RareGame.
Other changes include moving "same-drive" moving into the worker and using
`os.path` methods instead of `PathLib`

SteamGrades: Remove worker, it is implemented in RareGame now.
2023-02-15 16:59:33 +02:00
loathingKernel 034c6f2ade ImageManager: Increase margin on desktop icons
Add size presets for wide covers
2023-02-14 10:21:38 +02:00
loathingKernel 9f408772e3 RareGame: Resolve and cache steam grade 2023-02-14 10:20:59 +02:00
loathingKernel abba86e10b RareGame: Create intermediate class RareGameSlim between RareGameBase and RareGame
The `RareGameSlim` class is useful mostly in the Launcher as it doesn't
depend on `ImageManager`. I should hold anything required by the Launcher.
2023-02-09 01:37:53 +02:00
loathingKernel c0d9e5c845 ImageSize.Preset: Add equality test 2023-02-08 17:09:24 +02:00
loathingKernel 31757840f0 Paths: Use common dictionary for suffixes 2023-02-08 16:47:46 +02:00
loathingKernel 71aa440e0b GameWidget: Use __slots__ to satisfy forward ui declaration
This way `ui` won't get any typing but this is internal and we can
take care of it until a better method is found to satisfy both.
2023-02-08 15:14:50 +02:00
loathingKernel f2490f065b RareGame: Create common base class for RareGame and RareEosOverlay.
It contains some common methods as well as the `State` enumeration
and the `Signals` class.
2023-02-08 15:13:02 +02:00
loathingKernel b36dfdd2c6 ImageManager: Generate shortcut icons when fetching cover images. 2023-02-08 15:08:55 +02:00
loathingKernel 97adb6e1c2 UninstallWorker: Use new shortcut functions to delete shortcuts in uninstall_game 2023-02-08 01:50:00 +02:00
loathingKernel 359157fac3 RareGame: Add property to get the unprocessed save path 2023-02-07 16:02:04 +02:00
loathingKernel 1721677e33 GameWidget: Implement reactive and interactive labels
The `status_label` displays what is currently going on with the game.
It reflects the current operation running on it or if it requires special
attention (update, needs verification etc)

The `tooltip_label` displays hover information such as what happens
if a part of the widget is clicked or in the case of the launch button if
the game can run (without version check, offline etc)

The context menu on the widgets will be updated and populated according
to the installation state of the game. Since the context menu was revised
the shortcut creation code was revised too to make it more compact.

the `create_desktop_link` and `get_rare_executable` functions are moved
from `rare.utils.misc` to `rare.utils.paths` to avoid cyclical imports and
better grouping. Two functions are added, `desktop_link_path` to uniformly
calculate the path of the shortcut and `desktop_links_supported` which
checks if Rare supports creating shortcuts on the current platform.
`desktop_links_supported` should be used as safeguard before `desktop_link_path`.

Desktop links are currently untested on Windows but if `shortcut.Description`
works as expected, it should be good to go.
2023-02-07 13:41:59 +02:00
loathingKernel 2903c19667 Code cleanup 2023-02-07 13:06:08 +02:00
loathingKernel 34a13ea3b2 ApiResults: Mirror the way RareCore from refactor_backend handles non asset items
`LegendaryCore.get_non_asset_library_items()` returns the same tuple
for `game_list, dlc_dict` as for regular games with assets, so
keep the result for API completeness, since `RareGame` can handle those
games properly.
2023-02-07 13:04:33 +02:00
loathingKernel c83ee69914 GamesTab: Populate RareGame.saves at creation based on ApiResults
Remove unused attributes and clean layout code.
2023-02-06 09:45:30 +02:00
loathingKernel 59f5370bef LaunchDialog: Retrieve entitlements in a worker 2023-02-06 09:20:25 +02:00
loathingKernel 211f92d2d6 MainTabWidget: Use returned indices instead of hard-coding disabled tabs
Parent the tabs properly for consistency
2023-02-06 09:19:31 +02:00
loathingKernel 34839d469e Update/QueueGroups: Initialize with hidden container. 2023-02-05 19:41:08 +02:00
loathingKernel 15b80ce72f GamesTab: Move installed and uninstalled signal connection inside LibraryController 2023-02-05 19:14:51 +02:00
loathingKernel ac4060d804 RareGame: Set state before emitting the widget.update signal 2023-02-05 19:13:38 +02:00
loathingKernel 1bbba07c24 RareCore: Mangle _instance class attribute 2023-02-05 19:12:50 +02:00
loathingKernel f9b5385513 DownloadsTab: Paint the background of the active download stats with the image of the game
The Qt Designer UI file for the downloads tab was removed since
the tab is simple enough to be implemented in code now.
2023-02-05 19:12:14 +02:00
loathingKernel 6ee6ce5255 UI: Remove unused store UI files 2023-02-05 19:00:01 +02:00
loathingKernel c0b98978f1 QueueGroup: Also update movement arrows when a widget is deleted 2023-02-04 17:38:07 +02:00
loathingKernel f2745a9551 RareGame: Disable erroneous pylint errors 2023-02-04 17:38:07 +02:00