WIP
This commit is contained in:
parent
95015eb50c
commit
bfa8cc91c2
@ -60,7 +60,9 @@
|
|||||||
-record(tx,
|
-record(tx,
|
||||||
{id = none :: none | clutch:id(),
|
{id = none :: none | clutch:id(),
|
||||||
amount = 0 :: non_neg_integer(),
|
amount = 0 :: non_neg_integer(),
|
||||||
type = spend :: spend | atom()}).
|
type = spend :: atom(),
|
||||||
|
status = submitted :: submitted | mined | rejected | failed,
|
||||||
|
meta = "" :: string()}).
|
||||||
|
|
||||||
|
|
||||||
-record(spend_tx,
|
-record(spend_tx,
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
%%% @doc
|
%%% @doc
|
||||||
%%% Clutch Controller
|
%%% Clutch Controller
|
||||||
%%%
|
|
||||||
%%% This process is a in charge of maintaining the program's state.
|
|
||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_con).
|
-module(gmc_con).
|
||||||
@ -47,7 +45,8 @@
|
|||||||
wallet = none :: none | #wallet{},
|
wallet = none :: none | #wallet{},
|
||||||
pass = none :: none | binary(),
|
pass = none :: none | binary(),
|
||||||
prefs = #{} :: #{module() := term()},
|
prefs = #{} :: #{module() := term()},
|
||||||
wallets = [] :: [#wr{}]}).
|
wallets = [] :: [#wr{}],
|
||||||
|
in_flight = [] :: [#tx{}]}).
|
||||||
|
|
||||||
|
|
||||||
-type state() :: #s{}.
|
-type state() :: #s{}.
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
%%% @doc
|
%%% @doc
|
||||||
%%% Clutch GUI
|
%%% 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
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_gui).
|
-module(gmc_gui).
|
||||||
|
@ -36,11 +36,11 @@ start_link() ->
|
|||||||
|
|
||||||
init([]) ->
|
init([]) ->
|
||||||
RestartStrategy = {one_for_one, 0, 60},
|
RestartStrategy = {one_for_one, 0, 60},
|
||||||
Clients = {gmc_con,
|
Controller = {gmc_con,
|
||||||
{gmc_con, start_link, []},
|
{gmc_con, start_link, []},
|
||||||
permanent,
|
permanent,
|
||||||
5000,
|
5000,
|
||||||
worker,
|
worker,
|
||||||
[gmc_con]},
|
[gmc_con]},
|
||||||
Children = [Clients],
|
Children = [Controller],
|
||||||
{ok, {RestartStrategy, Children}}.
|
{ok, {RestartStrategy, Children}}.
|
||||||
|
@ -282,14 +282,17 @@ terminate(Reason, State) ->
|
|||||||
clicked(State = #s{book = {Notebook, Pages}}, Name, Button) ->
|
clicked(State = #s{book = {Notebook, Pages}}, Name, Button) ->
|
||||||
case wxNotebook:getSelection(Notebook) of
|
case wxNotebook:getSelection(Notebook) of
|
||||||
?wxNOT_FOUND ->
|
?wxNOT_FOUND ->
|
||||||
ok = tell("Inconcievable! No notebook page is selected!"),
|
ok = tell(warning, "Inconcievable! No notebook page is selected!"),
|
||||||
State;
|
State;
|
||||||
Index ->
|
Index ->
|
||||||
Page = lists:nth(Index + 1, Pages),
|
Page = lists:nth(Index + 1, Pages),
|
||||||
clicked(State, Page, Name, Button)
|
clicked(State, Page, Name, Button)
|
||||||
end.
|
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),
|
Label = wxChoice:getStringSelection(Is),
|
||||||
Build = maps:get(Label, Builds),
|
Build = maps:get(Label, Builds),
|
||||||
#f{args = Args} = lists:keyfind(<<"init">>, #f.name, Funs),
|
#f{args = Args} = lists:keyfind(<<"init">>, #f.name, Funs),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user