From cd14e151f84926cbdd1243b62ef5478681f56369 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 29 Apr 2016 08:58:27 +0200 Subject: [observer] In Trace tab, show procs/ports for selected node only Earlier, all traced processes and ports would be shown, independent of selected nodes in node view. This is now corrected. --- lib/observer/src/observer_trace_wx.erl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl index f5211c8a31..ac8c6cdc4f 100644 --- a/lib/observer/src/observer_trace_wx.erl +++ b/lib/observer/src/observer_trace_wx.erl @@ -198,6 +198,7 @@ create_proc_port_view(Parent) -> wxListCtrl:connect(Procs, command_list_item_right_click), wxListCtrl:connect(Ports, command_list_item_right_click), wxListCtrl:connect(Nodes, command_list_item_right_click), + wxListCtrl:connect(Nodes, command_list_item_selected), wxListCtrl:connect(Procs, size, [{skip, true}]), wxListCtrl:connect(Ports, size, [{skip, true}]), wxListCtrl:connect(Nodes, size, [{skip, true}]), @@ -295,6 +296,15 @@ handle_event(#wx{id=?MODULES_WIN, event=#wxList{type=command_list_item_selected, update_functions_view(dict:fetch(Module, TPs), Fview), {noreply, State}; +handle_event(#wx{id=?NODES_WIN, + event=#wxList{type=command_list_item_selected, itemIndex=Row}}, + State = #state{tpids=Tpids, tports=Tports, n_view=Nview, + proc_view=ProcView, port_view=PortView}) -> + Node = list_to_atom(wxListCtrl:getItemText(Nview, Row)), + update_p_view(Tpids, ProcView, Node), + update_p_view(Tports, PortView, Node), + {noreply, State}; + handle_event(#wx{event = #wxCommand{type = command_togglebutton_clicked, commandInt = 1}}, #state{panel = Panel, nodes = Nodes, @@ -679,6 +689,13 @@ do_add_pid_or_port(POpts, Nview, LCtrl, OldPs, Ns0, Check) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +update_p_view(PidsOrPorts0, LCtrl, Node) -> + %% Show processes/ports belonging to the given node, + %% and processes/ports traced by name + PidsOrPorts = [P || P <- PidsOrPorts0, + is_atom(P#titem.id) orelse node(P#titem.id)==Node], + update_p_view(PidsOrPorts,LCtrl). + update_p_view(PidsOrPorts, LCtrl) -> %% pid- or port-view wxListCtrl:deleteAllItems(LCtrl), -- cgit v1.2.3