mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 22:55:41 +08:00
Issue #115 Main connect button only opens the login view
This commit is contained in:
@@ -244,30 +244,21 @@ bool SwiftGuiStd::isMainPageSelected(SwiftGuiStd::MainPageIndex mainPage) const
|
|||||||
void SwiftGuiStd::loginRequested()
|
void SwiftGuiStd::loginRequested()
|
||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork()) { return; }
|
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork()) { return; }
|
||||||
if (ui->sw_MainMiddle->currentIndex() == static_cast<int>(MainPageLogin))
|
|
||||||
|
const bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
||||||
|
if (shift)
|
||||||
{
|
{
|
||||||
// already main page, we fake a re-trigger here
|
if (!m_loginDialog) { m_loginDialog.reset(new CLoginDialog(this)); }
|
||||||
// emit this->currentMainInfoAreaChanged(ui->sw_MainMiddle->currentWidget());
|
connect(m_loginDialog.data(), &CLoginDialog::requestNetworkSettings, this, &SwiftGuiStd::displayNetworkSettings);
|
||||||
ui->comp_Login->toggleNetworkConnection();
|
if (!CBuildConfig::isLocalDeveloperDebugBuild())
|
||||||
|
{
|
||||||
|
m_loginDialog->setAutoLogoff(true);
|
||||||
|
}
|
||||||
|
m_loginDialog->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// const bool connected = sGui->getIContextNetwork()->isConnected();
|
this->setMainPage(MainPageLogin);
|
||||||
const bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
|
||||||
if (shift)
|
|
||||||
{
|
|
||||||
if (!m_loginDialog) { m_loginDialog.reset(new CLoginDialog(this)); }
|
|
||||||
connect(m_loginDialog.data(), &CLoginDialog::requestNetworkSettings, this, &SwiftGuiStd::displayNetworkSettings);
|
|
||||||
if (!CBuildConfig::isLocalDeveloperDebugBuild())
|
|
||||||
{
|
|
||||||
m_loginDialog->setAutoLogoff(true);
|
|
||||||
}
|
|
||||||
m_loginDialog->show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->setMainPage(MainPageLogin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user