Limo
A simple mod manager
Loading...
Searching...
No Matches
addtogroupdialog.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QCompleter>
9#include <QDialog>
10#include <vector>
11
12
13namespace Ui
14{
15class AddToGroupDialog;
16}
17
21class AddToGroupDialog : public QDialog
22{
23 Q_OBJECT
24
25public:
30 explicit AddToGroupDialog(QWidget* parent = nullptr);
33
41 void setupDialog(const QStringList& groups,
42 const std::vector<int>& mod_ids,
43 const QString& mod_name,
44 int mod_id);
45
46private:
48 Ui::AddToGroupDialog* ui;
52 std::vector<int> mod_ids_;
54 std::unique_ptr<QCompleter> completer_;
56 QStringList groups_;
58 bool dialog_completed_ = false;
59
60signals:
66 void modAddedToGroup(int mod_id, int target_id);
67private slots:
74 void on_group_field_textChanged(const QString& text);
75};
int mod_id_
Id of the mod which is to be added to a group.
Definition addtogroupdialog.h:50
void on_group_field_textChanged(const QString &text)
Ensures Ok button is only available when a valid group has been selected.
Definition addtogroupdialog.cpp:49
QStringList groups_
Contains names of all available groups.
Definition addtogroupdialog.h:56
void on_buttonBox_accepted()
Closes the dialog and emits a signal for completion.
Definition addtogroupdialog.cpp:38
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition addtogroupdialog.h:58
std::vector< int > mod_ids_
Ids of all installed mods except the target mod.
Definition addtogroupdialog.h:52
void modAddedToGroup(int mod_id, int target_id)
Signals completion of the dialog.
Ui::AddToGroupDialog * ui
Contains auto-generated UI elements.
Definition addtogroupdialog.h:48
std::unique_ptr< QCompleter > completer_
Completer used for group names.
Definition addtogroupdialog.h:54
void setupDialog(const QStringList &groups, const std::vector< int > &mod_ids, const QString &mod_name, int mod_id)
Initializes the dialog.
Definition addtogroupdialog.cpp:20
AddToGroupDialog(QWidget *parent=nullptr)
Initializes the UI.
Definition addtogroupdialog.cpp:7
~AddToGroupDialog()
Deletes the UI.
Definition addtogroupdialog.cpp:15