summaryrefslogtreecommitdiffstats
path: root/grapher/GraphWidget.cxx
diff options
context:
space:
mode:
authorTim Moore <moore@blackbox.bricoworks.com>2009-09-02 15:16:26 +0200
committerTim Moore <timoore@redhat.com>2009-09-30 20:40:29 +0200
commit239edc45bc2215485362eda09422e380f02ad0c1 (patch)
tree7bbddd837c37bd25b98747dbb02d6f9b5a20a4b5 /grapher/GraphWidget.cxx
parenteece8f14d92f71fc12ab87c529fffc5fcc5a4e94 (diff)
downloadsystemtap-steved-239edc45bc2215485362eda09422e380f02ad0c1.tar.gz
systemtap-steved-239edc45bc2215485362eda09422e380f02ad0c1.tar.xz
systemtap-steved-239edc45bc2215485362eda09422e380f02ad0c1.zip
Create lists of graph data to choose
Diffstat (limited to 'grapher/GraphWidget.cxx')
-rw-r--r--grapher/GraphWidget.cxx15
1 files changed, 15 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;
+ }
}
}