This commit is contained in:
2026-05-16 18:54:59 +09:00
parent fb0e33f350
commit e7478dd35d
+20 -10
View File
@@ -108,7 +108,7 @@ start_link(Args) ->
% 9. File is decrypted and optionally signature verified
% 10. GajuExpress deletes their copy of the file
init({Prefs, Manifest}) ->
init({Prefs, KeyManifest}) ->
Lang = maps:get(lang, Prefs, en),
Trans = gd_jt:read_translations(?MODULE),
J = gd_jt:j(Lang, Trans),
@@ -118,10 +118,17 @@ init({Prefs, Manifest}) ->
TopSz = wxBoxSizer:new(?wxVERTICAL),
_ = wxBoxSizer:add(TopSz, Panel, zxw:flags(wide)),
MainSz = wxBoxSizer:new(?wxVERTICAL),
LR_Sz = wxBoxSizer:new(?wxHORIZONTAL),
Picker = wxListBox:new(Panel, ?wxID_ANY, [{style, ?wxLC_SINGLE_SEL}]),
Names = [Name || #wr{name = Name} <- Manifest],
ok = wxListBox:set(Picker, Names),
DeliverySz = wxBoxSizer:new(?wxVERTICAL),
DeliveryP = wxListBox:new(Panel, ?wxID_ANY, [{style, ?wxLC_SINGLE_SEL}]),
% ok = wxListBox:set(DeliveryP, Names),
SendingSz = wxBoxDizer:new(?wxVERTICAL),
KeyNames = [Name || #wr{name = Name} <- KeyManifest],
ButtSz = wxBoxSizer:new(?wxHORIZONTAL),
ButtonTemplates =
@@ -130,12 +137,7 @@ init({Prefs, Manifest}) ->
{move, J("Move")},
{import, J("Import")},
{drop, J("Drop")}],
MakeButton =
fun({Name, Label}) ->
B = wxButton:new(Panel, ?wxID_ANY, [{label, Label}]),
_ = wxSizer:add(ButtSz, B, zxw:flags({wide, 5})),
#w{name = Name, id = wxButton:getId(B), wx = B}
end,
MakeButton = button_maker(Panel, ButtSz),
Buttons = lists:map(MakeButton, ButtonTemplates),
_ = wxSizer:add(MainSz, Picker, zxw:flags(wide)),
@@ -171,6 +173,14 @@ init({Prefs, Manifest}) ->
{Frame, State}.
button_maker(Parent, Sizer) ->
fun({Name, Label}) ->
B = wxButton:new(Parent, ?wxID_ANY, [{label, Label}]),
_ = wxSizer:add(Sizer, B, zxw:flags({wide, 5})),
#w{name = Name, id = wxButton:getId(B), wx = B}
end.
%%% wx_object