#include <QMainWindow>
#include <QStyle>
#include <QAction>
#include <QMenuBar>
#include <QToolBar>
#include <QLabel>
#include <QStatusBar>
#include "mainwindow.h"

MainWindow::MainWindow() : QMainWindow(), controls(new Controls)
{
	//setWindowTitle("Settings");
	setCentralWidget(controls);
    this->statusBar()->show();

    QLabel* statusLabel = new QLabel("Your Message");
    QWidget* widget = new QWidget;
    widget->setFixedWidth(50);
    widget->setHidden(1);
    widget->setVisible(1);
    this->statusBar()->addWidget(widget,1);
    this->statusBar()->addWidget(statusLabel,1);

    actSave = new QAction(style()->standardIcon(QStyle::SP_DialogSaveButton), "&Save", this);
	actSave->setShortcuts(QKeySequence::Save);
	actSave->setStatusTip("Save state");
	connect(actSave, &QAction::triggered, controls, &Controls::doSave);

	actRevert = new QAction(style()->standardIcon(QStyle::SP_DialogResetButton), "&Revert", this);
	actRevert->setShortcuts(QKeySequence::Refresh);
	actRevert->setStatusTip("Revert state");
	connect(actRevert, &QAction::triggered, controls, &Controls::doRevert);

    QMenu *m = menuBar()->addMenu("&Settings");
	m->addAction(actSave);
	m->addAction(actRevert);

	QToolBar *t = addToolBar("Toolbar");
	t->addAction(actSave);
	t->addAction(actRevert);
}
