1
0
Fork 0
mirror of synced 2024-06-16 09:34:45 +12:00
Commit graph

114 commits

Author SHA1 Message Date
loathingKernel ae69413ddb
InstallDialog: Remove inline stylesheet, adjust the font. 2024-02-24 01:51:45 +02:00
loathingKernel 8dbce8e9f2
Rare: rename icon function to qta_icon 2024-02-21 13:30:41 +02:00
loathingKernel fb91a55f30 Dialogs: Use consistent dialog titles for the launcher's dialogs 2024-02-12 21:52:08 +02:00
loathingKernel 69aca3851f InstallDialog: Update widget attribute name 2024-01-21 23:45:38 +02:00
loathingKernel 5b36727076 Dialogs: Add subtitle label in ButtonDialog 2024-01-21 23:45:23 +02:00
loathingKernel a605bddffa RareGame: Move sdl_name to RareGameBase
InstallDialog uses that property so RareEosOverlay should have it too.
Also calculate the base_path for the overlay case instead of passing it as
argument
2024-01-19 12:09:57 +02:00
loathingKernel 971c31e8f4 SelectiveWidget: Create specialized widget for selecting optional downloads
Because there are two dialogs for editing optional downloads, refactor
the separate implementations to select them into a common reusable widget
and use it in SelectiveDialog and InstallDialog.
2024-01-18 16:44:47 +02:00
loathingKernel c7336ad04a InstallDialog: Use ActionDialog base class 2024-01-02 15:12:07 +02:00
loathingKernel 62e19a8be2 VerifyGame: Present a dialog to select selective downloads in the game
supports them.
2023-12-25 23:56:37 +02:00
loathingKernel 5f5e471169
RareGameBase: Add default_platform property
This property reports the default platform to use for a game based
on legendary's configuration and if they platform is available in the
game's assets.

Using that property we can make better choices on what platform to operate
on without user intervention. Currently we use it to infer the platform
in when installing, importing, and calculating game versions.
2023-12-16 14:02:53 +02:00
loathingKernel 6249e56849
InstallDialog: Oooooooof.gif
* Infer the displayed to reflect where the affected directory is
  If base_path is set outside of InstallDialog, display that.
  If the game is already installed, show the installation directory
  If neither of the above is true, use legendary's inference based on
  the default platform if the game supports it. Fallback to Windows.

* Disable irrelevant and potentially harmful options when the game is
  already installed, such as the installation path, the platform selection
  and creating a shortcut.

* Infer the correct platform based on the existing installation. If it
  is not installed, use the default platform if the game supports it and
  fallback to windows.

* Move the horrible lambda used to populate the error box when the
  platform was unsupported into a separate method.
2023-12-16 00:49:51 +02:00
loathingKernel 3ce62facd2
InstallDialog: Properly find the the row when inserting install_dir_edit 2023-12-12 01:23:17 +02:00
loathingKernel 8c83f8aa23
InstallDialog: Add install_dir_edit widget without using an extra layout 2023-12-12 01:23:15 +02:00
loathingKernel 845bc54a90
InstallDialog: Add selective downloads descriptions as tooltips 2023-12-10 14:22:29 +02:00
loathingKernel d1d7e6d2e7
InstallDialog: Code consistency with button slot names 2023-12-10 14:22:29 +02:00
Stelios Tsampas 7824fa20a8
InstallDialog: Always show prerequisites if they exist
* Do not depend the relevant InstallOptionsModel option to on the running platform
2023-12-10 14:22:27 +02:00
loathingKernel b20be46752
InstallDialog: Offer to install prerequisites on native platforms 2023-12-10 14:22:27 +02:00
loathingKernel a87f34163a
Skip widget updates on spontaneous events.
Spontaneous are events external to the application such as the window
manager showing or hiding the application. We don't want to update on those.
2023-11-29 12:50:39 +02:00
loathingKernel c05209578c
InstallDialog: Fix install dialog not calculating available space
After the PathEdit change that stopped it from emitting the
textChanged signal when instatiated, the available space
calculation wouldn't take place, so do it when the dialog
becomes visible.
2023-11-29 12:47:56 +02:00
loathingKernel f2c575e082
InstallDialog: Expose platforms in RareGame and use it
to populate the combobox
2023-11-28 16:38:02 +02:00
loathingKernel 43766c82a4
GameInfo: Enable Modify button only when the game has SDLs
Add icons to the DLC install/uninstall buttons
2023-11-28 16:38:02 +02:00
loathingKernel eb48a506d2
GameInfo: Add 'Modify Game' button to adjust selective downloads 2023-11-28 16:38:00 +02:00
lennard 62aa78dcae Fix release-tests workflow 2023-05-03 12:32:12 +02:00
lennard 263af75853 Do not set available space text twice in install dialog 2023-05-03 12:32:12 +02:00
lennard 075443261d Show free space in install dialog 2023-05-03 12:32:12 +02:00
loathingKernel 837b391350
PathEdit: Allow for the completer's root path to be set at runtime.
This allows to complete from relative paths, such use exe override

