Limo
A simple mod manager
Loading...
Searching...
No Matches
adddeployerdialog.h
Go to the documentation of this file.
1
5
6#pragma once
7
9#include <QDialog>
10
11
12namespace Ui
13{
14class AddDeployerDialog;
15}
16
20class AddDeployerDialog : public QDialog
21{
22 Q_OBJECT
23
24public:
29 explicit AddDeployerDialog(QWidget* parent = nullptr);
36 void setAddMode(int app_id);
50 void setEditMode(const QString& type,
51 const QString& name,
52 const QString& target_path,
53 const QString& source_path,
54 Deployer::DeployMode deploy_mode,
55 int app_id,
56 int deployer_id,
57 bool has_separate_dirs = false,
58 bool has_ignored_files = false);
60 void updateSourceFields();
61
62private:
64 Ui::AddDeployerDialog* ui;
66 bool edit_mode_ = false;
68 QString name_;
70 QString target_path_;
72 QString type_;
78 bool dialog_completed_ = false;
80 QString source_path_;
85 bool has_separate_dirs_ = false;
87 bool has_ignored_files_ = false;
90
95 void enableOkButton(bool state);
97 bool pathIsValid();
99 void setupTypeBox();
102 void updateOkButton();
103
104private slots:
108 void on_name_field_textChanged(const QString& text);
110 void on_path_field_textChanged(const QString& text);
114 void onFileDialogAccepted(const QString& path);
116 void on_type_box_currentIndexChanged(int index);
120 void onSourceDialogAccepted(const QString& path);
122 void on_source_path_field_textChanged(const QString& path);
132 void on_rev_depl_ignore_cb_stateChanged(int new_state);
137 void on_rev_depl_separate_cb_stateChanged(int new_state);
140
141signals:
147 void deployerAdded(EditDeployerInfo info, int app_id);
154 void deployerEdited(EditDeployerInfo info, int app_id, int deployer_id);
160 void updateIgnoredFiles(int app_id, int deployer);
161};
void onFileDialogAccepted(const QString &path)
Updates the target path with given path.
Definition adddeployerdialog.cpp:202
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition adddeployerdialog.h:78
QString name_
Current name of the edited Deployer.
Definition adddeployerdialog.h:68
void on_rev_depl_ignore_cb_stateChanged(int new_state)
Shows a dialog asking for confirmation when in edit mode.
Definition adddeployerdialog.cpp:246
~AddDeployerDialog()
Deletes the UI.
Definition adddeployerdialog.cpp:21
void deployerEdited(EditDeployerInfo info, int app_id, int deployer_id)
Signals completion of the dialog in edit mode.
int deployer_id_
Id of the edited Deployer.
Definition adddeployerdialog.h:76
void setAddMode(int app_id)
Initializes this dialog to allow creating a new Deployer.
Definition adddeployerdialog.cpp:57
void setupTypeBox()
Adds all available Deployer types to the type combo box.
Definition adddeployerdialog.cpp:39
int app_id_
Id of the ModdedApplication owning the edited Deployer.
Definition adddeployerdialog.h:74
void on_rev_depl_separate_cb_stateChanged(int new_state)
Shows a dialog asking for confirmation when in edit mode.
Definition adddeployerdialog.cpp:261
Ui::AddDeployerDialog * ui
Contains auto-generated UI elements.
Definition adddeployerdialog.h:64
void updateOkButton()
Updates the state of this dialog's OK button to only be enabled when all inputs are valid.
Definition adddeployerdialog.cpp:51
QString type_
Current type of the edited Deployer.
Definition adddeployerdialog.h:72
void on_deploy_mode_box_currentIndexChanged(int index)
Hides/ shows warning labels for deploy modes.
Definition adddeployerdialog.cpp:240
bool disable_confirmation_boxes_
Disables confirmation boxes for ReverseDeployer check boxes.
Definition adddeployerdialog.h:89
void onSourceDialogAccepted(const QString &path)
Updates the source path with given path.
Definition adddeployerdialog.cpp:228
bool has_ignored_files_
Used by ReverseDeployers: If true: Deployer has files on the ignore list.
Definition adddeployerdialog.h:87
void on_buttonBox_accepted()
Closes the dialog and emits a signal for completion.
Definition adddeployerdialog.cpp:182
QString target_path_
Current target directory of the edited Deployer.
Definition adddeployerdialog.h:70
void on_file_picker_button_clicked()
Shows a file dialog for the target directory path.
Definition adddeployerdialog.cpp:155
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.
Definition adddeployerdialog.cpp:82
bool pathIsValid()
Checks whether the currently entered path exists.
Definition adddeployerdialog.cpp:31
void on_source_path_field_textChanged(const QString &path)
Only enable the OK button if a valid source directory path has been entered.
Definition adddeployerdialog.cpp:235
QString source_path_
Current target directory of the edited Deployer.
Definition adddeployerdialog.h:80
void on_source_picker_button_clicked()
Shows a file dialog for the source directory path.
Definition adddeployerdialog.cpp:213
bool has_separate_dirs_
Used by ReverseDeployers: If true: Store files on a per profile basis. Else: All profiles use the sam...
Definition adddeployerdialog.h:85
AddDeployerDialog(QWidget *parent=nullptr)
Initializes the UI.
Definition adddeployerdialog.cpp:11
void on_name_field_textChanged(const QString &text)
Only enable the OK button if a name has been entered.
Definition adddeployerdialog.cpp:170
void on_path_field_textChanged(const QString &text)
Only enable the OK button if a valid target directory path has been entered.
Definition adddeployerdialog.cpp:176
void updateIgnoredFiles(int app_id, int deployer)
Updates the file ignore list for ReverseDeployers.
bool edit_mode_
If true: Dialog is used to edit, else: Dialog is used to create.
Definition adddeployerdialog.h:66
void on_rev_depl_ignore_button_clicked()
Emits a signal to update the ignored files for the current ReverseDeployer.
Definition adddeployerdialog.cpp:277
void on_type_box_currentIndexChanged(int index)
Updates the source path widgets enabled status.
Definition adddeployerdialog.cpp:208
void updateSourceFields()
Enables/ Disables the ui elements responsible for setting a source directory.
Definition adddeployerdialog.cpp:129
void deployerAdded(EditDeployerInfo info, int app_id)
Signals completion of the dialog in add mode.
void enableOkButton(bool state)
Set the enabled state of this dialog's OK button.
Definition adddeployerdialog.cpp:26
DeployMode
Describes how files should be deployed to the target directory.
Definition deployer.h:27
Contains the EditDeployerInfo struct.
char path[256]
Path to which to extract the file.
Definition lspakfilelistentry.h:1
Stores data needed to either create a new or edit an existing deployer.
Definition editdeployerinfo.h:17