aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_wx.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-05-12 15:50:19 +0200
committerSiri Hansen <[email protected]>2016-05-20 09:40:56 +0200
commit7db703f88a8665bf6fc3266619044da3c882b1e3 (patch)
tree25690c8c564b2d5cb504af93e0dfd2d7402345f6 /lib/observer/src/observer_wx.erl
parentebd440bfc9eb685606250a82cae352f1ee37dac6 (diff)
downloadotp-7db703f88a8665bf6fc3266619044da3c882b1e3.tar.gz
otp-7db703f88a8665bf6fc3266619044da3c882b1e3.tar.bz2
otp-7db703f88a8665bf6fc3266619044da3c882b1e3.zip
[observer] Automatically add active node
When setting trace flags on 'new_processes' or 'new_ports', the currently active node is now automatically added if no other node is traced.
Diffstat (limited to 'lib/observer/src/observer_wx.erl')
-rw-r--r--lib/observer/src/observer_wx.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index d896da1291..29778f6d13 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -21,8 +21,8 @@
-behaviour(wx_object).
-export([start/0, stop/0]).
--export([create_menus/2, get_attrib/1, get_tracer/0, set_status/1,
- create_txt_dialog/4, try_rpc/4, return_to_localnode/2]).
+-export([create_menus/2, get_attrib/1, get_tracer/0, get_active_node/0,
+ set_status/1, create_txt_dialog/4, try_rpc/4, return_to_localnode/2]).
-export([init/1, handle_event/2, handle_cast/2, terminate/2, code_change/3,
handle_call/3, handle_info/2, check_page_title/1]).
@@ -90,6 +90,9 @@ set_status(What) ->
get_tracer() ->
wx_object:call(observer, get_tracer).
+get_active_node() ->
+ wx_object:call(observer, get_active_node).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
init(_Args) ->
@@ -385,6 +388,9 @@ handle_call({get_attrib, Attrib}, _From, State) ->
handle_call(get_tracer, _From, State=#state{trace_panel=TraceP}) ->
{reply, TraceP, State};
+handle_call(get_active_node, _From, State=#state{node=Node}) ->
+ {reply, Node, State};
+
handle_call(stop, _, State = #state{frame = Frame}) ->
wxFrame:destroy(Frame),
{stop, normal, ok, State};