-// TopicWidget *topicwidget = new TopicWidget(dock);
-// dock->setWidget(topicwidget);
-
-// addDockWidget(Qt::TopDockWidgetArea, dock);
+ QDockWidget *dock = new QDockWidget(tr("Topic Dock"), this);
+ dock->setObjectName("TopicDock");
+ dock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
+
+ TopicWidget *topicwidget = new TopicWidget(dock);
+ dock->setWidget(topicwidget);
+
+ Client::bufferModel()->mapProperty(1, Qt::DisplayRole, topicwidget, "topic");
+
+ addDockWidget(Qt::TopDockWidgetArea, dock);
+
+ ui.menuViews->addAction(dock->toggleViewAction());
+
+
+ // attach the BufferWidget to the PropertyMapper
+ Client::bufferModel()->mapProperty(0, NetworkModel::BufferIdRole, ui.bufferWidget, "currentBuffer");
+ connect(Client::networkModel(), SIGNAL(bufferAboutToBeRemoved(BufferId)),
+ ui.bufferWidget, SLOT(removeBuffer(BufferId)));