From 6248dea71308a565d4b7b11384356e1419e9e52d Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 16 Sep 2009 19:15:21 +0200 Subject: cleanup of graph data dialog * grapher/GraphWidget.cxx (on_button_release_event, onDataAdd): tweaks for graph data dialog --- grapher/GraphWidget.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'grapher/GraphWidget.cxx') diff --git a/grapher/GraphWidget.cxx b/grapher/GraphWidget.cxx index aab3c964..d42e1a79 100644 --- a/grapher/GraphWidget.cxx +++ b/grapher/GraphWidget.cxx @@ -177,8 +177,12 @@ namespace systemtap bool GraphWidget::on_button_release_event(GdkEventButton* event) { - _activeGraph.reset(); - _trackingDrag = false; + // Was data dialog launched? + if (event->button != 3) + { + _activeGraph.reset(); + _trackingDrag = false; + } return true; } @@ -249,6 +253,15 @@ namespace systemtap void GraphWidget::onDataAdd() { + Glib::RefPtr treeSelection = + _dataTreeView->get_selection(); + Gtk::TreeModel::iterator iter = treeSelection->get_selected(); + if (iter) + { + Gtk::TreeModel::Row row = *iter; + shared_ptr data = row[_dataColumns._graphData]; + _activeGraph->addGraphData(data); + } } void GraphWidget::onDataRemove() @@ -257,7 +270,7 @@ namespace systemtap void GraphWidget::onDataDialogOpen() { - _listStore.clear(); + _listStore->clear(); for (GraphDataList::iterator itr = _graphData.begin(), end = _graphData.end(); itr != end; -- cgit