Fix configuration crashes
This commit is contained in:
parent
e86a130180
commit
002196059e
@ -3,6 +3,6 @@
|
|||||||
{registered,[]},
|
{registered,[]},
|
||||||
{included_applications,[]},
|
{included_applications,[]},
|
||||||
{applications,[stdlib,kernel]},
|
{applications,[stdlib,kernel]},
|
||||||
{vsn,"0.2.1"},
|
{vsn,"0.2.2"},
|
||||||
{modules,[gajumine,gmc_con,gmc_conf,gmc_gui,gmc_sup]},
|
{modules,[gajumine,gmc_con,gmc_conf,gmc_gui,gmc_sup]},
|
||||||
{mod,{gajumine,[]}}]}.
|
{mod,{gajumine,[]}}]}.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gajumine).
|
-module(gajumine).
|
||||||
-vsn("0.2.1").
|
-vsn("0.2.2").
|
||||||
-behavior(application).
|
-behavior(application).
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_con).
|
-module(gmc_con).
|
||||||
-vsn("0.2.1").
|
-vsn("0.2.2").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_conf).
|
-module(gmc_conf).
|
||||||
-vsn("0.2.1").
|
-vsn("0.2.2").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
@ -51,7 +51,6 @@ trouble(Info) ->
|
|||||||
start_link(Prefs) ->
|
start_link(Prefs) ->
|
||||||
wx_object:start_link({local, ?MODULE}, ?MODULE, Prefs, []).
|
wx_object:start_link({local, ?MODULE}, ?MODULE, Prefs, []).
|
||||||
|
|
||||||
|
|
||||||
init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
|
init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
|
||||||
ok = log(info, "GUI starting..."),
|
ok = log(info, "GUI starting..."),
|
||||||
Lang = maps:get(lang, Prefs, en_US),
|
Lang = maps:get(lang, Prefs, en_US),
|
||||||
@ -70,8 +69,8 @@ init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
|
|||||||
KeysTx = wxTextCtrl:new(Frame, ?wxID_ANY, [{style, ?wxTE_MULTILINE}, {value, keys(Keys)}]),
|
KeysTx = wxTextCtrl:new(Frame, ?wxID_ANY, [{style, ?wxTE_MULTILINE}, {value, keys(Keys)}]),
|
||||||
_ = wxStaticBoxSizer:add(KeysSz, KeysTx, wide(5)),
|
_ = wxStaticBoxSizer:add(KeysSz, KeysTx, wide(5)),
|
||||||
StatSz = wxStaticBoxSizer:new(?wxVERTICAL, Frame, [{label, J("Max System Committment (optional)")}]),
|
StatSz = wxStaticBoxSizer:new(?wxVERTICAL, Frame, [{label, J("Max System Committment (optional)")}]),
|
||||||
AProcsS = integer_to_list(AProcs),
|
AProcsS = i_to_l(AProcs),
|
||||||
MProcsS = integer_to_list(MProcs),
|
MProcsS = i_to_l(MProcs),
|
||||||
AMemS = gigs(AMem),
|
AMemS = gigs(AMem),
|
||||||
MMemS = gigs(MMem),
|
MMemS = gigs(MMem),
|
||||||
Labels = [{J("HW Cores"), J("Max Cores"), AProcsS, MProcsS}, {J("Memory (GB)"), J("Max Memory"), AMemS, MMemS}],
|
Labels = [{J("HW Cores"), J("Max Cores"), AProcsS, MProcsS}, {J("Memory (GB)"), J("Max Memory"), AMemS, MMemS}],
|
||||||
@ -105,12 +104,18 @@ init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) ->
|
|||||||
{Frame, State}.
|
{Frame, State}.
|
||||||
|
|
||||||
|
|
||||||
|
i_to_l(none) -> "0";
|
||||||
|
i_to_l(N) when is_integer(N) -> integer_to_list(N).
|
||||||
|
|
||||||
|
|
||||||
base(Padding) -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
|
base(Padding) -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
|
||||||
|
|
||||||
wide(Padding) -> [{proportion, 1}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
|
wide(Padding) -> [{proportion, 1}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}].
|
||||||
|
|
||||||
center() -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALIGN_CENTER_VERTICAL}].
|
center() -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALIGN_CENTER_VERTICAL}].
|
||||||
|
|
||||||
|
gigs(none) ->
|
||||||
|
"0";
|
||||||
gigs(Bytes) ->
|
gigs(Bytes) ->
|
||||||
float_to_list(Bytes / gig(), [{decimals, 2}, compact]).
|
float_to_list(Bytes / gig(), [{decimals, 2}, compact]).
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_gui).
|
-module(gmc_gui).
|
||||||
-vsn("0.2.1").
|
-vsn("0.2.2").
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
||||||
-license("GPL-3.0-or-later").
|
-license("GPL-3.0-or-later").
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(gmc_sup).
|
-module(gmc_sup).
|
||||||
-vsn("0.2.1").
|
-vsn("0.2.2").
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
-author("Craig Everett <craigeverett@qpq.swiss>").
|
-author("Craig Everett <craigeverett@qpq.swiss>").
|
||||||
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
-copyright("QPQ AG <craigeverett@qpq.swiss>").
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{prefix,"gmc"}.
|
{prefix,"gmc"}.
|
||||||
{author,"Craig Everett"}.
|
{author,"Craig Everett"}.
|
||||||
{desc,"Mining client for the Gajumaru Root"}.
|
{desc,"Mining client for the Gajumaru Root"}.
|
||||||
{package_id,{"qpq","gajumine",{0,2,1}}}.
|
{package_id,{"qpq","gajumine",{0,2,2}}}.
|
||||||
{deps,[{"uwiger","gmcuckoo",{1,2,3}},
|
{deps,[{"uwiger","gmcuckoo",{1,2,3}},
|
||||||
{"uwiger","gmhive_client",{0,4,3}},
|
{"uwiger","gmhive_client",{0,4,3}},
|
||||||
{"qpq","cuckoo_cpu",{0,3,0}},
|
{"qpq","cuckoo_cpu",{0,3,0}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user