summaryrefslogtreecommitdiffstats
path: root/grapher
diff options
context:
space:
mode:
Diffstat (limited to 'grapher')
-rw-r--r--grapher/GraphWidget.cxx15
-rw-r--r--grapher/GraphWidget.hxx2
2 files changed, 17 insertions, 0 deletions
diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx
index f3319806..aab3c964 100644
--- a/grapher/GraphWidget.cxx
+++ b/grapher/GraphWidget.cxx
@@ -59,6 +59,9 @@ namespace systemtap
_refXmlDataDialog->get_widget("treeview1", _dataTreeView);
_dataDialog->signal_map()
.connect(sigc::mem_fun(*this, &GraphWidget::onDataDialogOpen));
+ _listStore = Gtk::ListStore::create(_dataColumns);
+ _dataTreeView->set_model(_listStore);
+ _dataTreeView->append_column("Data", _dataColumns._dataName);
}
catch (const Gnome::Glade::XmlError& ex )
{
@@ -74,6 +77,7 @@ namespace systemtap
void GraphWidget::addGraphData(std::tr1::shared_ptr<GraphDataBase> data)
{
_graphs[0]->addGraphData(data);
+ _graphData.push_back(data);
}
void GraphWidget::addGraph()
@@ -253,5 +257,16 @@ namespace systemtap
void GraphWidget::onDataDialogOpen()
{
+ _listStore.clear();
+ for (GraphDataList::iterator itr = _graphData.begin(),
+ end = _graphData.end();
+ itr != end;
+ ++itr)
+ {
+ Gtk::TreeModel::iterator litr = _listStore->append();
+ Gtk::TreeModel::Row row = *litr;
+ row[_dataColumns._dataName] = (*itr)->title;
+ row[_dataColumns._graphData] = *itr;
+ }
}
}
diff --git a/grapher/GraphWidget.hxx b/grapher/GraphWidget.hxx
index 4548d0c3..876b6e09 100644
--- a/grapher/GraphWidget.hxx
+++ b/grapher/GraphWidget.hxx
@@ -36,6 +36,8 @@ namespace systemtap
protected:
typedef std::vector<std::tr1::shared_ptr<Graph> > GraphList;
GraphList _graphs;
+ typedef std::vector<std::tr1::shared_ptr<GraphDataBase> > GraphDataList;
+ GraphDataList _graphData;
// For click and drag
std::tr1::shared_ptr<Graph> _activeGraph;
// Dragging all graphs simultaneously, or perhaps seperately