mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
SCPI commands for saving/loading calibration files
This commit is contained in:
parent
e4106fe3a2
commit
09366d73cc
15 changed files with 110 additions and 36 deletions
|
|
@ -3,8 +3,15 @@
|
|||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
|
||||
bool InformationBox::has_gui = true;
|
||||
|
||||
void InformationBox::ShowMessage(QString title, QString message, QString messageID, bool block)
|
||||
{
|
||||
if(!has_gui) {
|
||||
// no gui option active, do not show any messages
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the user still wants to see this message
|
||||
unsigned int hash;
|
||||
if(messageID.isEmpty()) {
|
||||
|
|
@ -31,12 +38,21 @@ void InformationBox::ShowMessageBlocking(QString title, QString message, QString
|
|||
|
||||
void InformationBox::ShowError(QString title, QString message)
|
||||
{
|
||||
if(!has_gui) {
|
||||
// no gui option active, do not show any messages
|
||||
return;
|
||||
}
|
||||
auto box = new InformationBox(title, message, QMessageBox::Information, 0, nullptr);
|
||||
box->show();
|
||||
}
|
||||
|
||||
bool InformationBox::AskQuestion(QString title, QString question, bool defaultAnswer, QString messageID)
|
||||
{
|
||||
if(!has_gui) {
|
||||
// no gui option active, do not show any messages
|
||||
return defaultAnswer;
|
||||
}
|
||||
|
||||
// check if the user still wants to see this message
|
||||
unsigned int hash;
|
||||
if(messageID.isEmpty()) {
|
||||
|
|
@ -61,6 +77,11 @@ bool InformationBox::AskQuestion(QString title, QString question, bool defaultAn
|
|||
}
|
||||
}
|
||||
|
||||
void InformationBox::setGUI(bool enable)
|
||||
{
|
||||
has_gui = enable;
|
||||
}
|
||||
|
||||
InformationBox::InformationBox(QString title, QString message, Icon icon, unsigned int hash, QWidget *parent)
|
||||
: QMessageBox(parent),
|
||||
hash(hash)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue