#include "mainwidget.h"
+#include "engine.h"
+#include "iengine.h"
+#include "settingsdlg.h"
#include <QInputDialog>
#include <QPainter>
#include <QToolButton>
#include <QSettings>
-#include "settingsdlg.h"
-
MainWidget::MainWidget (QWidget *parent)
: QWidget(parent)
+ , engine(new Engine())
{
+ engine->setRemote("1");
+
layout = new QGridLayout(this);
settings = new QSettings(this);
layout->addWidget(button, i%2, i/2);
}
- connect(buttons[0], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd0()));
- connect(buttons[1], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd1()));
- connect(buttons[2], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd2()));
- connect(buttons[3], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd3()));
- connect(buttons[4], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd4()));
- connect(buttons[5], SIGNAL(clicked()), &irCtrl, SLOT(sendCmd5()));
-
+ connect(buttons[0], SIGNAL(clicked()),
+ this, SLOT(sendCmdClicked(IRemote::VOLUMEUP)));
+
this->setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins(0, 0, 0, 0);
this->setLayout(layout);
this->setAttribute(Qt::WA_TranslucentBackground);
this->setAttribute(Qt::WA_OpaquePaintEvent);
resize();
+
+
+ showSettingsDialog();
}
MainWidget::~MainWidget()
{
delete settings;
+ delete engine;
}
void MainWidget::paintEvent(QPaintEvent*)
void MainWidget::showSettingsDialog()
{
- SettingsDlg dlg;
+ SettingsDlg dlg(this, engine);
dlg.exec();
update(); // Repaint required if bgAlpha value was changed
resize();
QWidget::resize(w, h);
}
+void MainWidget::sendCmdClicked(IRemote::RemoteCmd cmd)
+{
+ engine->remote()->sendCmd(cmd);
+
+}
+
+