1 | #include "CredentialsDlg.h" |
---|---|
2 | #include "ui_CredentialsDlg.h" |
3 | |
4 | #include <GitCredentials.h> |
5 | |
6 | CredentialsDlg::CredentialsDlg(const QSharedPointer<GitBase> &git, QWidget *parent) |
7 | : QDialog(parent) |
8 | , ui(new Ui::CredentialsDlg) |
9 | , mGit(git) |
10 | { |
11 | ui->setupUi(this); |
12 | } |
13 | |
14 | CredentialsDlg::~CredentialsDlg() |
15 | { |
16 | delete ui; |
17 | } |
18 | |
19 | void CredentialsDlg::accept() |
20 | { |
21 | const auto username = ui->leUser->text(); |
22 | const auto password = ui->lePass->text(); |
23 | |
24 | if (!username.isEmpty() && !password.isEmpty()) |
25 | GitCredentials::configureStorage(username, password, mGit); |
26 | |
27 | QDialog::accept(); |
28 | } |
29 |