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

Dialog for adding new backup targets. More...

#include <addbackuptargetdialog.h>

Inheritance diagram for AddBackupTargetDialog:
Collaboration diagram for AddBackupTargetDialog:

Signals

void backupTargetAdded (int app_id, QString target_name, QString target_path, QString default_backup, QString first_backup)
 Signals dialog has been accepted.
 

Public Member Functions

 AddBackupTargetDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~AddBackupTargetDialog ()
 Deletes the UI.
 
void resetDialog (int app_id)
 Removes the text from all input fields.
 

Private Slots

void on_target_name_field_textEdited (const QString &text)
 Calls updateOkButton.
 
void on_target_path_field_textEdited (const QString &text)
 Calls updateOkButton.
 
void on_default_backup_field_textEdited (const QString &text)
 Calls updateOkButton.
 
void on_buttonBox_accepted ()
 Signals dialog completion by emitting backupTargetAdded.
 
void on_path_picker_button_clicked ()
 Opens a file dialog to pick a target path.
 
void onFileDialogAccepted (const QString &path)
 Updates the target path 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.
 

Private Member Functions

void updateOkButton ()
 Updates the Ok button to only be enabled if the target path, name and default backup fields are filled.
 
bool pathIsValid ()
 Verifies if the target path field refers to an existing file or directory.
 

Private Attributes

Ui::AddBackupTargetDialog * ui
 Contains auto-generated UI elements.
 
std::unique_ptr< QFileDialog > file_dialog_
 File dialog used to select a backup target.
 
int app_id_
 Application to which the new backup target is to be added.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 

Detailed Description

Dialog for adding new backup targets.

Constructor & Destructor Documentation

◆ AddBackupTargetDialog()

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

Initializes the UI.

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

Member Function Documentation

◆ backupTargetAdded

void AddBackupTargetDialog::backupTargetAdded ( int app_id,
QString target_name,
QString target_path,
QString default_backup,
QString first_backup )
signal

Signals dialog has been accepted.

Parameters
app_idApplication to which the new backup target is to be added.
target_nameName of the new backup target.
target_pathPath to the file or directory to be managed.
default_backupName of the currently active version of the target.
first_backupIf not empty: Name of the first backup.

◆ on_default_backup_field_textEdited

void AddBackupTargetDialog::on_default_backup_field_textEdited ( const QString & text)
privateslot

Calls updateOkButton.

Parameters
textIgnored.

◆ on_target_name_field_textEdited

void AddBackupTargetDialog::on_target_name_field_textEdited ( const QString & text)
privateslot

Calls updateOkButton.

Parameters
textIgnored.

◆ on_target_path_field_textEdited

void AddBackupTargetDialog::on_target_path_field_textEdited ( const QString & text)
privateslot

Calls updateOkButton.

Parameters
textIgnored.

◆ onFileDialogAccepted

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

Updates the target path field with the new path.

Parameters
pathThe selected path.

◆ onFileDialogSelectionChanged

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

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

Parameters
pathCurrently selected item.

◆ resetDialog()

void AddBackupTargetDialog::resetDialog ( int app_id)

Removes the text from all input fields.

Parameters
app_idApplication to which the new backup target is to be added.

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