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

Used to edit the local and remote sources of a given mod. More...

#include <editmodsourcesdialog.h>

Inheritance diagram for EditModSourcesDialog:
Collaboration diagram for EditModSourcesDialog:

Signals

void modSourcesEdited (int app_id, int mod_id, QString local_source, QString remote_source)
 Signals successful dialog completion.
 
void dialogClosed ()
 Signals cancellation of editing.
 

Public Member Functions

 EditModSourcesDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~EditModSourcesDialog ()
 Deletes the UI.
 
void setupDialog (int app_id, int mod_id, const QString &mod_name, const QString &local_source, const QString &remote_source)
 Initializes the dialog with the given data.
 
void closeEvent (QCloseEvent *event) override
 Emits dialogClosed.
 
void reject () override
 Closes the dialog and emits a signal indicating the dialog has been closed.
 

Private Slots

void onFileDialogAccepted (const QString &path)
 Updates the local source field with the new path.
 
void onFileDialogSelectionChanged (const QString &path)
 Updates the file mode of file_dialog_ to allow selection of both files and directories.
 
void on_buttonBox_accepted ()
 Completes the dialog by emitting modSourcesEdited.
 
void on_buttonBox_rejected ()
 Signals cancellation of editing by emitting dialogClosed.
 
void on_path_picker_button_clicked ()
 Shows a file dialog for editing the local source path.
 

Private Attributes

Ui::EditModSourcesDialog * ui
 Contains auto generated UI elements.
 
int app_id_
 App to which the edited mod belongs.
 
int mod_id_
 Target mod id.
 
std::unique_ptr< QFileDialog > file_dialog_
 Dialog used for selecting a local source.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 

Detailed Description

Used to edit the local and remote sources of a given mod.

Constructor & Destructor Documentation

◆ EditModSourcesDialog()

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

Initializes the UI.

Parameters
parentParent widget of this dialog. Passed to the constructor of QDialog.

Member Function Documentation

◆ closeEvent()

void EditModSourcesDialog::closeEvent ( QCloseEvent * event)
override

Emits dialogClosed.

Parameters
eventThe close event sent upon closing the dialog.

◆ modSourcesEdited

void EditModSourcesDialog::modSourcesEdited ( int app_id,
int mod_id,
QString local_source,
QString remote_source )
signal

Signals successful dialog completion.

Parameters
app_idApp to which the edited mod belongs.
mod_idTarget mod id.
local_sourcePath to a local archive or directory used for mod installation.
remote_sourceRemote URL from which the mod was downloaded.

◆ onFileDialogAccepted

void EditModSourcesDialog::onFileDialogAccepted ( const QString & path)
privateslot

Updates the local source field with the new path.

Parameters
pathThe selected path.

◆ onFileDialogSelectionChanged

void EditModSourcesDialog::onFileDialogSelectionChanged ( const QString & path)
privateslot

Updates the file mode of file_dialog_ to allow selection of both files and directories.

Parameters
pathCurrently selected item.

◆ setupDialog()

void EditModSourcesDialog::setupDialog ( int app_id,
int mod_id,
const QString & mod_name,
const QString & local_source,
const QString & remote_source )

Initializes the dialog with the given data.

Parameters
app_idApp to which the edited mod belongs.
mod_idTarget mod id.
mod_nameTarget mod name.
local_sourcePath to a local archive or directory used for mod installation.
remote_sourceRemote URL from which the mod was downloaded.

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