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

Dialog used to add, remove or rename manual tags. More...

#include <editmanualtagsdialog.h>

Inheritance diagram for EditManualTagsDialog:
Collaboration diagram for EditManualTagsDialog:

Signals

void manualTagsEdited (int app_id, std::vector< EditManualTagAction > actions)
 Signals dialog completion.
 
void dialogClosed ()
 Signals tag editing has been cancled without action.
 

Public Member Functions

 EditManualTagsDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~EditManualTagsDialog ()
 Deletes the UI.
 
void setupDialog (int app_id, const QStringList &tag_names, const std::vector< int > num_mods_per_tag)
 Initializes this 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 onTagRemoved (int row, int col)
 Removed the tag in the given row of the tag table.
 
void onTagAdded ()
 Adds a new tag.
 
void onTableCellEdited (int row, int col)
 Renames the tag in the given row.
 
void on_buttonBox_accepted ()
 Emits manualTagsEdited with all actions performed in this dialog.
 
void on_buttonBox_rejected ()
 Emits a signal that this dialog has been closed without changes.
 

Private Member Functions

void updateTable ()
 Updates the tag table with data stored in tag_names_ and num_mods_per_tag_.
 

Private Attributes

Ui::EditManualTagsDialog * ui
 Contains auto-generated UI elements.
 
int app_id_
 App for which the tags are to be edited.
 
QStringList tag_names_
 Contains names of all tags. Names are unique.
 
std::vector< int > num_mods_per_tag_
 For every tag: The number of mods to which the tag has been added.
 
std::vector< EditManualTagActionactions_
 Contains all actions performed in this dialog. Emitted after dialog completes.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 

Static Private Attributes

static constexpr int ACTION_COL = 0
 Action column in the tag table.
 
static constexpr int NAME_COL = 1
 Tag name column in the tag table.
 
static constexpr int NUM_MODS_COL = 2
 Number of mods column in the tag table.
 

Detailed Description

Dialog used to add, remove or rename manual tags.

Constructor & Destructor Documentation

◆ EditManualTagsDialog()

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

Initializes the UI.

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

Member Function Documentation

◆ closeEvent()

void EditManualTagsDialog::closeEvent ( QCloseEvent * event)
override

Emits dialogClosed.

Parameters
eventThe close event sent upon closing the dialog.

◆ manualTagsEdited

void EditManualTagsDialog::manualTagsEdited ( int app_id,
std::vector< EditManualTagAction > actions )
signal

Signals dialog completion.

Parameters
app_idApp for which the tags are to be edited.
actionsAll actions performed in this dialog in the order in which they have been performed by the user.

◆ onTableCellEdited

void EditManualTagsDialog::onTableCellEdited ( int row,
int col )
privateslot

Renames the tag in the given row.

Parameters
rowTarget row.
colColumn of the tag name. Not used.

◆ onTagRemoved

void EditManualTagsDialog::onTagRemoved ( int row,
int col )
privateslot

Removed the tag in the given row of the tag table.

Parameters
rowTarget row.
colContains the buttons column. Not used.

◆ setupDialog()

void EditManualTagsDialog::setupDialog ( int app_id,
const QStringList & tag_names,
const std::vector< int > num_mods_per_tag )

Initializes this dialog with the given data.

Parameters
app_idApp for which the tags are to be edited.
tag_namesNames of all manual tags belonging to the given app. Names must be unique.
num_mods_per_tagNumber of mods for every given tag.

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