WSJT-X/messageaveraging.cpp
Bill Somerville 97704efba8 Reintegrate merge from wsjtx_exp branch.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6122 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-11-18 01:28:12 +00:00

48 lines
1.1 KiB
C++

#include "messageaveraging.h"
#include <QSettings>
#include <QApplication>
#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);
setWindowTitle (QApplication::applicationName () + " - " + tr ("Message Averaging"));
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");
move (settings_->value ("window/pos", pos ()).toPoint ());
settings_->endGroup ();
}
void MessageAveraging::write_settings ()
{
settings_->beginGroup ("MessageAveraging");
settings_->setValue ("window/pos", pos ());
settings_->endGroup ();
}
void MessageAveraging::displayAvg(QString t)
{
ui->msgAvgTextBrowser->setText(t);
}