add tooltip to url button
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
2b229d7326
commit
7fdc65eda8
@ -46,6 +46,8 @@
|
||||
MSADeviceCodeStep::MSADeviceCodeStep(AccountData* data) : AuthStep(data)
|
||||
{
|
||||
m_clientId = APPLICATION->getMSAClientID();
|
||||
connect(&m_expiration_timer, &QTimer::timeout, this, &MSADeviceCodeStep::abort);
|
||||
connect(&m_pool_timer, &QTimer::timeout, this, &MSADeviceCodeStep::authenticateUser);
|
||||
}
|
||||
|
||||
QString MSADeviceCodeStep::describe()
|
||||
@ -133,11 +135,9 @@ void MSADeviceCodeStep::deviceAutorizationFinished()
|
||||
m_expiration_timer.setTimerType(Qt::VeryCoarseTimer);
|
||||
m_expiration_timer.setInterval(rsp.expires_in * 1000);
|
||||
m_expiration_timer.setSingleShot(true);
|
||||
connect(&m_expiration_timer, &QTimer::timeout, this, &MSADeviceCodeStep::abort);
|
||||
m_expiration_timer.start();
|
||||
m_pool_timer.setTimerType(Qt::VeryCoarseTimer);
|
||||
m_pool_timer.setSingleShot(true);
|
||||
connect(&m_pool_timer, &QTimer::timeout, this, &MSADeviceCodeStep::authenticateUser);
|
||||
startPoolTimer();
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,11 @@ MSALoginDialog::MSALoginDialog(QWidget* parent) : QDialog(parent), ui(new Ui::MS
|
||||
ui->qr->setPixmap(QIcon((":/documents/login-qr.svg")).pixmap(QSize(150, 150)));
|
||||
ui->title->setText(tr("Login to %1").arg(BuildConfig.LAUNCHER_DISPLAYNAME));
|
||||
connect(ui->loginButton, &QPushButton::clicked, this, [this] {
|
||||
if (m_url.isValid())
|
||||
DesktopServices::openUrl(m_url);
|
||||
if (m_url.isValid()) {
|
||||
if (!DesktopServices::openUrl(m_url)) {
|
||||
QApplication::clipboard()->setText(m_url.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -104,6 +107,8 @@ MSALoginDialog::~MSALoginDialog()
|
||||
void MSALoginDialog::onTaskFailed(QString reason)
|
||||
{
|
||||
// Set message
|
||||
m_authflow_task->disconnect();
|
||||
m_devicecode_task->disconnect();
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
auto lines = reason.split('\n');
|
||||
QString processed;
|
||||
@ -127,6 +132,7 @@ void MSALoginDialog::onTaskFailed(QString reason)
|
||||
void MSALoginDialog::authorizeWithBrowser(const QUrl& url)
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(1);
|
||||
ui->loginButton->setToolTip(QString("<div style='width: 200px;'>%1</div>").arg(url.toString()));
|
||||
m_url = url;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user