diff options
author | Alexandru Ionut Tripon <alexandru.tripon97@gmail.com> | 2023-08-12 12:42:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 12:42:30 +0300 |
commit | b3b2e9df35222209b4920202d86091eeeb87f03f (patch) | |
tree | ce44c3877ee36c21279d142b2af1c393e7b87780 /launcher/ui/dialogs/LoginDialog.cpp | |
parent | ca061080c13042642fb3bd49a29a863756f45866 (diff) | |
parent | 3aba7f8fec45c7c87be486d8f6b5c96f69facf93 (diff) | |
download | PrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.tar.gz PrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.tar.bz2 PrismLauncher-b3b2e9df35222209b4920202d86091eeeb87f03f.zip |
Merge branch 'develop' into feat/acknowledge_release_type
Signed-off-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui/dialogs/LoginDialog.cpp')
-rw-r--r-- | launcher/ui/dialogs/LoginDialog.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/launcher/ui/dialogs/LoginDialog.cpp b/launcher/ui/dialogs/LoginDialog.cpp index 30394b72..7296a13e 100644 --- a/launcher/ui/dialogs/LoginDialog.cpp +++ b/launcher/ui/dialogs/LoginDialog.cpp @@ -20,7 +20,7 @@ #include <QtWidgets/QPushButton> -LoginDialog::LoginDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LoginDialog) +LoginDialog::LoginDialog(QWidget* parent) : QDialog(parent), ui(new Ui::LoginDialog) { ui->setupUi(this); ui->progressBar->setVisible(false); @@ -59,27 +59,24 @@ void LoginDialog::setUserInputsEnabled(bool enable) } // Enable the OK button only when both textboxes contain something. -void LoginDialog::on_userTextBox_textEdited(const QString &newText) +void LoginDialog::on_userTextBox_textEdited(const QString& newText) { - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(!newText.isEmpty() && !ui->passTextBox->text().isEmpty()); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!newText.isEmpty() && !ui->passTextBox->text().isEmpty()); } -void LoginDialog::on_passTextBox_textEdited(const QString &newText) +void LoginDialog::on_passTextBox_textEdited(const QString& newText) { - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(!newText.isEmpty() && !ui->userTextBox->text().isEmpty()); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!newText.isEmpty() && !ui->userTextBox->text().isEmpty()); } -void LoginDialog::onTaskFailed(const QString &reason) +void LoginDialog::onTaskFailed(const QString& reason) { // Set message auto lines = reason.split('\n'); QString processed; - for(auto line: lines) { - if(line.size()) { + for (auto line : lines) { + if (line.size()) { processed += "<font color='red'>" + line + "</font><br />"; - } - else { + } else { processed += "<br />"; } } @@ -95,7 +92,7 @@ void LoginDialog::onTaskSucceeded() QDialog::accept(); } -void LoginDialog::onTaskStatus(const QString &status) +void LoginDialog::onTaskStatus(const QString& status) { ui->label->setText(status); } @@ -107,12 +104,11 @@ void LoginDialog::onTaskProgress(qint64 current, qint64 total) } // Public interface -MinecraftAccountPtr LoginDialog::newAccount(QWidget *parent, QString msg) +MinecraftAccountPtr LoginDialog::newAccount(QWidget* parent, QString msg) { LoginDialog dlg(parent); dlg.ui->label->setText(msg); - if (dlg.exec() == QDialog::Accepted) - { + if (dlg.exec() == QDialog::Accepted) { return dlg.m_account; } return nullptr; |