Limo
A simple mod manager
Loading...
Searching...
No Matches
AddDeployerDialog Class Reference

Dialog for creating and editing deployers. More...

#include <adddeployerdialog.h>

Inheritance diagram for AddDeployerDialog:
Collaboration diagram for AddDeployerDialog:

Signals

void deployerAdded (EditDeployerInfo info, int app_id)
 Signals completion of the dialog in add mode.
 
void deployerEdited (EditDeployerInfo info, int app_id, int deployer_id)
 Signals completion of the dialog in edit mode.
 
void updateIgnoredFiles (int app_id, int deployer)
 Updates the file ignore list for ReverseDeployers.
 

Public Member Functions

 AddDeployerDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~AddDeployerDialog ()
 Deletes the UI.
 
void setAddMode (int app_id)
 Initializes this dialog to allow creating a new Deployer.
 
void setEditMode (const QString &type, const QString &name, const QString &target_path, const QString &source_path, Deployer::DeployMode deploy_mode, int app_id, int deployer_id, bool has_separate_dirs=false, bool has_ignored_files=false)
 setEditMode Initializes this dialog to allow editing an existing Deployer.
 
void updateSourceFields ()
 Enables/ Disables the ui elements responsible for setting a source directory.
 

Private Slots

void on_file_picker_button_clicked ()
 Shows a file dialog for the target directory path.
 
void on_name_field_textChanged (const QString &text)
 Only enable the OK button if a name has been entered.
 
void on_path_field_textChanged (const QString &text)
 Only enable the OK button if a valid target directory path has been entered.
 
void on_buttonBox_accepted ()
 Closes the dialog and emits a signal for completion.
 
void onFileDialogAccepted (const QString &path)
 Updates the target path with given path.
 
void on_type_box_currentIndexChanged (int index)
 Updates the source path widgets enabled status.
 
void on_source_picker_button_clicked ()
 Shows a file dialog for the source directory path.
 
void onSourceDialogAccepted (const QString &path)
 Updates the source path with given path.
 
void on_source_path_field_textChanged (const QString &path)
 Only enable the OK button if a valid source directory path has been entered.
 
void on_deploy_mode_box_currentIndexChanged (int index)
 Hides/ shows warning labels for deploy modes.
 
void on_rev_depl_ignore_cb_stateChanged (int new_state)
 Shows a dialog asking for confirmation when in edit mode.
 
void on_rev_depl_separate_cb_stateChanged (int new_state)
 Shows a dialog asking for confirmation when in edit mode.
 
void on_rev_depl_ignore_button_clicked ()
 Emits a signal to update the ignored files for the current ReverseDeployer.
 

Private Member Functions

void enableOkButton (bool state)
 Set the enabled state of this dialog's OK button.
 
bool pathIsValid ()
 Checks whether the currently entered path exists.
 
void setupTypeBox ()
 Adds all available Deployer types to the type combo box.
 
void updateOkButton ()
 Updates the state of this dialog's OK button to only be enabled when all inputs are valid.
 

Private Attributes

Ui::AddDeployerDialog * ui
 Contains auto-generated UI elements.
 
bool edit_mode_ = false
 If true: Dialog is used to edit, else: Dialog is used to create.
 
QString name_
 Current name of the edited Deployer.
 
QString target_path_
 Current target directory of the edited Deployer.
 
QString type_
 Current type of the edited Deployer.
 
int app_id_
 Id of the ModdedApplication owning the edited Deployer.
 
int deployer_id_
 Id of the edited Deployer.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 
QString source_path_
 Current target directory of the edited Deployer.
 
bool has_separate_dirs_ = false
 Used by ReverseDeployers: If true: Store files on a per profile basis. Else: All profiles use the same files.
 
bool has_ignored_files_ = false
 Used by ReverseDeployers: If true: Deployer has files on the ignore list.
 
bool disable_confirmation_boxes_ = false
 Disables confirmation boxes for ReverseDeployer check boxes.
 

Detailed Description

Dialog for creating and editing deployers.

Constructor & Destructor Documentation

◆ AddDeployerDialog()

AddDeployerDialog::AddDeployerDialog ( QWidget * parent = nullptr)
explicit

Initializes the UI.

Parameters
parentParent for this widget, this is passed to the constructor of QDialog.

Member Function Documentation

◆ deployerAdded

void AddDeployerDialog::deployerAdded ( EditDeployerInfo info,
int app_id )
signal

Signals completion of the dialog in add mode.

Parameters
infoContains all data entered in this dialog.
app_idId of the ModdedApplication owning the edited Deployer.

◆ deployerEdited

void AddDeployerDialog::deployerEdited ( EditDeployerInfo info,
int app_id,
int deployer_id )
signal

Signals completion of the dialog in edit mode.

Parameters
infoContains all data entered in this dialog.
app_idId of the ModdedApplication owning the edited Deployer.
deployer_idId of the edited Deployer.

◆ enableOkButton()

void AddDeployerDialog::enableOkButton ( bool state)
private

Set the enabled state of this dialog's OK button.

Parameters
state

◆ on_deploy_mode_box_currentIndexChanged

void AddDeployerDialog::on_deploy_mode_box_currentIndexChanged ( int index)
privateslot

Hides/ shows warning labels for deploy modes.

Parameters
indexNew index.

◆ on_rev_depl_ignore_cb_stateChanged

void AddDeployerDialog::on_rev_depl_ignore_cb_stateChanged ( int new_state)
privateslot

Shows a dialog asking for confirmation when in edit mode.

Parameters
new_stateThe new check state.

◆ on_rev_depl_separate_cb_stateChanged

void AddDeployerDialog::on_rev_depl_separate_cb_stateChanged ( int new_state)
privateslot

Shows a dialog asking for confirmation when in edit mode.

Parameters
new_stateThe new check state.

◆ setAddMode()

void AddDeployerDialog::setAddMode ( int app_id)

Initializes this dialog to allow creating a new Deployer.

Parameters
app_idId of the ModdedApplication owning the edited Deployer.

◆ setEditMode()

void AddDeployerDialog::setEditMode ( const QString & type,
const QString & name,
const QString & target_path,
const QString & source_path,
Deployer::DeployMode deploy_mode,
int app_id,
int deployer_id,
bool has_separate_dirs = false,
bool has_ignored_files = false )

setEditMode Initializes this dialog to allow editing an existing Deployer.

Parameters
typeCurrent type of the edited Deployer.
nameCurrent name of the edited Deployer.
target_pathCurrent target directory of the edited Deployer.
source_pathCurrent source directory of the edited Deployer.
deploy_modeDetermines how files are deployed to the target directory.
app_idId of the ModdedApplication owning the edited Deployer.
deployer_idId of the edited Deployer.
has_separate_dirsUsed by ReverseDeployers: If true: Store files on a per profile basis. Else: All profiles use the same files.
has_ignored_filesUsed by ReverseDeployers: If true: Deployer has files on the ignore list.

◆ updateIgnoredFiles

void AddDeployerDialog::updateIgnoredFiles ( int app_id,
int deployer )
signal

Updates the file ignore list for ReverseDeployers.

Parameters
app_idTarget app.
deployerTarget deployer.

The documentation for this class was generated from the following files: