Merge branch 'master' of ssh://mercury.wipsl.com/var/git/irw
authorJari Jarvi <t7jaja00@students.oamk.fi>
Wed, 19 May 2010 09:18:27 +0000 (12:18 +0300)
committerJari Jarvi <t7jaja00@students.oamk.fi>
Wed, 19 May 2010 09:18:27 +0000 (12:18 +0300)
1  2 
src/mainwidget.cpp
src/mainwidget.h

diff --combined src/mainwidget.cpp
@@@ -1,6 -1,5 +1,6 @@@
  #include "mainwidget.h"
  
 +#include <QtGui/qinputdialog.h>
  #include <QGridLayout>
  #include <QPushButton>
  
@@@ -11,20 -10,18 +11,29 @@@ MainWidget::MainWidget (QWidget *parent
  
      for (int i = 0; i < BUTTON_COUNT; ++i)
      {
-         buttons[i] = new QPushButton(this);
-         layout->addWidget(buttons[i], i/3, i%3);
+         QPushButton *button = new QPushButton(QString(i+0x30), this);
+         buttons[i] = button;
+         layout->addWidget(button, i%2, i/2);
      }
+     connect(buttons[0], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd0(bool)));
+     connect(buttons[1], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd1(bool)));
+     connect(buttons[2], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd2(bool)));
+     connect(buttons[3], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd3(bool)));
+     connect(buttons[4], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd4(bool)));
+     connect(buttons[5], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd5(bool)));
      this->setLayout(layout);
  }
  
 +void MainWidget::showSettingsDialog()
 +{
 +    bool isOk;
 +    QString newText = QInputDialog::getText(this, tr("New Text"),
 +            tr("Please enter a new text:"), QLineEdit::Normal,
 +            "foo", &isOk);
 +//    if (isOk)
 +//        setText(newText);
 +}
 +
 +
diff --combined src/mainwidget.h
@@@ -3,6 -3,8 +3,8 @@@
  
  #include <QWidget>
  
+ #include "irctrl.h"
  class QGridLayout;
  class QPushButton;
  
@@@ -12,13 -14,11 +14,14 @@@ class MainWidget : public QWidge
  public:
      MainWidget (QWidget *parent = NULL);
  
 +public slots:
 +    void showSettingsDialog();
 + 
  private:
      static const int BUTTON_COUNT = 6;
      QGridLayout *layout;
      QPushButton *buttons[BUTTON_COUNT];
+     IrCtrl irCtrl;
  };
  
  #endif