2015-04-22 13:48:03 -04:00
|
|
|
#include "messageaveraging.h"
|
2015-06-09 10:30:23 -04:00
|
|
|
#include <QSettings>
|
2015-11-17 20:28:12 -05:00
|
|
|
#include <QApplication>
|
2015-04-22 13:48:03 -04:00
|
|
|
#include "ui_messageaveraging.h"
|
|
|
|
#include "commons.h"
|
2015-06-09 10:30:23 -04:00
|
|
|
#include "moc_messageaveraging.cpp"
|
2015-04-22 13:48:03 -04:00
|
|
|
|
|
|
|
MessageAveraging::MessageAveraging(QSettings * settings, QWidget *parent) :
|
|
|
|
QWidget(parent),
|
|
|
|
settings_ {settings},
|
|
|
|
ui(new Ui::MessageAveraging)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2015-11-17 20:28:12 -05:00
|
|
|
setWindowTitle (QApplication::applicationName () + " - " + tr ("Message Averaging"));
|
2015-04-22 13:48:03 -04:00
|
|
|
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");
|
2015-12-10 09:15:43 -05:00
|
|
|
restoreGeometry (settings_->value ("window/geometry").toByteArray ());
|
2015-04-22 13:48:03 -04:00
|
|
|
settings_->endGroup ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MessageAveraging::write_settings ()
|
|
|
|
{
|
|
|
|
settings_->beginGroup ("MessageAveraging");
|
2015-12-10 09:15:43 -05:00
|
|
|
settings_->setValue ("window/geometry", saveGeometry ());
|
2015-04-22 13:48:03 -04:00
|
|
|
settings_->endGroup ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MessageAveraging::displayAvg(QString t)
|
|
|
|
{
|
|
|
|
ui->msgAvgTextBrowser->setText(t);
|
|
|
|
}
|