1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/visualizer/InputManagerWidget.cpp
10 #include <QVBoxLayout>
11 #include <QPushButton>
13 #include "visualizer/InputManagerWidget.h"
14 #include "visualizer/InputCreator.h"
16 namespace Visualizer
{
18 InputManagerWidget::InputManagerWidget(InputManager
*inputManager
) : m_inputManager(inputManager
) {
19 QVBoxLayout
*layout
= new QVBoxLayout();
21 m_listWidget
= new QListWidget();
22 layout
->addWidget(m_listWidget
);
24 QPushButton
*creatorButton
= new QPushButton(tr("Add &input"));
25 connect(creatorButton
, SIGNAL(clicked()), this, SLOT(showCreator()));
26 layout
->addWidget(creatorButton
);
30 connect(m_inputManager
, SIGNAL(inputAdded(DataInput
*)), this, SLOT(inputAdded(DataInput
*)));
32 foreach(DataInput
*input
, inputManager
->inputList()) inputAdded(input
);
35 InputManagerWidget::~InputManagerWidget() {
39 void InputManagerWidget::showCreator() {
40 InputCreator
ic(m_inputManager
);
41 connect(&ic
, SIGNAL(inputCreated(DataInput
*)), m_inputManager
, SLOT(addInput(DataInput
*)));
46 void InputManagerWidget::inputAdded(DataInput
*input
) {
47 new QListWidgetItem("Testing", m_listWidget
);
50 } // namespace Visualizer