servicehistorymain.cpp 1.52 KB
#include "servicehistorymain.h"
#include "ui_servicehistorymain.h"
#include "historylistwindow.h"
#include "soundplayer.h"

ServiceHistoryMain::ServiceHistoryMain(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::ServiceHistoryMain)
{
    ui->setupUi(this);

    ui->clockContainer->setParent(ui->upperStack);
    setAttribute(Qt::WA_DeleteOnClose);

    foreach (QPushButton *button, findChildren<QPushButton *>())
        connect(button, &QPushButton::pressed, SoundPlayer::playClick);

    connect(ui->backButton, SIGNAL(released()), this, SLOT(close()));
}

ServiceHistoryMain::~ServiceHistoryMain()
{
    delete ui;
}

void ServiceHistoryMain::on_btnUpperBunner_clicked()
{
    HistoryListWindow *w = new HistoryListWindow(this);
    w->setWindosDataSet(ERROR_HISTORY_UPPERBUNNER);
    w->setWindowModality(Qt::WindowModal);
    w->showFullScreen();
}

void ServiceHistoryMain::on_btnSteamBunner_clicked()
{
    HistoryListWindow *w = new HistoryListWindow(this);
    w->setWindosDataSet(ERROR_HISTORY_STEAMBUNNER);
    w->setWindowModality(Qt::WindowModal);
    w->showFullScreen();
}

void ServiceHistoryMain::on_btnLowerBunner_clicked()
{
    HistoryListWindow *w = new HistoryListWindow(this);
    w->setWindosDataSet(ERROR_HISTORY_LOWERBUNNER);
    w->setWindowModality(Qt::WindowModal);
    w->showFullScreen();
}

void ServiceHistoryMain::on_btnErrorTotal_clicked()
{
    HistoryListWindow *w = new HistoryListWindow(this);
    w->setWindosDataSet(ERROR_HISTORY_TOTAL);
    w->setWindowModality(Qt::WindowModal);
    w->showFullScreen();
}