Merge branch 'master' of ssh://mercury.wipsl.com/var/git/irw
[irwi] / src / mainwidget.cpp
1 #include "mainwidget.h"
2
3 #include <QtGui/qinputdialog.h>
4 #include <QGridLayout>
5 #include <QPushButton>
6
7 MainWidget::MainWidget (QWidget *parent)
8     : QWidget(parent)
9 {
10     layout = new QGridLayout(this);
11
12     for (int i = 0; i < BUTTON_COUNT; ++i)
13     {
14         QPushButton *button = new QPushButton(QString(i+0x30), this);
15         buttons[i] = button;
16         layout->addWidget(button, i%2, i/2);
17     }
18
19     connect(buttons[0], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd0(bool)));
20     connect(buttons[1], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd1(bool)));
21     connect(buttons[2], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd2(bool)));
22     connect(buttons[3], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd3(bool)));
23     connect(buttons[4], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd4(bool)));
24     connect(buttons[5], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd5(bool)));
25
26     this->setLayout(layout);
27 }
28
29 void MainWidget::showSettingsDialog()
30 {
31     bool isOk;
32     QString newText = QInputDialog::getText(this, tr("New Text"),
33             tr("Please enter a new text:"), QLineEdit::Normal,
34             "foo", &isOk);
35 //    if (isOk)
36 //        setText(newText);
37 }
38
39