mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Allow to globally disable the kill button
(only needed in swift pilot client so far)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
66e17d62b6
commit
6999a97f73
@@ -134,6 +134,10 @@ namespace BlackGui
|
||||
// vPilot
|
||||
this->initVPilotLoading();
|
||||
|
||||
// overlay
|
||||
this->showKillButton(false);
|
||||
|
||||
// user changes
|
||||
m_swiftDbUser.setNotifySlot(&CDbMappingComponent::ps_userChanged);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,8 +135,8 @@ namespace BlackGui
|
||||
|
||||
void COverlayMessages::showKill(bool show)
|
||||
{
|
||||
ui->tb_Kill->setVisible(show);
|
||||
ui->tb_Kill->setEnabled(show);
|
||||
ui->tb_Kill->setVisible(m_hasKillButton && show);
|
||||
ui->tb_Kill->setEnabled(m_hasKillButton && show);
|
||||
}
|
||||
|
||||
bool COverlayMessages::displayTextMessage(const CTextMessage &textMessage) const
|
||||
@@ -289,6 +289,11 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void COverlayMessages::showKillButton(bool killButton)
|
||||
{
|
||||
this->m_hasKillButton = killButton;
|
||||
}
|
||||
|
||||
void COverlayMessages::setModeToMessages(bool withKillButton)
|
||||
{
|
||||
ui->sw_StatusMessagesComponent->setCurrentWidget(ui->pg_StatusMessages);
|
||||
|
||||
@@ -99,6 +99,9 @@ namespace BlackGui
|
||||
//! Display one of the supported types
|
||||
void showOverlayVariant(const BlackMisc::CVariant &variant, int timeOutMs = -1);
|
||||
|
||||
//! Allows to globally enable/disable kill button
|
||||
void showKillButton(bool killButton);
|
||||
|
||||
//! Close button clicked
|
||||
void close();
|
||||
|
||||
@@ -141,6 +144,7 @@ namespace BlackGui
|
||||
QString m_header;
|
||||
int m_lastConfirmation = QMessageBox::Cancel;
|
||||
bool m_awaitingConfirmation = false;
|
||||
bool m_hasKillButton = false;
|
||||
std::function<void()> m_okLambda;
|
||||
QTimer m_autoCloseTimer { this };
|
||||
QList<std::function<void()>> m_pendingMessageCalls;
|
||||
@@ -154,7 +158,8 @@ namespace BlackGui
|
||||
//! Small
|
||||
bool useSmall() const;
|
||||
|
||||
//! Show kill button
|
||||
//! Show kill button?
|
||||
//! \sa COverlayMessages::showKillButton globally enable/disable kill button
|
||||
void showKill(bool show);
|
||||
|
||||
//! Display this message (use settings to decide)
|
||||
|
||||
@@ -33,6 +33,14 @@ namespace BlackGui
|
||||
this->initInnerFrame();
|
||||
}
|
||||
|
||||
void COverlayMessagesFrame::showKillButton(bool killButton)
|
||||
{
|
||||
if (m_overlayMessages)
|
||||
{
|
||||
m_overlayMessages->showKillButton(killButton);
|
||||
}
|
||||
}
|
||||
|
||||
void COverlayMessagesFrame::hideStatusMessagesFrame()
|
||||
{
|
||||
if (!m_overlayMessages) { return; }
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackGui
|
||||
//! Show the inner frame
|
||||
void showStatusMessagesFrame();
|
||||
|
||||
//! Show kill button
|
||||
void showKillButton(bool killButton);
|
||||
|
||||
//! Hide the inner frame
|
||||
void hideStatusMessagesFrame();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user