Improved kill button handling, now it can be set even if frame is not yet initialized

* default is disabled
* only pilot client needs to enable it
This commit is contained in:
Klaus Basan
2017-03-07 22:46:58 +01:00
committed by Mathew Sutcliffe
parent 0851b8c994
commit 83383f438c
4 changed files with 8 additions and 5 deletions

View File

@@ -134,9 +134,6 @@ namespace BlackGui
// vPilot
this->initVPilotLoading();
// overlay
this->showKillButton(false);
// user changes
m_swiftDbUser.setNotifySlot(&CDbMappingComponent::ps_userChanged);
}

View File

@@ -35,6 +35,7 @@ namespace BlackGui
void COverlayMessagesFrame::showKillButton(bool killButton)
{
m_showKillButton = killButton;
if (m_overlayMessages)
{
m_overlayMessages->showKillButton(killButton);
@@ -123,6 +124,7 @@ namespace BlackGui
{
this->m_overlayMessages = new COverlayMessages(inner.width(), inner.height(), this);
this->m_overlayMessages->addShadow();
this->m_overlayMessages->showKillButton(m_showKillButton);
}
Q_ASSERT(this->m_overlayMessages);

View File

@@ -100,8 +100,9 @@ namespace BlackGui
//! Init the inner frame (if not yet initialized)
void initInnerFrame();
double m_widthFactor = 0.7; //!< inner frame x factor
double m_heightFactor = 0.6; //!< inner frame x factor
bool m_showKillButton = false; //!< show kill button
double m_widthFactor = 0.7; //!< inner frame x factor
double m_heightFactor = 0.6; //!< inner frame x factor
};
} // ns

View File

@@ -145,6 +145,9 @@ void SwiftGuiStd::init()
ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(sGui->swiftVersionString());
ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CBuildConfig::compiledWithInfo());
// Show kill button
ui->fr_CentralFrameInside->showKillButton(true);
// do this as last statement, so it can be used as flag
// whether init has been completed
this->setVisible(true);