1
0
Fork 0
mirror of synced 2024-06-10 14:44:41 +12:00
Commit graph

83 commits

Author SHA1 Message Date
loathingKernel 125709b53b Rare: Refactor Discord RPC file, object and variable names 2024-05-20 14:36:43 +03:00
loathingKernel 8ebcc3a700 LoadingWidget: Start playing movie once the widget is visible if autostart is enabled
Fixes a subtle bug that would cause increased CPU usage due to spawning
multiple singleshot times with very short timeouts (15ms) until the Store
tab was loaded.
2024-05-15 22:48:52 +03:00
loathingKernel af6d7c5055 Various WIP
* Use `vars()` instead of directly accessing `__dict__`
* Remove `auto_update` from RareGame's metadata
* Correct check for updating the Steam App ID (We want to keep any changes from the user)
* Collect both Wine and Proton prefixes when removing overlay registry keys.
* Add few convenience functions in config_helper and paths.
2024-02-12 21:52:07 +02:00
loathingKernel 80ac9296fc Rare: cherry-pick some sourcery suggestions 2024-01-02 17:57:02 +02:00
loathingKernel fd22d831eb Rare: refactor timer names 2024-01-02 11:18:31 +02:00
loathingKernel 99eaf86507
AccountWidget: Add a Quit button in the widget in case the system tray
is unavailable (for example running in a gamescope session)

* Do not show the launch window while instantiating the application. This
probably was causing numerous issues because it was running outside of
the applications event loop. This also fixes the exit button on the login
dialog requiring `sys.exit()` to quit Rare. Now it goes through the
proper cleanup procedures.

* Make slot and signal names more uniform

* Fix a problem with RareCore connecting RareGames to the same signals
multiple times when the library was refreshed.
2023-12-10 14:21:39 +02:00
loathingKernel c4da6a9512
MainWindow: Untie exit procedure from offline argument 2023-12-10 14:21:38 +02:00
loathingKernel 509d33e1b7
MainWindow: Default to closing to tray to respect the default setting 2023-12-07 19:39:45 +02:00
loathingKernel c063f5f5b9
Library: Move image loading from RareCore to the GameWidget
Instead of loading images in the showEvent of the MainWindow,
load them in the showEvent of each widget. It seems to reduce
the startup stuttering this way. With some more work
we can only load the images for the widgets that are currently
visible and reduce the stutter even more.

At the same time, reduce the number of concurrent downloads
in the image manager and add a timeout so we won't halt.
The exception from the timeout is just logged at this point,
and the download is not requeued.
2023-11-29 12:50:02 +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 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 46664f3577 Fix a few minor errors 2023-03-02 01:05:53 +02:00
loathingKernel a3d09ae288 Code cleanup: Use pass instead of ellipsis (...) for abstractmethods
Fix a few other issues pointed out by MultisampledNight

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-20 15:31:04 +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 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 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 b2b3598a0b MainWindow: Add worker queue to the statusbar 2023-02-04 17:38:07 +02:00
loathingKernel 2ef70b8eb4 InstallQueueItemModel: Refactor to add an expiration date to the download
While not sure if it is required, add an expiration date to the prepared
download 30 minutes after it was prepared. If a download has been in the
queue for more than 30 minutes, the download will be prepared again silently
before starting.

Return only the `InstallOptionsModel` in the result of the download thread
to avoid the potential mistake of re-using it. This required for the tray
notification signal to operate on the `app_name` instead of the `app_title`.
As a result, the notification slot was moved into the TrayIcon class for
better encapsulation.
2023-02-04 17:38:07 +02:00
loathingKernel fc7e45a43a UninstallDialog: Implement it to work similarly to InstallDialog
Similarly to the installation procedure, when an uninstall is
requested, an `UninstallOptionsModel` is emitted by the `RareGame`.
`DownloadsTab` handles the signal and spawns the `UninstallDialog`.
After the `UninstallDialog` is closed, a worker thread handles
uninstalling the application to avoid UI lock-ups when a large
number of files is deleted.

Allows for uninstall actions to be spawned from anything having
access to the `RareGame` instance.

