diff --git a/include/gmc.hrl b/include/gmc.hrl index c2cab3f..d68e777 100644 --- a/include/gmc.hrl +++ b/include/gmc.hrl @@ -58,9 +58,11 @@ -record(tx, - {id = none :: none | clutch:id(), - amount = 0 :: non_neg_integer(), - type = spend :: spend | atom()}). + {id = none :: none | clutch:id(), + amount = 0 :: non_neg_integer(), + type = spend :: atom(), + status = submitted :: submitted | mined | rejected | failed, + meta = "" :: string()}). -record(spend_tx, diff --git a/src/gmc_con.erl b/src/gmc_con.erl index a17eb4d..6dd215d 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -1,7 +1,5 @@ %%% @doc %%% Clutch Controller -%%% -%%% This process is a in charge of maintaining the program's state. %%% @end -module(gmc_con). @@ -40,14 +38,15 @@ mon = none :: none | reference()}). -record(s, - {version = 1 :: integer(), - window = none :: none | wx:wx_object(), - tasks = [] :: [#ui{}], - picked = 0 :: non_neg_integer(), - wallet = none :: none | #wallet{}, - pass = none :: none | binary(), - prefs = #{} :: #{module() := term()}, - wallets = [] :: [#wr{}]}). + {version = 1 :: integer(), + window = none :: none | wx:wx_object(), + tasks = [] :: [#ui{}], + picked = 0 :: non_neg_integer(), + wallet = none :: none | #wallet{}, + pass = none :: none | binary(), + prefs = #{} :: #{module() := term()}, + wallets = [] :: [#wr{}], + in_flight = [] :: [#tx{}]}). -type state() :: #s{}. diff --git a/src/gmc_gui.erl b/src/gmc_gui.erl index 1bbb0e5..384f49c 100644 --- a/src/gmc_gui.erl +++ b/src/gmc_gui.erl @@ -1,9 +1,5 @@ %%% @doc %%% Clutch GUI -%%% -%%% This process is responsible for creating the main GUI frame displayed to the user. -%%% -%%% Reference: http://erlang.org/doc/man/wx_object.html %%% @end -module(gmc_gui). diff --git a/src/gmc_sup.erl b/src/gmc_sup.erl index 0bece53..d48dc72 100644 --- a/src/gmc_sup.erl +++ b/src/gmc_sup.erl @@ -36,11 +36,11 @@ start_link() -> init([]) -> RestartStrategy = {one_for_one, 0, 60}, - Clients = {gmc_con, - {gmc_con, start_link, []}, - permanent, - 5000, - worker, - [gmc_con]}, - Children = [Clients], + Controller = {gmc_con, + {gmc_con, start_link, []}, + permanent, + 5000, + worker, + [gmc_con]}, + Children = [Controller], {ok, {RestartStrategy, Children}}. diff --git a/src/gmc_v_devman.erl b/src/gmc_v_devman.erl index cf8034e..100b904 100644 --- a/src/gmc_v_devman.erl +++ b/src/gmc_v_devman.erl @@ -282,14 +282,17 @@ terminate(Reason, State) -> clicked(State = #s{book = {Notebook, Pages}}, Name, Button) -> case wxNotebook:getSelection(Notebook) of ?wxNOT_FOUND -> - ok = tell("Inconcievable! No notebook page is selected!"), + ok = tell(warning, "Inconcievable! No notebook page is selected!"), State; Index -> Page = lists:nth(Index + 1, Pages), clicked(State, Page, Name, Button) end. -clicked(State, #p{instances = Is, funs = {_, Funs}, builds = Builds}, {<<"init">>, call}) -> +clicked(State, + #p{instances = Is, funs = {_, Funs}, builds = Builds}, + {<<"init">>, call}, + Button) -> Label = wxChoice:getStringSelection(Is), Build = maps:get(Label, Builds), #f{args = Args} = lists:keyfind(<<"init">>, #f.name, Funs),