mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Overlay progress bar
This commit is contained in:
committed by
Mat Sutcliffe
parent
298f746862
commit
4e1835b80d
@@ -351,6 +351,28 @@ namespace BlackGui
|
||||
this->display(timeOutMs);
|
||||
}
|
||||
|
||||
void COverlayMessages::showProgressBar(int percentage, const QString &message, int timeOutMs)
|
||||
{
|
||||
if (message.isEmpty()) { return; }
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (this->hasPendingConfirmation()) { return; } // ignore if something else is pending
|
||||
|
||||
const int p = qMax(qMin(percentage, 100), 0);
|
||||
|
||||
ui->pb_ProgressBar->setValue(p);
|
||||
ui->lbl_ProgressBar->setText(message);
|
||||
this->setModeToProgressBar();
|
||||
|
||||
if (p >= 100)
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->display(timeOutMs);
|
||||
}
|
||||
}
|
||||
|
||||
void COverlayMessages::showKillButton(bool killButton)
|
||||
{
|
||||
m_hasKillButton = killButton;
|
||||
@@ -385,6 +407,13 @@ namespace BlackGui
|
||||
this->setHeader("Message");
|
||||
}
|
||||
|
||||
void COverlayMessages::setModeToProgressBar(bool withKillButton)
|
||||
{
|
||||
ui->sw_StatusMessagesComponent->setCurrentWidget(ui->pg_ProgressBar);
|
||||
this->showKill(withKillButton);
|
||||
this->setHeader("Progress bar");
|
||||
}
|
||||
|
||||
void COverlayMessages::setModeToTextMessage()
|
||||
{
|
||||
ui->sw_StatusMessagesComponent->setCurrentWidget(ui->pg_TextMessage);
|
||||
|
||||
Reference in New Issue
Block a user