mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
Follow up of Ref T154, overlay messages can be appended and cleared
* changed signatures * aligned naming to showOverlayMessage, ...
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ab65039ca4
commit
6c3a0243ab
@@ -25,6 +25,7 @@
|
|||||||
#include "blackmisc/simulation/aircraftmodel.h"
|
#include "blackmisc/simulation/aircraftmodel.h"
|
||||||
#include "blackmisc/simulation/distributorlist.h"
|
#include "blackmisc/simulation/distributorlist.h"
|
||||||
#include "blackmisc/verify.h"
|
#include "blackmisc/verify.h"
|
||||||
|
#include "dbstashcomponent.h"
|
||||||
#include "ui_dbstashcomponent.h"
|
#include "ui_dbstashcomponent.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
@@ -184,7 +185,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
||||||
CStatusMessageList msgs(livery.validate());
|
CStatusMessageList msgs(livery.validate());
|
||||||
if (this->showMessages(msgs, acceptWarnings)) { return; }
|
if (this->showOverlayMessages(msgs, acceptWarnings)) { return; }
|
||||||
ui->tvp_StashAircraftModels->applyToSelected(livery);
|
ui->tvp_StashAircraftModels->applyToSelected(livery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +193,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
||||||
CStatusMessageList msgs(icao.validate());
|
CStatusMessageList msgs(icao.validate());
|
||||||
if (this->showMessages(msgs, acceptWarnings)) { return; }
|
if (this->showOverlayMessages(msgs, acceptWarnings)) { return; }
|
||||||
ui->tvp_StashAircraftModels->applyToSelected(icao);
|
ui->tvp_StashAircraftModels->applyToSelected(icao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +202,7 @@ namespace BlackGui
|
|||||||
if (!icao.hasValidDesignator())
|
if (!icao.hasValidDesignator())
|
||||||
{
|
{
|
||||||
static const CStatusMessage msg(CStatusMessage::SeverityError, "No valid designator");
|
static const CStatusMessage msg(CStatusMessage::SeverityError, "No valid designator");
|
||||||
this->showMessage(msg);
|
this->showOverlayMessage(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +211,7 @@ namespace BlackGui
|
|||||||
if (!stdLivery.hasValidDbKey())
|
if (!stdLivery.hasValidDbKey())
|
||||||
{
|
{
|
||||||
static const CStatusMessage msg(CStatusMessage::SeverityError, "No valid standard livery for " + icao.getDesignator());
|
static const CStatusMessage msg(CStatusMessage::SeverityError, "No valid standard livery for " + icao.getDesignator());
|
||||||
this->showMessage(msg);
|
this->showOverlayMessage(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +222,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
if (!ui->tvp_StashAircraftModels->hasSelection()) { return; }
|
||||||
CStatusMessageList msgs(distributor.validate());
|
CStatusMessageList msgs(distributor.validate());
|
||||||
if (this->showMessages(msgs, acceptWarnings)) { return; }
|
if (this->showOverlayMessages(msgs, acceptWarnings)) { return; }
|
||||||
ui->tvp_StashAircraftModels->applyToSelected(distributor);
|
ui->tvp_StashAircraftModels->applyToSelected(distributor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,6 +257,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbStashComponent::ps_onPublishPressed()
|
void CDbStashComponent::ps_onPublishPressed()
|
||||||
{
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
||||||
if (ui->tvp_StashAircraftModels->isEmpty()) { return; }
|
if (ui->tvp_StashAircraftModels->isEmpty()) { return; }
|
||||||
|
|
||||||
// get models right here, because later steps might affect selection
|
// get models right here, because later steps might affect selection
|
||||||
@@ -273,10 +275,10 @@ namespace BlackGui
|
|||||||
msgs.push_back(CStatusMessage(validationCategories(), CStatusMessage::SeverityWarning, QString("More than %1 values, values skipped").arg(MaxModelPublished)));
|
msgs.push_back(CStatusMessage(validationCategories(), CStatusMessage::SeverityWarning, QString("More than %1 values, values skipped").arg(MaxModelPublished)));
|
||||||
}
|
}
|
||||||
|
|
||||||
msgs.push_back(sApp->getWebDataServices()->asyncPublishModels(validModels));
|
msgs.push_back(sGui->getWebDataServices()->asyncPublishModels(validModels));
|
||||||
if (msgs.hasWarningOrErrorMessages())
|
if (msgs.hasWarningOrErrorMessages())
|
||||||
{
|
{
|
||||||
this->showMessages(msgs);
|
this->showOverlayMessages(msgs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -296,7 +298,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (publishedModels.isEmpty())
|
if (publishedModels.isEmpty())
|
||||||
{
|
{
|
||||||
this->showMessages(msgs);
|
this->showOverlayMessages(msgs, false, true); // show messages, keep old messages
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -305,7 +307,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
this->unstashModels(publishedModels.getModelStringList(false));
|
this->unstashModels(publishedModels.getModelStringList(false));
|
||||||
};
|
};
|
||||||
this->showMessagesWithConfirmation(msgs, confirm.arg(publishedModels.size()), lambda, QMessageBox::Ok);
|
this->showOverlayMessagesWithConfirmation(msgs, true, confirm.arg(publishedModels.size()), lambda, QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +343,7 @@ namespace BlackGui
|
|||||||
const CStatusMessageList msgs(this->validate(validModels, invalidModels));
|
const CStatusMessageList msgs(this->validate(validModels, invalidModels));
|
||||||
if (msgs.hasWarningOrErrorMessages())
|
if (msgs.hasWarningOrErrorMessages())
|
||||||
{
|
{
|
||||||
this->showMessages(msgs);
|
this->showOverlayMessages(msgs);
|
||||||
ui->tvp_StashAircraftModels->setHighlightModelStrings(invalidModels.getModelStringList(false));
|
ui->tvp_StashAircraftModels->setHighlightModelStrings(invalidModels.getModelStringList(false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -352,7 +354,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const QString no = QString::number(this->getStashedModelsCount());
|
const QString no = QString::number(this->getStashedModelsCount());
|
||||||
CStatusMessage msg(validationCategories(), CStatusMessage::SeverityInfo, "Validation passed for " + no + " models");
|
CStatusMessage msg(validationCategories(), CStatusMessage::SeverityInfo, "Validation passed for " + no + " models");
|
||||||
this->showMessage(msg);
|
this->showOverlayMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !validModels.isEmpty(); // at least some valid objects
|
return !validModels.isEmpty(); // at least some valid objects
|
||||||
@@ -445,7 +447,7 @@ namespace BlackGui
|
|||||||
msgs.push_back(modelMsgs);
|
msgs.push_back(modelMsgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->showMessages(msgs);
|
this->showOverlayMessages(msgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbStashComponent::ps_copyOverValuesToSelectedModels()
|
void CDbStashComponent::ps_copyOverValuesToSelectedModels()
|
||||||
@@ -512,27 +514,30 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDbStashComponent::showMessages(const CStatusMessageList &msgs, bool onlyErrors, int timeoutMs)
|
bool CDbStashComponent::showOverlayMessages(const CStatusMessageList &msgs, bool onlyErrors, bool appendOldMessages, int timeoutMs)
|
||||||
{
|
{
|
||||||
if (msgs.isEmpty()) { return false; }
|
if (msgs.isEmpty()) { return false; }
|
||||||
if (!msgs.hasErrorMessages() && onlyErrors) { return false; }
|
if (!msgs.hasErrorMessages() && onlyErrors) { return false; }
|
||||||
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
||||||
if (!this->getMappingComponent()) { return false; }
|
if (!this->getMappingComponent()) { return false; }
|
||||||
this->getMappingComponent()->showOverlayMessages(msgs, timeoutMs);
|
|
||||||
|
this->getMappingComponent()->showOverlayMessages(msgs, appendOldMessages, timeoutMs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDbStashComponent::showMessagesWithConfirmation(const CStatusMessageList &msgs, const QString &confirmation, std::function<void ()> okLambda, int defaultButton, bool onlyErrors, int timeoutMs)
|
bool CDbStashComponent::showOverlayMessagesWithConfirmation(
|
||||||
|
const CStatusMessageList &msgs, bool appendOldMessages,
|
||||||
|
const QString &confirmation, std::function<void ()> okLambda, int defaultButton, bool onlyErrors, int timeoutMs)
|
||||||
{
|
{
|
||||||
if (msgs.isEmpty()) { return false; }
|
if (msgs.isEmpty()) { return false; }
|
||||||
if (!msgs.hasErrorMessages() && onlyErrors) { return false; }
|
if (!msgs.hasErrorMessages() && onlyErrors) { return false; }
|
||||||
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
||||||
if (!this->getMappingComponent()) { return false; }
|
if (!this->getMappingComponent()) { return false; }
|
||||||
this->getMappingComponent()->showOverlayMessagesWithConfirmation(msgs, confirmation, okLambda, defaultButton, timeoutMs);
|
this->getMappingComponent()->showOverlayMessagesWithConfirmation(msgs, appendOldMessages, confirmation, okLambda, defaultButton, timeoutMs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDbStashComponent::showMessage(const CStatusMessage &msg, int timeoutMs)
|
bool CDbStashComponent::showOverlayMessage(const CStatusMessage &msg, int timeoutMs)
|
||||||
{
|
{
|
||||||
if (msg.isEmpty()) { return false; }
|
if (msg.isEmpty()) { return false; }
|
||||||
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
||||||
@@ -540,5 +545,12 @@ namespace BlackGui
|
|||||||
this->getMappingComponent()->showOverlayMessage(msg, timeoutMs);
|
this->getMappingComponent()->showOverlayMessage(msg, timeoutMs);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDbStashComponent::clearOverlayMessages()
|
||||||
|
{
|
||||||
|
BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
|
||||||
|
if (!this->getMappingComponent()) { return; }
|
||||||
|
this->getMappingComponent()->clearOverlayMessages();
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -176,13 +176,19 @@ namespace BlackGui
|
|||||||
BlackMisc::CDataReadOnly<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser {this, &CDbStashComponent::ps_userChanged}; //!< authenticated user
|
BlackMisc::CDataReadOnly<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser {this, &CDbStashComponent::ps_userChanged}; //!< authenticated user
|
||||||
|
|
||||||
//! Display messages
|
//! Display messages
|
||||||
bool showMessages(const BlackMisc::CStatusMessageList &msgs, bool onlyErrors = false, int timeoutMs = -1);
|
bool showOverlayMessages(const BlackMisc::CStatusMessageList &msgs, bool onlyErrors = false, bool appendOldMessages = false, int timeoutMs = -1);
|
||||||
|
|
||||||
//! Display messages with confirmation
|
//! Display messages with confirmation
|
||||||
bool showMessagesWithConfirmation(const BlackMisc::CStatusMessageList &msgs, const QString &confirmation, std::function<void()> okLambda, int defaultButton, bool onlyErrors = false, int timeoutMs = -1);
|
bool showOverlayMessagesWithConfirmation(
|
||||||
|
const BlackMisc::CStatusMessageList &msgs, bool appendOldMessages,
|
||||||
|
const QString &confirmation, std::function<void()> okLambda,
|
||||||
|
int defaultButton, bool onlyErrors = false, int timeoutMs = -1);
|
||||||
|
|
||||||
//! Display message
|
//! Display message
|
||||||
bool showMessage(const BlackMisc::CStatusMessage &msg, int timeoutMs = -1);
|
bool showOverlayMessage(const BlackMisc::CStatusMessage &msg, int timeoutMs = -1);
|
||||||
|
|
||||||
|
//! Clear messages
|
||||||
|
void clearOverlayMessages();
|
||||||
|
|
||||||
//! Validate
|
//! Validate
|
||||||
BlackMisc::CStatusMessageList validate(BlackMisc::Simulation::CAircraftModelList &validModels, BlackMisc::Simulation::CAircraftModelList &invalidModels) const;
|
BlackMisc::CStatusMessageList validate(BlackMisc::Simulation::CAircraftModelList &validModels, BlackMisc::Simulation::CAircraftModelList &invalidModels) const;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ namespace BlackGui
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
static const QString confirm("Install in '%1'?");
|
static const QString confirm("Install in '%1'?");
|
||||||
this->showOverlayMessagesWithConfirmation(status, confirm.arg(ui->le_XSwiftBusPluginDir->text()), [ = ] { this->installXSwiftBus(); });
|
this->showOverlayMessagesWithConfirmation(status, false, confirm.arg(ui->le_XSwiftBusPluginDir->text()), [ = ] { this->installXSwiftBus(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
CRemoteFile CInstallXSwiftBusComponent::getRemoteFileSelected() const
|
CRemoteFile CInstallXSwiftBusComponent::getRemoteFileSelected() const
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace BlackGui
|
|||||||
connect(ui->tb_Kill, &QPushButton::clicked, this, &COverlayMessages::ps_killClicked);
|
connect(ui->tb_Kill, &QPushButton::clicked, this, &COverlayMessages::ps_killClicked);
|
||||||
|
|
||||||
ui->tvp_StatusMessages->setResizeMode(CStatusMessageView::ResizingAlways);
|
ui->tvp_StatusMessages->setResizeMode(CStatusMessageView::ResizingAlways);
|
||||||
ui->tvp_StatusMessages->setForceColumnsToMaxSize(false); // problems with multinline entries, with T138 we need multiline messages
|
ui->tvp_StatusMessages->setForceColumnsToMaxSize(false); // problems with multiline entries, with T138 we need multiline messages
|
||||||
ui->tvp_StatusMessages->setWordWrap(true);
|
ui->tvp_StatusMessages->setWordWrap(true);
|
||||||
ui->tvp_StatusMessages->menuAddItems(CStatusMessageView::MenuSave);
|
ui->tvp_StatusMessages->menuAddItems(CStatusMessageView::MenuSave);
|
||||||
ui->fr_Confirmation->setVisible(false);
|
ui->fr_Confirmation->setVisible(false);
|
||||||
@@ -145,7 +145,7 @@ namespace BlackGui
|
|||||||
COverlayMessages::~COverlayMessages()
|
COverlayMessages::~COverlayMessages()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void COverlayMessages::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, int timeOutMs)
|
void COverlayMessages::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (messages.isEmpty()) { return; }
|
if (messages.isEmpty()) { return; }
|
||||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||||
@@ -159,10 +159,19 @@ namespace BlackGui
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appendOldMessages && !ui->tvp_StatusMessages->isEmpty())
|
||||||
|
{
|
||||||
|
CStatusMessageList messagesWithOld(messages);
|
||||||
|
messagesWithOld.push_back(ui->tvp_StatusMessages->container());
|
||||||
|
ui->tvp_StatusMessages->updateContainerMaybeAsync(messagesWithOld);
|
||||||
|
this->setModeToMessages(messagesWithOld.hasErrorMessages());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ui->tvp_StatusMessages->updateContainerMaybeAsync(messages);
|
ui->tvp_StatusMessages->updateContainerMaybeAsync(messages);
|
||||||
ui->tvp_StatusMessages->resizeRowsToContents();
|
|
||||||
this->showKill(false);
|
|
||||||
this->setModeToMessages(messages.hasErrorMessages());
|
this->setModeToMessages(messages.hasErrorMessages());
|
||||||
|
}
|
||||||
|
this->showKill(false);
|
||||||
this->display(timeOutMs);
|
this->display(timeOutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,24 +349,29 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessages::showOverlayMessagesWithConfirmation(const CStatusMessageList &messages, const QString &confirmationMessage, std::function<void ()> okLambda, int defaultButton, int timeOutMs)
|
void COverlayMessages::showOverlayMessagesWithConfirmation(const CStatusMessageList &messages, bool appendOldMessages, const QString &confirmationMessage, std::function<void ()> okLambda, int defaultButton, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
{
|
{
|
||||||
// defer message
|
// defer message
|
||||||
m_pendingMessageCalls.push_back([ = ]()
|
m_pendingMessageCalls.push_back([ = ]()
|
||||||
{
|
{
|
||||||
this->showOverlayMessagesWithConfirmation(messages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
this->showOverlayMessagesWithConfirmation(messages, appendOldMessages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->setConfirmationMessage(confirmationMessage);
|
this->setConfirmationMessage(confirmationMessage);
|
||||||
this->showOverlayMessages(messages, timeOutMs);
|
this->showOverlayMessages(messages, appendOldMessages, timeOutMs);
|
||||||
m_awaitingConfirmation = true; // needs to be after showOverlayMessages
|
m_awaitingConfirmation = true; // needs to be after showOverlayMessages
|
||||||
m_okLambda = okLambda;
|
m_okLambda = okLambda;
|
||||||
this->setDefaultConfirmationButton(defaultButton);
|
this->setDefaultConfirmationButton(defaultButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void COverlayMessages::clearOverlayMessages()
|
||||||
|
{
|
||||||
|
ui->tvp_StatusMessages->clear();
|
||||||
|
}
|
||||||
|
|
||||||
void COverlayMessages::setDefaultConfirmationButton(int button)
|
void COverlayMessages::setDefaultConfirmationButton(int button)
|
||||||
{
|
{
|
||||||
switch (button)
|
switch (button)
|
||||||
|
|||||||
@@ -77,13 +77,17 @@ namespace BlackGui
|
|||||||
//! Show multiple messages with confirmation bar
|
//! Show multiple messages with confirmation bar
|
||||||
void showOverlayMessagesWithConfirmation(
|
void showOverlayMessagesWithConfirmation(
|
||||||
const BlackMisc::CStatusMessageList &messages,
|
const BlackMisc::CStatusMessageList &messages,
|
||||||
|
bool appendOldMessages,
|
||||||
const QString &confirmationMessage,
|
const QString &confirmationMessage,
|
||||||
std::function<void()> okLambda,
|
std::function<void()> okLambda,
|
||||||
int defaultButton = QMessageBox::Cancel,
|
int defaultButton = QMessageBox::Cancel,
|
||||||
int timeOutMs = -1);
|
int timeOutMs = -1);
|
||||||
|
|
||||||
|
//! Clear the overlay messages
|
||||||
|
void clearOverlayMessages();
|
||||||
|
|
||||||
//! Show multiple messages
|
//! Show multiple messages
|
||||||
void showOverlayMessages(const BlackMisc::CStatusMessageList &messages, int timeOutMs = -1);
|
void showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages = false, int timeOutMs = -1);
|
||||||
|
|
||||||
//! Show single message
|
//! Show single message
|
||||||
void showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs = -1);
|
void showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs = -1);
|
||||||
|
|||||||
@@ -46,14 +46,19 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayMessagesWithConfirmation(const BlackMisc::CStatusMessageList &messages, const QString &confirmationMessage, std::function<void ()> okLambda, int defaultButton, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayMessagesWithConfirmation(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages, const QString &confirmationMessage, std::function<void ()> okLambda, int defaultButton, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (messages.isEmpty()) { return; }
|
if (messages.isEmpty()) { return; }
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
this->m_overlayMessages->showOverlayMessagesWithConfirmation(messages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
this->m_overlayMessages->showOverlayMessagesWithConfirmation(messages, appendOldMessages, confirmationMessage, okLambda, defaultButton, timeOutMs);
|
||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void COverlayMessagesFrame::clearOverlayMessages()
|
||||||
|
{
|
||||||
|
m_overlayMessages->clearOverlayMessages();
|
||||||
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (message.isEmpty()) { return; }
|
if (message.isEmpty()) { return; }
|
||||||
@@ -62,11 +67,11 @@ namespace BlackGui
|
|||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessagesFrame::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, int timeOutMs)
|
void COverlayMessagesFrame::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (messages.isEmpty()) { return; }
|
if (messages.isEmpty()) { return; }
|
||||||
this->initInnerFrame();
|
this->initInnerFrame();
|
||||||
this->m_overlayMessages->showOverlayMessages(messages, timeOutMs);
|
this->m_overlayMessages->showOverlayMessages(messages, appendOldMessages, timeOutMs);
|
||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,15 +62,19 @@ namespace BlackGui
|
|||||||
//! \copydoc COverlayMessages::showOverlayMessagesWithConfirmation
|
//! \copydoc COverlayMessages::showOverlayMessagesWithConfirmation
|
||||||
void showOverlayMessagesWithConfirmation(
|
void showOverlayMessagesWithConfirmation(
|
||||||
const BlackMisc::CStatusMessageList &messages,
|
const BlackMisc::CStatusMessageList &messages,
|
||||||
|
bool appendOldMessages,
|
||||||
const QString &confirmationMessage,
|
const QString &confirmationMessage,
|
||||||
std::function<void()> okLambda,
|
std::function<void()> okLambda,
|
||||||
int defaultButton = QMessageBox::Cancel,
|
int defaultButton = QMessageBox::Cancel,
|
||||||
int timeOutMs = -1
|
int timeOutMs = -1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//! Clear the overlay messages
|
||||||
|
void clearOverlayMessages();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! \copydoc COverlayMessages::showOverlayMessages
|
//! \copydoc COverlayMessages::showOverlayMessages
|
||||||
void showOverlayMessages(const BlackMisc::CStatusMessageList &messages, int timeOutMs = -1);
|
void showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages = false, int timeOutMs = -1);
|
||||||
|
|
||||||
//! \copydoc COverlayMessages::showOverlayMessage
|
//! \copydoc COverlayMessages::showOverlayMessage
|
||||||
void showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs = -1);
|
void showOverlayMessage(const BlackMisc::CStatusMessage &message, int timeOutMs = -1);
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ void SwiftGuiStd::ps_sharedInfoObjectsLoaded()
|
|||||||
{
|
{
|
||||||
sGui->getWebDataServices()->triggerLoadingDirectlyFromSharedFiles(newEntities, false);
|
sGui->getWebDataServices()->triggerLoadingDirectlyFromSharedFiles(newEntities, false);
|
||||||
};
|
};
|
||||||
ui->fr_CentralFrameInside->showOverlayMessagesWithConfirmation(sms, "Load data?", lambda);
|
ui->fr_CentralFrameInside->showOverlayMessagesWithConfirmation(sms, false, "Load data?", lambda);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user