aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-07-27 23:54:15 -0400
commit6d3d39356473078c6b47e03b8a7616e4b34de928 (patch)
treefe5be2e6a08e4cfc73207746aba4c9fccfecfa10 /SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp
parentf98e49169a40876bcf1df832de6e908d1b350193 (diff)
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
Update upstream source from tag 'upstream/3.2.1+dfsg1'
Update to upstream version '3.2.1+dfsg1' with Debian dir 5ea0333565de4dc898c062cc0ff4ba1153e2c1e4
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp
deleted file mode 100644
index 19727fe..0000000
--- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "bugreportlogindialog.h"
-#include "ui_bugreportlogindialog.h"
-#include "uiutils.h"
-#include "services/bugreporter.h"
-#include "iconmanager.h"
-#include "common/widgetcover.h"
-#include <QPushButton>
-
-BugReportLoginDialog::BugReportLoginDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::BugReportLoginDialog)
-{
- init();
-}
-
-BugReportLoginDialog::~BugReportLoginDialog()
-{
- delete ui;
-}
-
-bool BugReportLoginDialog::isValid() const
-{
- return validCredentials;
-}
-
-QString BugReportLoginDialog::getLogin() const
-{
- return ui->loginEdit->text();
-}
-
-QString BugReportLoginDialog::getPassword() const
-{
- return ui->passwordEdit->text();
-}
-
-void BugReportLoginDialog::init()
-{
- ui->setupUi(this);
- connect(ui->loginEdit, SIGNAL(textChanged(QString)), this, SLOT(credentialsChanged()));
- connect(ui->passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(credentialsChanged()));
- connect(ui->validationButton, SIGNAL(clicked()), this, SLOT(remoteValidation()));
- connect(BUGS, SIGNAL(credentialsValidationResult(bool,QString)), this, SLOT(remoteValidationResult(bool,QString)));
-
- widgetCover = new WidgetCover(this);
- widgetCover->initWithInterruptContainer(tr("Abort"));
- connect(widgetCover, SIGNAL(cancelClicked()), this, SLOT(abortRemoteValidation()));
-
- validate();
-}
-
-void BugReportLoginDialog::credentialsChanged()
-{
- validCredentials = false;
- validate();
-}
-
-void BugReportLoginDialog::validate()
-{
- QString login = ui->loginEdit->text();
- QString pass = ui->passwordEdit->text();
-
- bool loginOk = login.size() >= 2;
- bool passOk = pass.size() >= 5;
-
- setValidState(ui->loginEdit, loginOk, tr("A login must be at least 2 characters long."));
- setValidState(ui->passwordEdit, passOk, tr("A password must be at least 5 characters long."));
-
- bool credentialsOk = loginOk && passOk;
- ui->validationButton->setEnabled(credentialsOk);
- ui->validationLabel->setEnabled(credentialsOk);
-
- bool valid = credentialsOk && validCredentials;
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
-}
-
-void BugReportLoginDialog::abortRemoteValidation()
-{
- BUGS->abortCredentialsValidation();
-}
-
-void BugReportLoginDialog::remoteValidation()
-{
- widgetCover->show();
- BUGS->validateBugReportCredentials(ui->loginEdit->text(), ui->passwordEdit->text());
-}
-
-void BugReportLoginDialog::remoteValidationResult(bool success, const QString& errorMessage)
-{
- validCredentials = success;
- ui->validationButton->setIcon(success ? ICONS.TEST_CONN_OK : ICONS.TEST_CONN_ERROR);
- ui->validationLabel->setText(success ? tr("Valid") : errorMessage);
- validate();
- widgetCover->hide();
-}