1
0
Fork 0
mirror of synced 2024-06-03 03:04:42 +12:00
Commit graph

38 commits

Author SHA1 Message Date
loathingKernel 5bf353ec37
Rare: Replace QToolButton with QPushButton
QToolButton is not really designed to be used in the way we did and since
QPushButton supports having a menu attached to, we can replace tool buttons
in most cases.

* Fix the presentation of the TabButtonWidget by updating RareStyle's css

* Reduce the size of the top tab bar to save vertical space.

* Remove infoLabel property
2024-02-21 20:25:03 +02:00
loathingKernel 8dbce8e9f2
Rare: rename icon function to qta_icon 2024-02-21 13:30:41 +02:00
loathingKernel 8a3bdbdd91 Rare: Improve translation handling
* Remove base Qt translations from repo, load translations from Qt itself
* Prefix translation `qm` files with `rare_`.
* Rename `translation_source.ts` to simply `source.ts`
* If the selected language matches the system local, remove the option from the configuration.
2024-02-12 21:52:08 +02:00
loathingKernel 284543a6d9 Rare: Decouple Rare's locale from legendary's
* Instead of using legendary's locale as fallback, use system't locale
as default.
* Do not hardcode language names and countries but use QLocale on
the translation filenames.
2024-02-12 21:52:08 +02:00
loathingKernel 36ad33b8f3 SteamGrades: Return the Steam game ID with the grade and store it.
This allows compatibility tools that use the SteamAppId environment
variable to make decisions or apply fixes do their job more accurately.

Also use the stored variable to provide a link to protondb through
the grade label in GameInfo.

The steam grades now use the orjson library to load Steam's ~6MB
database faster.
2024-02-12 21:52:07 +02:00
loathingKernel a33c4e5cf2
AccountWidget: Use ExitCodes enum everywhere instead of magic values 2023-12-10 14:22:28 +02:00
loathingKernel c21fddefb4
Utils: Delete deprecated CloudWorker. 2023-12-10 14:21:38 +02:00
loathingKernel 07cbcf52d0
Meta: Update links 2023-11-28 15:20:06 +02:00
loathingKernel 81ec9bf772
RareCore: Fetch **ALL** saves during launch
To save time and requests, bulk get saves for all games and
load them into each respective RareGame.

Co-authored-by: Dummerle <44114474+dummerle@users.noreply.github.com>
2023-03-10 17:01:00 +02:00
loathingKernel f6189772d0
WineResolver: Move common wine operations to rare/utils/wine
`rare.utils.misc.get_raw_save_path` has been removed in favor of the
equivalent `RareGame` property.
2023-03-10 17:00:55 +02:00
lennard 4b85ed8223
Cache all saves in a dict in api_results
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-08 19:15:32 +02:00
lennard a66600efa3
Move cloud save ui to a new tab in game_info
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-08 17:46:26 +02:00
lennard d399382afd
Fix origin stuff on windows
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:23 +02:00
lennard 9733e119c9
Show install path for origin games in game info
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:21 +02:00
loathingKernel 5748d0e6ee
RareCore: Manage initialization in RareCore instead of LaunchDialog
This is the last change of the `backend_refactor` branch. This makes
`RareCore` the centerpiece of Rare by moving initialization before the UI
is brought up. RareCore is now in control of creating and querying `RareGame`
objects, re-introducing the ability (incomplete) to refresh the games library.
As a result, ApiResults has been removed.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-03-07 17:11:21 +02:00
loathingKernel e55c40448c
Misc: rename get_size to format_size 2023-03-06 00:39:23 +02:00
loathingKernel ca9bf7c1e8 StaticStylesheet: Share common properties by setting common object names 2023-03-03 16:51:26 +02:00
loathingKernel 76a616615b Resources: Move some more stylesheets into the static CSS 2023-03-03 14:16:04 +02:00
loathingKernel 1dd8856a29 Resources: Add static stylesheet for widgets that need special handling irregardless of theme
The static stylesheet properties are always applied. If there is a theme
stylesheet to be applied, they are appended in the end of the theme
stylesheet.

This removes stylesheet properties from the library widgets, some special
buttons and the queue worker labels.

