Log SSL errors, give common solutions
This commit is contained in:
@ -865,6 +865,8 @@ void MainWindow::doLaunch()
|
||||
if (!account.get())
|
||||
return;
|
||||
|
||||
QString failReason = tr("Your account is currently not logged in. Please enter "
|
||||
"your password to log in again.");
|
||||
// do the login. if the account has an access token, try to refresh it first.
|
||||
if (account->accountStatus() != NotVerified)
|
||||
{
|
||||
@ -879,13 +881,28 @@ void MainWindow::doLaunch()
|
||||
{
|
||||
updateInstance(m_selectedInstance, account);
|
||||
}
|
||||
// revert from online to verified.
|
||||
else
|
||||
{
|
||||
if (!task->successful())
|
||||
{
|
||||
failReason = task->failReason();
|
||||
}
|
||||
if (loginWithPassword(account, failReason))
|
||||
updateInstance(m_selectedInstance, account);
|
||||
}
|
||||
// in any case, revert from online to verified.
|
||||
account->downgrade();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (loginWithPassword(account, failReason))
|
||||
{
|
||||
updateInstance(m_selectedInstance, account);
|
||||
account->downgrade();
|
||||
}
|
||||
// in any case, revert from online to verified.
|
||||
account->downgrade();
|
||||
return;
|
||||
}
|
||||
if (loginWithPassword(account, tr("Your account is currently not logged in. Please enter "
|
||||
"your password to log in again.")))
|
||||
updateInstance(m_selectedInstance, account);
|
||||
}
|
||||
|
||||
bool MainWindow::loginWithPassword(MojangAccountPtr account, const QString &errorMsg)
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
#include "EditAccountDialog.h"
|
||||
#include "ui_EditAccountDialog.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
EditAccountDialog::EditAccountDialog(const QString &text, QWidget *parent, int flags)
|
||||
: QDialog(parent), ui(new Ui::EditAccountDialog)
|
||||
@ -33,6 +35,11 @@ EditAccountDialog::~EditAccountDialog()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EditAccountDialog::on_label_linkActivated(const QString &link)
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
}
|
||||
|
||||
QString EditAccountDialog::username() const
|
||||
{
|
||||
return ui->userTextBox->text();
|
||||
|
@ -52,6 +52,9 @@ public:
|
||||
PasswordField,
|
||||
};
|
||||
|
||||
private slots:
|
||||
void on_label_linkActivated(const QString &link);
|
||||
|
||||
private:
|
||||
Ui::EditAccountDialog *ui;
|
||||
};
|
||||
|
@ -19,6 +19,12 @@
|
||||
<property name="text">
|
||||
<string>Message label placeholder.</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
Reference in New Issue
Block a user