LaunchDialog: Don't check health on DLCs, they always will require
verification if they don't specify an executable.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
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 9ca39d94ab GlobalSignals: Reorganize signals into groups
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
loathingKernel c1a008dce1 MainWindow: Don't connect to the global exit signal
Instead of connecting to the global `exit_app` signal, pass the signals
through their respective widgets. Because signals are queued by
default, this ensures that slots are executed in the order they are
connected. Makes it cleaner to do cleanup procedures where they should
make sense, unlike the global signal, where it has to be inferred by
the widget instantiating order.
2022-10-23 16:08:27 +03:00
loathingKernel 28b2b7ea9b MainWindow: Handle active downloads when exiting through WM's close button.
When the closed through the WM's close button, `closeEvent()` is
 used directly. In this case the dialog in the `on_exit_app`
slot was skipped.

There is a mishandled case. If coming from logout while there
is an active download (Yes to logout -> No to stop download)
we end up in a weird state which I haven't investigated yet.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2022-10-23 00:01:30 +03:00
Stelios Tsampas afcb3f7e7a GameLaunchHelper: Allow closing the window only if the application has exited or crashed 2022-09-08 16:02:17 +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
loathingKernel afcdc1dea1 App: Move legendary initialization to the singleton
App: Move tray to MainWindow
Shared: Add destructor for singleton instances
2022-09-04 01:14:43 +03:00
loathingKernel 0a89f0e0b8 Make launch and alias for start 2022-09-02 13:17:05 +03:00
Dummerle f025047021
Add a check if qt found current screen. Fallback to primary screen 2022-05-03 23:08:22 +02:00
Dummerle 81da5faec9
Change Linux settings to default game settings 2022-03-21 23:01:53 +01:00
Dummerle 324530171e
Change kinetic scroll exceptions to property 2022-03-17 19:51:19 +01:00
Dummerle 66ae7c614f
Show wrapper widget for proton and mangohud with disabled button 2022-03-14 17:23:55 +01:00
Dummerle 8ba7791c82
Add kinetic scrolling and fix mouse wheel scrolling over combo boxes 2022-03-14 17:23:53 +01:00
Stelios Tsampas d6ef44b2f9
Rare: Implement global objects as functions that return a single instance 2022-02-25 20:22:45 +02:00
Dummerle 2e6890bfd9
Move appdata paths to utils/paths.py to avoid crashes, if PyQt5 does not exist (deb workflow) 2022-02-17 00:04:53 +01:00
Dummerle 080c8f8831
Fix error, if pypresence module not exist 2021-12-31 00:48:55 +01:00
Dummerle 454671f9da
Do not crash, if pypresence not exists 2021-12-27 00:37:13 +01:00
Stelios Tsampas 8f89eb6e88
Rare: pass through Black formatter 2021-12-27 00:37:13 +01:00
Dummerle 5cd942b9e8
Fix silent mode + refactoring: move window to center, when showing window 2021-12-22 21:21:49 +01:00
Dummerle 67003bb1b2
Fix bug, that window not appears on KDE 2021-12-22 19:27:43 +01:00
Dummerle e370841532
Fix many bugs:
- launch command
- offline mode
- shop search results shows more than 1 game
2021-12-09 20:03:34 +01:00
Stelios Tsampas 75d46a6370
MainWindow: Add statusbar 2021-12-04 18:55:45 +02:00
Dummerle b60fb43568
Some fixes and optimization 2021-11-29 01:23:33 +01:00
Dummerle db177e162f Some fixes for windows 2021-11-25 21:54:34 +01:00
Dummerle ef4f383673
Fix window size 2021-11-22 22:35:37 +01:00
Dummerle 4c9ef8acd8
Many fixes:
- store: updated epic api + many other fixes
- installing widget has now no border
- disable startmenu and desktop link on unsupported os
2021-11-22 20:02:58 +01:00
Stelios Tsampas c8a26da2bb
MainWindow: Default to a smaller size 2021-11-22 19:35:25 +02:00
Stelios Tsampas f4c2533642
MainWindow: Place main window in the screen it was started in and center it properly 2021-11-21 17:18:36 +02:00
Dummerle 0e88d3965f
Much optimization
- updating text in installed widgets
- move tab_widget.py to __init__.py
- errors at launching are now in a popup
- remove old sync widget
2021-11-17 23:02:33 +01:00