WSJT-X/messageaveraging.cpp

46 lines
992 B
C++
Raw Normal View History

#include "messageaveraging.h"
#include <QSettings>
#include "ui_messageaveraging.h"
#include "commons.h"
#include "moc_messageaveraging.cpp"
MessageAveraging::MessageAveraging(QSettings * settings, QWidget *parent) :
QWidget(parent),
settings_ {settings},
ui(new Ui::MessageAveraging)
{
ui->setupUi(this);
read_settings ();
}
MessageAveraging::~MessageAveraging()
{
if (isVisible ()) write_settings ();
delete ui;
}
void MessageAveraging::closeEvent (QCloseEvent * e)
{
write_settings ();
QWidget::closeEvent (e);
}
void MessageAveraging::read_settings ()
{
settings_->beginGroup ("MessageAveraging");
restoreGeometry (settings_->value ("window/geometry").toByteArray ());
settings_->endGroup ();
}
void MessageAveraging::write_settings ()
{
settings_->beginGroup ("MessageAveraging");
settings_->setValue ("window/geometry", saveGeometry ());
settings_->endGroup ();
}
void MessageAveraging::displayAvg(QString t)
{
ui->msgAvgTextBrowser->setText(t);
}