mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
Fix visibility of information boxes in certain situations by introducing a blocking option
This commit is contained in:
parent
7d84e0fc68
commit
0efd31e8ce
5 changed files with 27 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
|
||||
void InformationBox::ShowMessage(QString title, QString message, QString messageID)
|
||||
void InformationBox::ShowMessage(QString title, QString message, QString messageID, bool block)
|
||||
{
|
||||
// check if the user still wants to see this message
|
||||
unsigned int hash;
|
||||
|
|
@ -16,10 +16,19 @@ void InformationBox::ShowMessage(QString title, QString message, QString message
|
|||
QSettings s;
|
||||
if(!s.contains(hashToSettingsKey(hash))) {
|
||||
auto box = new InformationBox(title, message, QMessageBox::Information, hash, nullptr);
|
||||
box->show();
|
||||
if(block) {
|
||||
box->exec();
|
||||
} else {
|
||||
box->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InformationBox::ShowMessageBlocking(QString title, QString message, QString messageID)
|
||||
{
|
||||
ShowMessage(title, message, messageID, true);
|
||||
}
|
||||
|
||||
void InformationBox::ShowError(QString title, QString message)
|
||||
{
|
||||
auto box = new InformationBox(title, message, QMessageBox::Information, 0, nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue