1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00
Commit graph

49 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 88b6e91530 BrowserLogin: Add dedicated application mode to Rare for the webview login page
Add a sub-application to Rare to launch the webview for logging into EGS.
The sub-application operates similatly to the `laucher` sub-application and
it is autonomous. After a successful login in returns the exchange code
to the standard output to be parsed and used by the login dialog.

The reason this implementation was chosen is because when pywebview uses
pyqtwebengine as the GUI library, we cannot launch it through Rare as
it tries to spawn a QMainWindow inside an existing event loop, which is
prohibited by Qt.

Despite that, EGS login page doesn't work correctly with QtWebEngine,
so on linux default to the GTK backend for pywebview, and this change
helps keeping applications using different toolkits separate.

At this moment, spawning the sub-application blocks the execution of the
main application.

This change should make it easier to authenticate through Rare inside
a gamescope session, such as the steam deck.
2024-02-12 21:51:42 +02:00
loathingKernel 80ac9296fc Rare: cherry-pick some sourcery suggestions 2024-01-02 17:57:02 +02:00
loathingKernel 400625975d Dialogs: Re-implement Launch and Login dialogs on top of a few common super-classes
To keep dialogs in a common format and allow them to share the same
properties, three classes of dialogs have been implemented inheriting from
each other.

The classes are `BaseDialog` -> `ButtonDialog` -> `ActionDialog`

* Basedialog: is the basis of all dialogs and is responsible for
rejecting close requests from the window manager and the keyboard.
It also restricts access to `exec()` and `exec_()` because they are harmful.
It serves as the basis of Launch and Login dialogs

* ButtonDialog: is offering buttons for accepting or rejecting the presented
option. It implements its own buttons and exposes abstract methods to
implement handling in them. It restricts access to `close()` because these
dialogs should always product a result.
It is the basis of Uninstall, Selective dialogs.

* ActionDialog: in addition to the ButtonDialog, it offers an action buttom
with to validate the form or to make the dialog unable to close. It serves
as the basis of Install and Move dialogs.
2023-12-24 21:08:26 +02:00
loathingKernel 8e1a3c8c73
LoginDialog: Calculate a fixed height for the login stack based on width
* Properly find row to insert sid_edit into
* Use lazy evaluation for logging
* Clean the login forms by using separate layouts for the interactive fields
2023-12-12 01:23:17 +02:00
loathingKernel 0ec80e5678
LoginDialog: Set minimum size in a way that avoids resizing on changing widgets
The forms were updated to be more informative and easier to read.