Fix constructor argument names to follow Qt's types.
Set the same filters as the dialog for the completer.
Use the completer's icon provider for the dialog.

Force Rare to use Qt's file dialog instead of the native one.
2023-03-15 22:49:18 +02:00
loathingKernel 18ebb6888f
InstallDialog: Allow for some special cases to install 0 size downloads
This specifically helps with games that have selectable downloads.
If we import a game with SDLs without any `install_tags` in the config
we will verify against the full game, meaning that files missing will
cause the verification to fail despite the game being correct. Since the
game is correct, resolving the download will result in a 0 size update.
This change will allow the InstallDialog to finish through the Install
button successfully despite having nothing to install.

On the `lgndr` side things are more complicated. Due to minor oversights
in legendary, the `install_tags` in the above example wouldn't be written
to the configuration file, causing a verification loop because the file
list wouldn't be filtered. To fix that, we also save legendary's config
file at the end of cleaning after a 0 size download.
2023-03-14 12:18:19 +02:00
loathingKernel e55c40448c
Misc: rename get_size to format_size 2023-03-06 00:39:23 +02:00
loathingKernel 4ef73b48ef Dialogs: Homogenize dialog titles 2023-02-18 19:36:49 +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
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 2903c19667 Code cleanup 2023-02-07 13:06:08 +02:00
loathingKernel 523391d166 QueueWidget: Prepare requeued downloads after adding it.
By preparing the download inside the widget, the delay after stopping
the running download and visual feedback of adding the widget is
reduced. The widget will now appear containing the basic information
and will be populated with the information about the download
when it is ready. The widget is disabled in the meantime.

Move `InstallInfoWorker` to `rare.shared.workers` module and
revert it to emitting a `InstallDownloadItem` model only
instead of a `InstallQueueItemModel.`
2023-02-04 17:38:07 +02:00
loathingKernel a26b977bda Fix a few issues around refactoring the stylesheets.
Properly set object names for install and uninstall buttons in dialogs
Change margins on widgets that are put into scrollareas
Add top margin only on checkable QGroupBox
Remove padding from QToolBox
2023-02-04 17:38:07 +02:00
loathingKernel 020d225f97 InstallDialog: Make as modal when not silent to block input 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 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 ab858b87d3 InstallDialog: Fix title capitalization
Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2023-02-04 17:38:06 +02:00
lanmaster53 db1691b694
Fixed a bug that caused a UI crash on Mac-based systems. (#267) 2023-02-04 15:23:07 +01:00
loathingKernel 435d560b5c InstallDialog: Update the collapsible widget to take a widget instead of a layout
This change makes it more inline with how QScrollArea operates on a central widget.
Other changes include using a QFrame instead of a QWidget as a base and
adding a QLabel for the title instead of the horizontal line.

The advanced options were split into their own separate widget. Right now
their class operates only as a container with the logic remaining in the
InstallDialog.
2022-10-31 16:59:55 +02:00
loathingKernel 5370355e5d Lgndr: Restructure module to follow legendary's file hierarchy
Move overloaded class files into the folders following
legendary's structure. Move Rare's integration classes into
their own subfolder.
2022-10-29 14:50:18 +03:00
loathingKernel 9fcb924ae8 Widgets: Correct CollapsibleWidget name 2022-10-29 14:50:18 +03:00
loathingKernel 3291100709 InstallDialog: Set irrelevant widgets as disabled.
Do not hide irrelevant options, show them as disabled instea.
This like the install directory are still informational despite
not being editable.

Also homogenize variable and widget naming.
2022-10-23 21:36:44 +03:00
Stelios Tsampas 0960cbbdd3 DownloadThread: args is a string! 2022-09-18 15:07:42 +03:00
loathingKernel 5029921b09 Move a bunch of class attributes to instance attributes 2022-09-07 18:21:50 +03:00
loathingKernel 2c36ffcd51 Lgndr: Adjust for d8af06c936 2022-09-01 11:49:42 +03:00
loathingKernel 6941556265 InstallDialog: setup UI class as member instead of double inheritance 2022-08-31 17:42:40 +03:00
loathingKernel b1c713be12 InstallDialog: Show silent dialog in case of error
InstallDialog: Default shortcut creation to Unchecked in the UI file
InstallDialog: Save and reuse last shortcut creation value
2022-08-31 17:41:12 +03:00
loathingKernel 2f983d9b52 InstallDialog: Adjust collapsible widget 2022-08-28 22:07:26 +02:00