Fix UI problem where key interactions could be requests without any wallet being selected
This commit is contained in:
parent
d595beb08d
commit
a2a9da0d98
@ -3,7 +3,7 @@
|
||||
{registered,[]},
|
||||
{included_applications,[]},
|
||||
{applications,[stdlib,kernel,sasl,ssl]},
|
||||
{vsn,"0.6.5"},
|
||||
{vsn,"0.6.6"},
|
||||
{modules,[gajudesk,gd_con,gd_grids,gd_gui,gd_jt,
|
||||
gd_sophia_editor,gd_sup,gd_v,gd_v_devman,gd_v_netman,
|
||||
gd_v_wallman]},
|
||||
|
@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gajudesk).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-behavior(application).
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
|
@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gd_con).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -37,7 +37,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gd_grids).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -3,7 +3,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gd_gui).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
@ -147,6 +147,12 @@ init(Prefs) ->
|
||||
end,
|
||||
|
||||
Buttons = [WallW, ChainW, NodeW, DevW | lists:map(MakeButton, ButtonTemplates)],
|
||||
Disable =
|
||||
fun(Button) ->
|
||||
#w{wx = W} = lists:keyfind(Button, #w.name, Buttons),
|
||||
wxButton:disable(W)
|
||||
end,
|
||||
ok = lists:foreach(Disable, key_buttons()),
|
||||
|
||||
ChainSz = wxBoxSizer:new(?wxHORIZONTAL),
|
||||
AccountSz = wxBoxSizer:new(?wxHORIZONTAL),
|
||||
@ -916,12 +922,28 @@ clear_account(State = #s{balance = {_, #w{wx = B}}, id = {_, #w{wx = I}}}) ->
|
||||
|
||||
do_wallet(none, #s{buttons = Buttons}) ->
|
||||
#w{wx = WalletB} = lists:keyfind(wallet, #w.name, Buttons),
|
||||
Disable =
|
||||
fun(Button) ->
|
||||
#w{wx = W} = lists:keyfind(Button, #w.name, Buttons),
|
||||
wxButton:disable(W)
|
||||
end,
|
||||
ok = lists:foreach(Disable, key_buttons()),
|
||||
ok = wxButton:setLabel(WalletB, "[no wallet]");
|
||||
do_wallet(Name, #s{buttons = Buttons}) ->
|
||||
#w{wx = WalletB} = lists:keyfind(wallet, #w.name, Buttons),
|
||||
Enable =
|
||||
fun(Button) ->
|
||||
#w{wx = W} = lists:keyfind(Button, #w.name, Buttons),
|
||||
wxButton:enable(W)
|
||||
end,
|
||||
ok = lists:foreach(Enable, key_buttons()),
|
||||
ok = wxButton:setLabel(WalletB, Name).
|
||||
|
||||
|
||||
key_buttons() ->
|
||||
[make_key, recover, mnemonic, rename, drop_key].
|
||||
|
||||
|
||||
do_chain(none, none, #s{buttons = Buttons}) ->
|
||||
#w{wx = ChainB} = lists:keyfind(chain, #w.name, Buttons),
|
||||
#w{wx = NodeB} = lists:keyfind(node, #w.name, Buttons),
|
||||
|
@ -15,7 +15,7 @@
|
||||
%%% translation library is retained).
|
||||
|
||||
-module(gd_jt).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-export([read_translations/1, j/2, oneshot_j/2]).
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
-module(gd_sophia_editor).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-export([new/1, update/2,
|
||||
get_text/1, set_text/2]).
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
%%% @end
|
||||
|
||||
-module(gd_sup).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-behaviour(supervisor).
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
|
@ -1,5 +1,5 @@
|
||||
-module(gd_v).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -1,5 +1,5 @@
|
||||
-module(gd_v_devman).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -1,5 +1,5 @@
|
||||
-module(gd_v_netman).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -1,5 +1,5 @@
|
||||
-module(gd_v_wallman).
|
||||
-vsn("0.6.5").
|
||||
-vsn("0.6.6").
|
||||
-author("Craig Everett <zxq9@zxq9.com>").
|
||||
-copyright("QPQ AG <info@qpq.swiss>").
|
||||
-license("GPL-3.0-or-later").
|
||||
|
@ -2,9 +2,9 @@
|
||||
{type,gui}.
|
||||
{modules,[]}.
|
||||
{prefix,"gd"}.
|
||||
{desc,"A desktop client for the Gajumaru network of blockchain networks"}.
|
||||
{author,"Craig Everett"}.
|
||||
{package_id,{"otpr","gajudesk",{0,6,5}}}.
|
||||
{desc,"A desktop client for the Gajumaru network of blockchain networks"}.
|
||||
{package_id,{"otpr","gajudesk",{0,6,6}}}.
|
||||
{deps,[{"otpr","hakuzaru",{0,6,1}},
|
||||
{"otpr","eblake2",{1,0,1}},
|
||||
{"otpr","base58",{0,1,1}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user