To update the static stylesheet first edit `rare/resources/static_css/stylesheet.py`
and then execute it as a script.
2023-03-02 15:36:45 +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 da49a91a03 Utils: return correct value type string for get_size() 2023-02-17 13:23:44 +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 cf5332004a Add name inference based on type in widget_object_name 2023-02-04 17:38:07 +02:00
loathingKernel 1959516b3f GameWidget: Toggle buttons on widget update
ElidedLabel: Use `sizeHint()` for width

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00
loathingKernel 6ccbeb12dc DownloadsTab: Use elided text from version numbers 2023-02-04 17:38:07 +02:00
loathingKernel 4063195b4d DownloadsTab: Refactor downloads tab
When updates are queued, they are removed from the update's list. An exceptions is made
when the queued item comes from repairing (without updating), in which case the update is
disabled for the runtime.

A queued item can be either removed (if it is an update it will be added back to the
updates groups) or forced to be updated now. If a queued item is forced, the currently
running item will be added to the front of the queue. Downloads will be queued if
there is no active download but there is a queue already.

The download thread is now responsible for emitting the progress to `RareGame`

InstallDialog: Pass `RareGame` and `InstallOptionsModel` only as arguments.
The `update`, `repair` and `silent` arguments are already part of `InstallOptionsModel`
`RareGame` is used to query information about the game.

InstallInfoWorker: Pass only `InstallOptionsModel` as argument
Emit `InstallQueueItemModel` as result, to re-use the worker when queuing stopped games

RareGame: Query and store metadata property about entitlement grant date
RareGame: Add `RareEosOverlay` class that imitates `RareGame` to handle the overlay

LibraryWidgetController: Remove dead signal routing code, these signals are handled by `RareGame`
Directly parent library widgets instead of reparenting them

GameWidgets: Remove unused signals

EOSGroup: Set install location based on preferences and use EOSOverlayApp from legendary

GamesTab: Connect the `progress` signals of dlcs to the base game's signals
GamesTab: Remove dead code

GlobalSignals: Remove `ProgresSignals`

RareCore: Mangle internal signleton's names

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:07 +02:00
loathingKernel 08c7ae89e9 Utils: Don't import singletons in rare.utils.misc to avoid uninitialized used and cyclical dependencies
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel 652968b6bf RareGame: Introduce RareGame from refactor_backend branch
Shared: Move WineResolver to `rare/shared/workers`
PathSpec: Move to `rare/models`

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
lennard b6786171ae
Fix game launch on windows 2022-10-18 23:02:38 +02:00
loathingKernel c8586d2beb Always return the absolute path to the exectuble 2022-09-08 20:25:55 +03:00
loathingKernel 70328d6472 Console: Minimize instead of keeping open if game is running
DesktopShortcuts: Normalize StartWMClasss with application name
2022-09-08 16:57:43 +03:00
Stelios Tsampas c6b9f5c64f Fix shortcut creation on windows 2022-09-08 13:16:15 +03:00
Stelios Tsampas d5d795ce79 Paths: Query paths after the OrganizationName and ApplicationName have been set
At the point they were evaluated, `OrganizationName` and `ApplicationName` are unset
resulting in wrong paths. As a quick fix, explicitly set them to their later values
Per OS examples:
Windows:
	before:
		data: C:\Users\<user>\AppData\Local
		cache: C:\Users\<user>\AppData\Local\cache
	after:
		data: C:\Users\<user>\AppData\Local\Rare\Rare
		cache: C:\Users\<user>\AppData\Local\Rare\Rare\cache
2022-09-08 01:27:37 +03:00
Stelios Tsampas 377fd486dc stupid quotes 2022-09-07 20:46:56 +03:00
Stelios Tsampas 6a2af0be7c Quote executable path for Windows 2022-09-07 19:19:14 +03:00
loathingKernel b15a5b7007 Fix game launching if compiled with Nuitka 2022-08-18 02:24:51 +03:00
loathingKernel 50a37be433 DownloadsTab: Remove dead code 2022-08-17 23:46:10 +03:00
loathingKernel 3ecbae0564 Utils: Rename utils.py to misc.py to not confuse PyCharm checker 2022-08-02 10:42:38 +03:00
Renamed from rare/utils/utils.py (Browse further)