mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 21:05:31 +08:00
Ref T659, login dialog and connected signal/slots with main GUI
This commit is contained in:
committed by
Mat Sutcliffe
parent
7e4e4f0d37
commit
83e8597b14
@@ -19,10 +19,29 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
connect(ui->comp_LoginComponent, &CLoginAdvComponent::loginOrLogoffSuccessful, this, &CLoginDialog::onLoginOrLogoffSuccessful);
|
||||||
|
connect(ui->comp_LoginComponent, &CLoginAdvComponent::loginOrLogoffCancelled, this, &CLoginDialog::onLoginOrLogoffCancelled);
|
||||||
|
connect(ui->comp_LoginComponent, &CLoginAdvComponent::requestNetworkSettings, this, &CLoginDialog::onRequestNetworkSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLoginDialog::~CLoginDialog()
|
CLoginDialog::~CLoginDialog()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
void CLoginDialog::onLoginOrLogoffCancelled()
|
||||||
|
{
|
||||||
|
this->reject();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLoginDialog::onLoginOrLogoffSuccessful()
|
||||||
|
{
|
||||||
|
this->accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLoginDialog::onRequestNetworkSettings()
|
||||||
|
{
|
||||||
|
emit this->requestNetworkSettings();
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
}// ns
|
}// ns
|
||||||
|
|||||||
@@ -33,7 +33,15 @@ namespace BlackGui
|
|||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CLoginDialog() override;
|
virtual ~CLoginDialog() override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
//! Request server settings
|
||||||
|
void requestNetworkSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onLoginOrLogoffCancelled();
|
||||||
|
void onLoginOrLogoffSuccessful();
|
||||||
|
void onRequestNetworkSettings();
|
||||||
|
|
||||||
QScopedPointer<Ui::CLoginDialog> ui;
|
QScopedPointer<Ui::CLoginDialog> ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,16 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>640</width>
|
<width>350</width>
|
||||||
<height>480</height>
|
<height>500</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>350</width>
|
||||||
|
<height>500</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Login dialog</string>
|
<string>Login dialog</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ void SwiftGuiStd::loginRequested()
|
|||||||
if (!connected && shift)
|
if (!connected && shift)
|
||||||
{
|
{
|
||||||
if (!m_loginDialog) { m_loginDialog.reset(new CLoginDialog(this)); }
|
if (!m_loginDialog) { m_loginDialog.reset(new CLoginDialog(this)); }
|
||||||
|
connect(m_loginDialog.data(), &CLoginDialog::requestNetworkSettings, this, &SwiftGuiStd::displayNetworkSettings);
|
||||||
m_loginDialog->show();
|
m_loginDialog->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -520,6 +521,13 @@ void SwiftGuiStd::displayLog()
|
|||||||
ui->comp_MainInfoArea->displayLog();
|
ui->comp_MainInfoArea->displayLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SwiftGuiStd::displayNetworkSettings()
|
||||||
|
{
|
||||||
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
|
this->setMainPageInfoArea(CMainInfoAreaComponent::InfoAreaSettings);
|
||||||
|
ui->comp_MainInfoArea->getSettingsComponent()->setTab(CSettingsComponent::SettingTabServers);
|
||||||
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::onPttChanged(bool enabled)
|
void SwiftGuiStd::onPttChanged(bool enabled)
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->getIContextAudio()) { return; }
|
if (!sGui || !sGui->getIContextAudio()) { return; }
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ private:
|
|||||||
//! Display log
|
//! Display log
|
||||||
void displayLog();
|
void displayLog();
|
||||||
|
|
||||||
|
//! Display network settings
|
||||||
|
void displayNetworkSettings();
|
||||||
|
|
||||||
//! Display a reconnect dialog
|
//! Display a reconnect dialog
|
||||||
void displayDBusReconnectDialog();
|
void displayDBusReconnectDialog();
|
||||||
|
|
||||||
|
|||||||
@@ -237,12 +237,7 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::setMainPageToInfoArea);
|
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, this, &SwiftGuiStd::setMainPageToInfoArea);
|
||||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffSuccessful, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||||
connect(ui->comp_Login, &CLoginComponent::loginDataChangedDigest, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
connect(ui->comp_Login, &CLoginComponent::loginDataChangedDigest, ui->comp_MainInfoArea->getFlightPlanComponent(), &CFlightPlanComponent::loginDataSet);
|
||||||
connect(ui->comp_Login, &CLoginComponent::requestNetworkSettings, [ this ]()
|
connect(ui->comp_Login, &CLoginComponent::requestNetworkSettings, this, &SwiftGuiStd::displayNetworkSettings);
|
||||||
{
|
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
|
||||||
this->setMainPageInfoArea(CMainInfoAreaComponent::InfoAreaSettings);
|
|
||||||
ui->comp_MainInfoArea->getSettingsComponent()->setTab(CSettingsComponent::SettingTabServers);
|
|
||||||
});
|
|
||||||
connect(ui->comp_Login, &CLoginComponent::requestLoginPage, [ this ]()
|
connect(ui->comp_Login, &CLoginComponent::requestLoginPage, [ this ]()
|
||||||
{
|
{
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
|
|||||||
Reference in New Issue
Block a user