Limo
A simple mod manager
Loading...
Searching...
No Matches
editmodsourcesdialog.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QDialog>
9#include <QFileDialog>
10
11
12namespace Ui
13{
14class EditModSourcesDialog;
15}
16
20class EditModSourcesDialog : public QDialog
21{
22 Q_OBJECT
23
24public:
29 explicit EditModSourcesDialog(QWidget* parent = nullptr);
32
41 void setupDialog(int app_id,
42 int mod_id,
43 const QString& mod_name,
44 const QString& local_source,
45 const QString& remote_source);
50 void closeEvent(QCloseEvent* event) override;
52 void reject() override;
53
54private:
56 Ui::EditModSourcesDialog* ui;
62 std::unique_ptr<QFileDialog> file_dialog_;
64 bool dialog_completed_ = false;
65
66private slots:
71 void onFileDialogAccepted(const QString& path);
77 void onFileDialogSelectionChanged(const QString& path);
78
79signals:
87 void modSourcesEdited(int app_id, int mod_id, QString local_source, QString remote_source);
90
91private slots:
98};
void onFileDialogSelectionChanged(const QString &path)
Updates the file mode of file_dialog_ to allow selection of both files and directories.
Definition editmodsourcesdialog.cpp:67
std::unique_ptr< QFileDialog > file_dialog_
Dialog used for selecting a local source.
Definition editmodsourcesdialog.h:62
EditModSourcesDialog(QWidget *parent=nullptr)
Initializes the UI.
Definition editmodsourcesdialog.cpp:6
void setupDialog(int app_id, int mod_id, const QString &mod_name, const QString &local_source, const QString &remote_source)
Initializes the dialog with the given data.
Definition editmodsourcesdialog.cpp:29
void modSourcesEdited(int app_id, int mod_id, QString local_source, QString remote_source)
Signals successful dialog completion.
~EditModSourcesDialog()
Deletes the UI.
Definition editmodsourcesdialog.cpp:24
Ui::EditModSourcesDialog * ui
Contains auto generated UI elements.
Definition editmodsourcesdialog.h:56
void onFileDialogAccepted(const QString &path)
Updates the local source field with the new path.
Definition editmodsourcesdialog.cpp:61
void on_path_picker_button_clicked()
Shows a file dialog for editing the local source path.
Definition editmodsourcesdialog.cpp:95
int mod_id_
Target mod id.
Definition editmodsourcesdialog.h:60
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition editmodsourcesdialog.h:64
void on_buttonBox_accepted()
Completes the dialog by emitting modSourcesEdited.
Definition editmodsourcesdialog.cpp:76
void reject() override
Closes the dialog and emits a signal indicating the dialog has been closed.
Definition editmodsourcesdialog.cpp:52
int app_id_
App to which the edited mod belongs.
Definition editmodsourcesdialog.h:58
void dialogClosed()
Signals cancellation of editing.
void closeEvent(QCloseEvent *event) override
Emits dialogClosed.
Definition editmodsourcesdialog.cpp:43
void on_buttonBox_rejected()
Signals cancellation of editing by emitting dialogClosed.
Definition editmodsourcesdialog.cpp:86
char path[256]
Path to which to extract the file.
Definition lspakfilelistentry.h:1