- Show text on widget if save is not up-to-date
- Fix text in game info -> cloud saves
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
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>
When the button gets clicked on, it receives keyboard focus. Disabling the button
afterwards leads to `focusNextChild` getting called. This makes the scrollarea
trying to ensure that `nextChild` is visible, essentially scrolling to a random widget
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.
Widgets that need to implement a title should be of a dual subclass
of any `QWidget` subclass and the `SideTabContents` class which provides
the signal.
Word wrapping allows ElideLabel to resize first inside flexible sized
areas such as the contents widget of a scrollarea. This allows the contents
widget to properly resize itself to avoid horizontal scrolling.
Word-wrapping also enables the widget to resize vertically. To avoid that
ElideLabel is set to a fixed height based on font metrics. An overloaded
method `setFixedHeight` has been added to disable it when desired.
EglSyncGroup: Replace estimated path label with a ElideLabel because
the displayed message was expanding the scrollarea.
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()
```
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.
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.
`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.