"/usr/share/icons/hicolor/48x48/hildon/statusarea_volume_mute.png"
};
- for (int i = 0; i < BUTTON_COUNT; ++i)
- {
+ for (int i = 0; i < BUTTON_COUNT; ++i) {
QToolButton *button = new QToolButton(this);
button->setIcon(QIcon(QString(
settings->value(QString("buttonIcon") + QString::number(i),
layout->addWidget(button, i%2, i/2);
}
- this->setContentsMargins(0, 0, 0, 0);
+ connect(buttons[0], SIGNAL(clicked()), this, SLOT(sendCmdVolUp()));
+ connect(buttons[1], SIGNAL(clicked()), this, SLOT(sendCmdVolDown()));
+ connect(buttons[2], SIGNAL(clicked()), this, SLOT(sendCmdChUp()));
+ connect(buttons[3], SIGNAL(clicked()), this, SLOT(sendCmdChDown()));
+ connect(buttons[4], SIGNAL(clicked()), this, SLOT(sendCmdPower()));
+ connect(buttons[5], SIGNAL(clicked()), this, SLOT(sendCmdMute()));
+
+ setContentsMargins(0, 0, 0, 0);
layout->setContentsMargins(0, 0, 0, 0);
- this->setLayout(layout);
- this->setAttribute(Qt::WA_TranslucentBackground);
- this->setAttribute(Qt::WA_OpaquePaintEvent);
+ setLayout(layout);
+ setAttribute(Qt::WA_TranslucentBackground);
+ setAttribute(Qt::WA_OpaquePaintEvent);
resize();
-
- showSettingsDialog();
}
MainWidget::~MainWidget()
delete settings;
}
+void MainWidget::sendCmdVolUp()
+{
+ irCtrl.sendCmd(settings->value("volUpCmd", "VOLUP").toString());
+}
+
+void MainWidget::sendCmdVolDown()
+{
+ irCtrl.sendCmd(settings->value("volDownCmd", "VOLDOWN").toString());
+}
+
+void MainWidget::sendCmdChUp()
+{
+ irCtrl.sendCmd(settings->value("chUpCmd", "CHUP").toString());
+}
+
+void MainWidget::sendCmdChDown()
+{
+ irCtrl.sendCmd(settings->value("chDownCmd", "CHDOWN").toString());
+}
+
+void MainWidget::sendCmdPower()
+{
+ irCtrl.sendCmd(settings->value("powerCmd", "POWER").toString());
+}
+
+void MainWidget::sendCmdMute()
+{
+ irCtrl.sendCmd(settings->value("muteCmd", "MUTE").toString());
+}
+
void MainWidget::paintEvent(QPaintEvent*)
{
int bgAlpha = settings->value("bgAlpha", "192").toInt();