Dialog used to interact with a FomodInstaller.
More...
#include <fomoddialog.h>
|
void | addModAccepted (int app_id, AddModInfo info) |
| Signals dialog completion.
|
|
void | addModAborted () |
| Signals mod installation has been aborted.
|
|
|
| FomodDialog (QWidget *parent=nullptr) |
| Initializes the UI.
|
|
| ~FomodDialog () |
| Deletes the UI.
|
|
void | setupDialog (const std::filesystem::path &config_file, const std::filesystem::path &target_path, const QString &app_version, const AddModInfo &info, int app_id) |
| Initializes the dialog.
|
|
std::vector< std::pair< std::filesystem::path, std::filesystem::path > > | getResult () const |
| Returns pairs of source and destinations for every selected file during the installation process.
|
|
bool | hasSteps () const |
| Checks if the dialog has any steps.
|
|
|
void | onNextButtonPressed () |
| Advances the dialog by one step.
|
|
void | onPluginSelected (bool checked) |
| Called when a button has been pressed, updates the next button.
|
|
void | onBackButtonPressed () |
| Takes a step back.
|
|
void | on_buttonBox_rejected () |
| Emits addModAborted.
|
|
|
QAbstractButton * | makeButton (fomod::PluginGroup::Type type, const QString &text, const QString &description, const QString &image_path) const |
| Creates a new FomodCheckBox or FomodRatioButton for selection of a plugin.
|
|
void | updateInstallStep (std::optional< std::pair< std::vector< std::vector< bool > >, fomod::InstallStep > > prev_step={}) |
| Takes one step forwards or backwards in the installation and updates the UI.
|
|
bool | selectionIsValid () |
| Verifies if the current selection satisfies the requirements to advance to the next step.
|
|
std::vector< std::vector< bool > > | getSelection () |
| For every group, for every plugin: True if plugin is currently selected.
|
|
void | updateNextButton () |
| Updates text and enabled status of next_button_, depending on the step.
|
|
void | closeEvent (QCloseEvent *event) override |
| Closes the dialog and emits a signal indicating installation has been canceled.
|
|
void | reject () override |
| Closes the dialog and emits a signal indicating the dialog has been closed.
|
|
|
Ui::FomodDialog * | ui |
| Contains auto-generated UI elements.
|
|
std::unique_ptr< fomod::FomodInstaller > | installer_ |
| Used to parse the fomod file.
|
|
fomod::InstallStep | cur_step_ |
| Contains the current step in the installation process.
|
|
QList< QButtonGroup * > | button_groups_ |
| Buttons used to represent plugin options.
|
|
QList< fomod::PluginGroup::Type > | group_types_ |
| Determines selection restrictions for button groups.
|
|
QPushButton * | next_button_ |
| Button used to advance the dialog.
|
|
QPushButton * | back_button_ |
| Button used to step back in the dialog.
|
|
std::set< int > | none_groups_ |
| Some button groups require a dummy button. This holds the ids of those groups.
|
|
std::vector< std::pair< std::filesystem::path, std::filesystem::path > > | result_ |
| Once the installation has been completed, this contains source and destination paths for every file selected during the installation.
|
|
bool | has_no_steps_ |
| If true: This dialog is non interactive.
|
|
AddModInfo | add_mod_info_ |
| Contains necessary data to install the mod upon dialog completion.
|
|
int | app_id_ |
| Application for which the new mod is to be installed.
|
|
bool | dialog_completed_ = false |
| Indicates whether the dialog has been completed.
|
|
Dialog used to interact with a FomodInstaller.
◆ FomodDialog()
FomodDialog::FomodDialog |
( |
QWidget * | parent = nullptr | ) |
|
Initializes the UI.
- Parameters
-
parent | Parent of this widget. |
◆ addModAccepted
void FomodDialog::addModAccepted |
( |
int | app_id, |
|
|
AddModInfo | info ) |
|
signal |
Signals dialog completion.
- Parameters
-
app_id | Application for which the new mod is to be installed. |
info | Contains all data needed to install the mod. |
◆ closeEvent()
void FomodDialog::closeEvent |
( |
QCloseEvent * | event | ) |
|
|
overrideprivate |
Closes the dialog and emits a signal indicating installation has been canceled.
- Parameters
-
event | The close event sent upon closing the dialog. |
◆ getResult()
std::vector< std::pair< sfs::path, sfs::path > > FomodDialog::getResult |
( |
| ) |
const |
Returns pairs of source and destinations for every selected file during the installation process.
- Returns
- The files.
◆ getSelection()
std::vector< std::vector< bool > > FomodDialog::getSelection |
( |
| ) |
|
|
private |
For every group, for every plugin: True if plugin is currently selected.
- Returns
- The selection.
◆ hasSteps()
bool FomodDialog::hasSteps |
( |
| ) |
const |
Checks if the dialog has any steps.
- Returns
- True if there are steps.
◆ makeButton()
QAbstractButton * FomodDialog::makeButton |
( |
fomod::PluginGroup::Type | type, |
|
|
const QString & | text, |
|
|
const QString & | description, |
|
|
const QString & | image_path ) const |
|
private |
Creates a new FomodCheckBox or FomodRatioButton for selection of a plugin.
- Parameters
-
type | Generated button type is determined based on this plugin type. |
text | Text of the new button. |
description | Description of the plugin represented by this button. |
image_path | Path to an image for the plugin represented by this button. |
- Returns
- Pointer to the new button.
◆ onPluginSelected
void FomodDialog::onPluginSelected |
( |
bool | checked | ) |
|
|
privateslot |
Called when a button has been pressed, updates the next button.
- Parameters
-
checked | Button check state. |
◆ selectionIsValid()
bool FomodDialog::selectionIsValid |
( |
| ) |
|
|
private |
Verifies if the current selection satisfies the requirements to advance to the next step.
- Returns
- True if valid.
◆ setupDialog()
void FomodDialog::setupDialog |
( |
const std::filesystem::path & | config_file, |
|
|
const std::filesystem::path & | target_path, |
|
|
const QString & | app_version, |
|
|
const AddModInfo & | info, |
|
|
int | app_id ) |
Initializes the dialog.
- Parameters
-
config_file | Either a direct path to a fomod configuration file or a path to a directory containing fomod/ModuleConfig.xml. |
target_path | Path used by the FomodInstaller to check for dependencies. |
app_version | App version used for fomod conditions. All version checks evaluate to true if this is left empty. |
info | Contains necessary data to install the mod upon dialog completion. |
app_id | Application for which the new mod is to be installed. |
◆ updateInstallStep()
void FomodDialog::updateInstallStep |
( |
std::optional< std::pair< std::vector< std::vector< bool > >, fomod::InstallStep > > | prev_step = {} | ) |
|
|
private |
Takes one step forwards or backwards in the installation and updates the UI.
- Parameters
-
prev_step | Pair of the selection and installer state during the previous step. If this is empty, the installer advances, else the installer takes a step back. |
The documentation for this class was generated from the following files: