From 002196059ed893ac1f087272da65a2ab4c9b398a Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Thu, 12 Jun 2025 18:04:36 +0900 Subject: [PATCH] Fix configuration crashes --- ebin/gajumine.app | 2 +- src/gajumine.erl | 2 +- src/gmc_con.erl | 2 +- src/gmc_conf.erl | 13 +++++++++---- src/gmc_gui.erl | 2 +- src/gmc_sup.erl | 2 +- zomp.meta | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ebin/gajumine.app b/ebin/gajumine.app index fe6478f..a6d20f3 100644 --- a/ebin/gajumine.app +++ b/ebin/gajumine.app @@ -3,6 +3,6 @@ {registered,[]}, {included_applications,[]}, {applications,[stdlib,kernel]}, - {vsn,"0.2.1"}, + {vsn,"0.2.2"}, {modules,[gajumine,gmc_con,gmc_conf,gmc_gui,gmc_sup]}, {mod,{gajumine,[]}}]}. diff --git a/src/gajumine.erl b/src/gajumine.erl index 1743cfe..6949d00 100644 --- a/src/gajumine.erl +++ b/src/gajumine.erl @@ -3,7 +3,7 @@ %%% @end -module(gajumine). --vsn("0.2.1"). +-vsn("0.2.2"). -behavior(application). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/src/gmc_con.erl b/src/gmc_con.erl index 10e2e3e..efa9593 100644 --- a/src/gmc_con.erl +++ b/src/gmc_con.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_con). --vsn("0.2.1"). +-vsn("0.2.2"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_conf.erl b/src/gmc_conf.erl index 07195e4..39936d5 100644 --- a/src/gmc_conf.erl +++ b/src/gmc_conf.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_conf). --vsn("0.2.1"). +-vsn("0.2.2"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). @@ -51,7 +51,6 @@ trouble(Info) -> start_link(Prefs) -> wx_object:start_link({local, ?MODULE}, ?MODULE, Prefs, []). - init({Prefs, {Net, Acc, Keys, {AProcs, AMem, MProcs, MMem}}}) -> ok = log(info, "GUI starting..."), 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)}]), _ = wxStaticBoxSizer:add(KeysSz, KeysTx, wide(5)), StatSz = wxStaticBoxSizer:new(?wxVERTICAL, Frame, [{label, J("Max System Committment (optional)")}]), - AProcsS = integer_to_list(AProcs), - MProcsS = integer_to_list(MProcs), + AProcsS = i_to_l(AProcs), + MProcsS = i_to_l(MProcs), AMemS = gigs(AMem), MMemS = gigs(MMem), 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}. +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}]. wide(Padding) -> [{proportion, 1}, {flag, ?wxEXPAND bor ?wxALL}, {border, Padding}]. center() -> [{proportion, 0}, {flag, ?wxEXPAND bor ?wxALIGN_CENTER_VERTICAL}]. +gigs(none) -> + "0"; gigs(Bytes) -> float_to_list(Bytes / gig(), [{decimals, 2}, compact]). diff --git a/src/gmc_gui.erl b/src/gmc_gui.erl index ec62693..f650b76 100644 --- a/src/gmc_gui.erl +++ b/src/gmc_gui.erl @@ -3,7 +3,7 @@ %%% @end -module(gmc_gui). --vsn("0.2.1"). +-vsn("0.2.2"). -author("Craig Everett "). -copyright("QPQ AG "). -license("GPL-3.0-or-later"). diff --git a/src/gmc_sup.erl b/src/gmc_sup.erl index d9b525d..032716c 100644 --- a/src/gmc_sup.erl +++ b/src/gmc_sup.erl @@ -12,7 +12,7 @@ %%% @end -module(gmc_sup). --vsn("0.2.1"). +-vsn("0.2.2"). -behaviour(supervisor). -author("Craig Everett "). -copyright("QPQ AG "). diff --git a/zomp.meta b/zomp.meta index 18ba3a5..ee11640 100644 --- a/zomp.meta +++ b/zomp.meta @@ -4,7 +4,7 @@ {prefix,"gmc"}. {author,"Craig Everett"}. {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}}, {"uwiger","gmhive_client",{0,4,3}}, {"qpq","cuckoo_cpu",{0,3,0}},