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

Dialog for adding a new tool. More...

#include <addtooldialog.h>

Inheritance diagram for AddToolDialog:
Collaboration diagram for AddToolDialog:

Signals

void toolAdded (int app_id, Tool tool)
 Signals dialog completion in add mode.
 
void toolEdited (int app_id, int tool_id, Tool tool)
 Signals dialog completion in edit mode.
 

Public Member Functions

 AddToolDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~AddToolDialog ()
 Deletes the UI.
 
void setAddMode (int app_id)
 Initializes the dialog for adding a new tool.
 
void setEditMode (int app_id, int tool_id, Tool tool)
 Initializes the dialog for editing an existing tool.
 

Private Slots

void toolWidgetInputValidityChanged (bool is_valid)
 Updates the Ok button when the new input is valid.
 
void onButtonBoxAccepted ()
 Closes the dialog and emits a signal for completion.
 

Private Attributes

Ui::AddToolDialog * ui
 Contains auto-generated UI elements.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 
bool is_edit_mode_ = false
 If true: Dialog is used to edit an existing tool. Else: Dialog is used to add a new tool.
 
int app_id_
 Id of the app to which the edited tool belongs.
 
int tool_id_
 If in edit mode: Id of the edited tool.
 

Detailed Description

Dialog for adding a new tool.

Constructor & Destructor Documentation

◆ AddToolDialog()

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

Initializes the UI.

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

Member Function Documentation

◆ setAddMode()

void AddToolDialog::setAddMode ( int app_id)

Initializes the dialog for adding a new tool.

Parameters
app_idId of the app to which the tool is to be added.

◆ setEditMode()

void AddToolDialog::setEditMode ( int app_id,
int tool_id,
Tool tool )

Initializes the dialog for editing an existing tool.

Parameters
app_idId of the app to which the edited tool belongs.
tool_idId of the edited tool.
toolThe existing tool.

◆ toolAdded

void AddToolDialog::toolAdded ( int app_id,
Tool tool )
signal

Signals dialog completion in add mode.

Parameters
app_idId of the app to which the tool is to be added.
toolThe new tool.

◆ toolEdited

void AddToolDialog::toolEdited ( int app_id,
int tool_id,
Tool tool )
signal

Signals dialog completion in edit mode.

Parameters
app_idId of the app to which the edited tool belongs.
tool_idId of the edited tool.
toolThe new tool.

◆ toolWidgetInputValidityChanged

void AddToolDialog::toolWidgetInputValidityChanged ( bool is_valid)
privateslot

Updates the Ok button when the new input is valid.

Parameters
is_validNew input validity.

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