There is now a partially functional block display in the aesalon GUI.
[aesalon.git] / src / gui / ActiveSessionBlockView.cpp
blob70db783a49407a6317040c177ffe44f66c7f7fd9
1 #include "ActiveSessionBlockView.h"
2 #include "ActiveSessionBlockView.moc"
3 #include "platform/BlockEvent.h"
5 namespace Aesalon {
6 namespace GUI {
8 ActiveSessionBlockView::ActiveSessionBlockView(Platform::Memory *memory, QWidget *parent) : QTableWidget(parent), memory(memory) {
9 this->setColumnCount(2);
13 ActiveSessionBlockView::~ActiveSessionBlockView() {
17 void ActiveSessionBlockView::memory_changed(Platform::Event *event) {
18 /* This is the block view, don't care about non-block events . . . */
19 if(event->get_type() != Platform::Event::BLOCK_EVENT) return;
20 Platform::BlockEvent *be = dynamic_cast<Platform::BlockEvent *>(event);
21 /*this->addItem(QString().setNum(be->get_address()));*/
22 this->setRowCount(this->rowCount()+1);
23 QTableWidgetItem *address, *size;
24 address = new QTableWidgetItem(QString().setNum((quint64)be->get_address(), 16));
25 size = new QTableWidgetItem(QString().setNum((quint64)be->get_size()));
26 this->setItem(this->rowCount()-1, 0, address);
27 this->setItem(this->rowCount()-1, 1, size);
31 } // namespace GUI
32 } // namespace Aesalon