NOTE: The reason the form is bigger than the contents is because the
QLabels have word-wrapping enabled and as such they substitute width
for height (`hasHeightforWidth`)
2023-12-12 01:23:16 +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 5938835249 ExtraWidgets: Remove IndicatorLineEdit and PathEdit and update imports 2023-02-18 17:29:41 +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
lennard 923aa1b90d
Migrate to legendary 0.20.30 2022-10-26 21:36:16 +02:00
loathingKernel 5029921b09 Move a bunch of class attributes to instance attributes 2022-09-07 18:21:50 +03:00
loathingKernel 345ee443ed ImportLogin: Only add the first part of the split 2022-09-02 00:02:20 +03:00
loathingKernel b3348a1eca ImportLogin: Check if programdata is set 2022-09-01 23:48:30 +03:00
loathingKernel 0388d4bf9d ImportLogin: Fix failure to login using EGL data 2022-09-01 22:49:09 +03:00
loathingKernel fb708ce5fd LoginDialog: Update to legendary 0.20.28 2022-09-01 18:53:16 +03:00
loathingKernel 3ecbae0564 Utils: Rename utils.py to misc.py to not confuse PyCharm checker 2022-08-02 10:42:38 +03:00
loathingKernel 7fba2259ed LoginDialog: Fix crash due to messagebox parent 2022-08-02 10:42:38 +03:00
Stelios Tsampas 61a2a6781d Add window hint to keep minimize button while still disabling close button
Disable reject method for launch dialog
Don.t update the assets again for the 32bit and mac games by waiting for ImageWorker to finish
2022-06-24 11:29:41 +03:00
loathingKernel 367f6cf0eb Add window buttons to Launch and Login Dialogs 2022-06-23 20:39:43 +03:00
loathingKernel 7dbe414b87 Pass edited files through black 2022-06-23 18:05:04 +03:00
loathingKernel 145bc5f540 Use SlidingStackedWidget for the login dialog.
Also fixes the login window missing dialog type hints for the window manager.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2022-06-23 17:57:29 +03:00
Dummerle 150fff348b
Fix Desktop shortcut and login dialog task bar icon + bump version 2022-04-25 23:32:26 +02:00
Dummerle d077e2bc24
Add pre_launch settings 2022-03-21 23:00:33 +01:00
Stelios Tsampas d6ef44b2f9
Rare: Implement global objects as functions that return a single instance 2022-02-25 20:22:45 +02:00
aznd 9b59707a10
Unify strings formatting (#158)
* Part 1: Unifying strings

* Part 2: Unifying strings

* Part 3: Unifying strings

* Fix missing close bracket

* Remove unneeded str()
2022-02-01 22:29:34 +01:00
aznd 7deb4152ac
Implement logging in via webengine (#160)
Add webview as optional dependency, to login from there, to not have to copy SID manually
2022-01-30 00:23:37 +01:00
Dummerle 25c04d2812
Add Reasons to IndicatorLineEdit as tooltip 2022-01-24 16:56:14 +01:00
Dummerle 662c8ed04c
Add link text to browser login 2022-01-23 01:03:56 +01:00
Stelios Tsampas 8f89eb6e88
Rare: pass through Black formatter 2021-12-27 00:37:13 +01:00
Dummerle d93294536a
Add --test-start to use in appimage-builder 2021-12-11 00:18:57 +01:00
Dummerle f87465ece4
Some cleanup 2021-10-20 19:19:03 +02:00
Dummerle d999598aff
Update Size policy of login dialog 2021-10-20 18:04:29 +02:00
Dummerle c9b9ab6814 Fix some typing errors for python 3.8 2021-10-10 22:08:31 +02:00
Stelios Tsampas 463443796d Adjust BrowserLogin to use IndicatorLineEdit
Adjust Locale in `LegendarySettings` to use `IndicatorLineEdit`
Adjust `InstallDialog` to conform with new `PathEdit` `edit_func` specification

This commit temporarily removes `EGLSync` from `LegendarySettings`
as it is being worked on.
2021-10-10 20:47:26 +03:00
Dummerle 6ba445158d Remove login successful page and auto parse sid 2021-10-07 21:58:50 +02:00
Dummerle d11cc7abf3 add legendary submodule and rename custom_legendary to legendary in imports 2021-09-06 21:10:18 +02:00
Dummerle 48768fd905 Fix login from merge 2021-08-16 23:20:21 +02:00
Dummerle 4cfe2bf336 merge branches 2021-08-16 22:50:31 +02:00
ChemicalXandco 7af64f1b83 add import platform 2021-07-01 19:08:04 +01:00
Stelios Tsampas 1365b36b08 Delegate opening browser to a function (futureproofing) 2021-06-24 20:08:22 +03:00
Stelios Tsampas 09d9e0f9a0 Raise ValueError when failing to login so it can be logged. 2021-06-24 20:08:22 +03:00
Stelios Tsampas e8dadb6b00 Update the RareStyle to handle radiobutton, disabled widgets, etc.
* Add RareStyle qrc with the icons needed for comboboxes and spinboxes
* Add images as svg
* Refactor `styles` to `resources` since it contains more things now.
* Add stylesheet folders, each folder must contain a `stylesheet.qss` file.
* Don't use QResources, instead add an identifier in the qss url() which can
  replaced later with the full path.
* Update RareStyle with SVG images for better quality.
2021-06-24 20:08:04 +03:00
Stelios Tsampas f49cc413dd Add prefix path select dialog to LoginDialog.
* Make exception handling more general in InstallDialog.
* Fix the title of PathEdit file selection dialog.
2021-06-24 20:07:18 +03:00
Stelios Tsampas 90ac9a1574 Re-implement LoginDialog. 2021-06-24 20:07:18 +03:00
Dummerle a5997f62ab replace os.name with platform.system() to differentiate between mac and linux 2021-06-20 21:55:31 +02:00
Dummerle 21e3478c1b Delete dialogs on close 2021-06-03 23:33:36 +02:00
Dummerle 6deabf4a92 Reformatting, 1.3.0 2021-04-22 14:34:06 +02:00
BuildTools 665083c5b5 lowercase snake case 2021-04-07 22:39:23 +02:00