diff options
author | Dan Gudmundsson <[email protected]> | 2011-11-09 15:48:02 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2011-11-10 08:14:19 +0100 |
commit | b7b88933672591d7f7c2a71a4c1643b6ca486f23 (patch) | |
tree | 609e2304f8f7ed9f141a26cb7c107b6078e3e29e /lib/observer/src/observer_sys_wx.erl | |
parent | 87487a2534d3e790f65ac5b90cfc497d7d05dd86 (diff) | |
download | otp-b7b88933672591d7f7c2a71a4c1643b6ca486f23.tar.gz otp-b7b88933672591d7f7c2a71a4c1643b6ca486f23.tar.bz2 otp-b7b88933672591d7f7c2a71a4c1643b6ca486f23.zip |
[observer] Improve process_info window
Also refactor some (re)used code
Diffstat (limited to 'lib/observer/src/observer_sys_wx.erl')
-rw-r--r-- | lib/observer/src/observer_sys_wx.erl | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl index 5bc5fd49f6..36aa226bd1 100644 --- a/lib/observer/src/observer_sys_wx.erl +++ b/lib/observer/src/observer_sys_wx.erl @@ -59,8 +59,10 @@ init2([Notebook, Parent]) -> {Info, Stat} = info_fields(), Panel = wxPanel:new(Notebook), Sizer = wxBoxSizer:new(?wxHORIZONTAL), - {FPanel0, _FSizer0, Fields0} = observer_lib:display_info(Panel, fill_info(Info, SysInfo)), - {FPanel1, _FSizer1, Fields1} = observer_lib:display_info(Panel, fill_info(Stat, SysInfo)), + {FPanel0, _FSizer0, Fields0} = + observer_lib:display_info(Panel, observer_lib:fill_info(Info, SysInfo)), + {FPanel1, _FSizer1, Fields1} = + observer_lib:display_info(Panel, observer_lib:fill_info(Stat, SysInfo)), wxSizer:add(Sizer, FPanel0, [{flag, ?wxEXPAND bor ?wxTOP bor ?wxBOTTOM bor ?wxLEFT}, {proportion, 1}, {border, 5}]), wxSizer:add(Sizer, FPanel1, [{flag, ?wxEXPAND bor ?wxTOP bor ?wxBOTTOM bor ?wxRIGHT}, @@ -81,7 +83,8 @@ update_syspage(#sys_wx_state{node = Node, fields=Fields, sizer=Sizer}) -> try SysInfo = observer_wx:try_rpc(Node, ?MODULE, sys_info, []), {Info, Stat} = info_fields(), - observer_lib:update_info(Fields, fill_info(Info, SysInfo) ++ fill_info(Stat, SysInfo)), + observer_lib:update_info(Fields, observer_lib:fill_info(Info, SysInfo) ++ + observer_lib:fill_info(Stat, SysInfo)), wxSizer:layout(Sizer) catch E:R -> io:format("~p:~p ~p~n",[E,R, erlang:get_stacktrace()]) @@ -124,14 +127,6 @@ info_fields() -> ], {Info, Stat}. -fill_info([{Str, Key}|Rest], Data) when is_atom(Key) -> - [{Str, proplists:get_value(Key,Data)} | fill_info(Rest, Data)]; -fill_info([{Str,SubStructure}|Rest], Data) -> - [{Str, fill_info(SubStructure, Data)}|fill_info(Rest,Data)]; -fill_info([{Str,Attrib,SubStructure}|Rest], Data) -> - [{Str, Attrib, fill_info(SubStructure, Data)}|fill_info(Rest,Data)]; -fill_info([], _) -> []. - %%%%%%%%%%%%%%%%%%%%%%% Callbacks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% handle_info(refresh_interval, #sys_wx_state{panel = Panel, |