Limo
A simple mod manager
Loading...
Searching...
No Matches
ImportFromSteamDialog Class Reference
Inheritance diagram for ImportFromSteamDialog:
Collaboration diagram for ImportFromSteamDialog:

Signals

void applicationImported (QString name, QString app_id, QString install_dir, QString prefix_path, QString icon_path)
 Signals completion of the dialog.
 

Public Member Functions

 ImportFromSteamDialog (QWidget *parent=nullptr)
 Initializes the UI.
 
 ~ImportFromSteamDialog ()
 Deletes the UI.
 
void init ()
 Initializes the dialog.
 

Private Slots

void on_pick_path_button_clicked ()
 Opens a file dialog to chose the steam path.
 
void on_buttonBox_accepted ()
 Closes the dialog and emits a signal for completion.
 
void on_path_field_editingFinished ()
 Updates ui->app_table with information from the selected directory.
 
void on_search_field_textEdited (const QString &new_text)
 Called when the text in ui->search_field has been edited by the user.
 

Private Member Functions

bool pathIsValid (std::filesystem::path path) const
 Checks if given path contains the library file.
 
void updateTable (std::filesystem::path steam_dir)
 Updates ui->app_table with all apps listed in the library file.
 
bool addTableRow (std::string app_id, std::filesystem::path path)
 Adds a row to ui->app_table containing information about the app pertaining the given app_id.
 
void showError (QString title, QString message)
 Shows an error in a QMessageBox with given title and message.
 

Private Attributes

Ui::ImportFromSteamDialog * ui
 Contains auto-generated ui elements.
 
const std::string library_file_name_ = "libraryfolders.vdf"
 Name of the file containing all installed steam apps.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 

Constructor & Destructor Documentation

◆ ImportFromSteamDialog()

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

Initializes the UI.

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

Member Function Documentation

◆ addTableRow()

bool ImportFromSteamDialog::addTableRow ( std::string app_id,
std::filesystem::path path )
private

Adds a row to ui->app_table containing information about the app pertaining the given app_id.

Parameters
app_idTarget app_id.
pathPath to the apps library folder.
Returns
True if a new row has been added.

◆ applicationImported

void ImportFromSteamDialog::applicationImported ( QString name,
QString app_id,
QString install_dir,
QString prefix_path,
QString icon_path )
signal

Signals completion of the dialog.

Parameters
nameName of the imported application.
app_idSteam app_id of the imported application.
install_dirName of the directory under steamapps which contains the new applications files.
prefix_pathPath to the applications Proton prefix, or empty if none exists.
icon_pathPath to the applications icon.

◆ on_search_field_textEdited

void ImportFromSteamDialog::on_search_field_textEdited ( const QString & new_text)
privateslot

Called when the text in ui->search_field has been edited by the user.

Parameters
new_textThe newly entered text.

◆ pathIsValid()

bool ImportFromSteamDialog::pathIsValid ( std::filesystem::path path) const
private

Checks if given path contains the library file.

Parameters
pathPath to be checked.
Returns
True if path contains a file named library_file_name, else False.

◆ showError()

void ImportFromSteamDialog::showError ( QString title,
QString message )
private

Shows an error in a QMessageBox with given title and message.

Parameters
titleTitle of the error box.
messageError message to be displayed.

◆ updateTable()

void ImportFromSteamDialog::updateTable ( std::filesystem::path steam_dir)
private

Updates ui->app_table with all apps listed in the library file.

Parameters
steam_dirPath to steam installation.

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