mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refs #911, load indicator for login component
This commit is contained in:
committed by
Mathew Sutcliffe
parent
24af0f044f
commit
a5946e1727
@@ -40,6 +40,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
CDbLoginComponent::CDbLoginComponent(QWidget *parent) :
|
CDbLoginComponent::CDbLoginComponent(QWidget *parent) :
|
||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
|
CLoadIndicatorEnabled(this),
|
||||||
ui(new Ui::CDbLoginComponent)
|
ui(new Ui::CDbLoginComponent)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||||
@@ -55,7 +56,12 @@ namespace BlackGui
|
|||||||
|
|
||||||
const bool devEnv = sGui->isRunningInDeveloperEnvironment();
|
const bool devEnv = sGui->isRunningInDeveloperEnvironment();
|
||||||
ui->comp_DebugSetup->setVisible(devEnv);
|
ui->comp_DebugSetup->setVisible(devEnv);
|
||||||
ui->lbl_DatabaseName->setText(sGui->getGlobalSetup().getDbHomePageUrl().toQString());
|
|
||||||
|
const QString dbUrl = sGui->getGlobalSetup().getDbHomePageUrl().toQString();
|
||||||
|
ui->lbl_DatabaseName->setText("<a href=\"" + dbUrl + "\">" + dbUrl + "</a>");
|
||||||
|
ui->lbl_DatabaseName->setTextFormat(Qt::RichText);
|
||||||
|
ui->lbl_DatabaseName->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
ui->lbl_DatabaseName->setOpenExternalLinks(true);
|
||||||
|
|
||||||
connect(ui->pb_Login, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLoginClicked);
|
connect(ui->pb_Login, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLoginClicked);
|
||||||
connect(ui->pb_Logoff, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLogoffClicked);
|
connect(ui->pb_Logoff, &QPushButton::clicked, this, &CDbLoginComponent::ps_onLogoffClicked);
|
||||||
@@ -104,6 +110,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
CLogMessage::preformatted(msgs);
|
CLogMessage::preformatted(msgs);
|
||||||
}
|
}
|
||||||
|
this->showLoading(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbLoginComponent::ps_onLogoffClicked()
|
void CDbLoginComponent::ps_onLogoffClicked()
|
||||||
@@ -114,6 +121,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbLoginComponent::ps_authenticationFinished(const CAuthenticatedUser &user, const CStatusMessageList &statusMsgs)
|
void CDbLoginComponent::ps_authenticationFinished(const CAuthenticatedUser &user, const CStatusMessageList &statusMsgs)
|
||||||
{
|
{
|
||||||
|
this->hideLoading();
|
||||||
this->setUserInfo(user);
|
this->setUserInfo(user);
|
||||||
if (statusMsgs.hasWarningOrErrorMessages())
|
if (statusMsgs.hasWarningOrErrorMessages())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "blackcore/db/databaseauthentication.h"
|
#include "blackcore/db/databaseauthentication.h"
|
||||||
#include "blackcore/data/globalsetup.h"
|
#include "blackcore/data/globalsetup.h"
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
|
#include "blackgui/loadindicator.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
@@ -30,7 +31,8 @@ namespace BlackGui
|
|||||||
/**
|
/**
|
||||||
* Login to DB
|
* Login to DB
|
||||||
*/
|
*/
|
||||||
class BLACKGUI_EXPORT CDbLoginComponent : public QFrame
|
class BLACKGUI_EXPORT CDbLoginComponent :
|
||||||
|
public QFrame, public BlackGui::CLoadIndicatorEnabled
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ namespace BlackGui
|
|||||||
explicit CDbLoginComponent(QWidget *parent = nullptr);
|
explicit CDbLoginComponent(QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~CDbLoginComponent();
|
virtual ~CDbLoginComponent();
|
||||||
|
|
||||||
//! DB user
|
//! DB user
|
||||||
BlackMisc::Network::CAuthenticatedUser getDbUser() const;
|
BlackMisc::Network::CAuthenticatedUser getDbUser() const;
|
||||||
|
|||||||
@@ -210,6 +210,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Database URL will go here</string>
|
<string>Database URL will go here</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user