WIP
This commit is contained in:
+20
-10
@@ -108,7 +108,7 @@ start_link(Args) ->
|
|||||||
% 9. File is decrypted and optionally signature verified
|
% 9. File is decrypted and optionally signature verified
|
||||||
% 10. GajuExpress deletes their copy of the file
|
% 10. GajuExpress deletes their copy of the file
|
||||||
|
|
||||||
init({Prefs, Manifest}) ->
|
init({Prefs, KeyManifest}) ->
|
||||||
Lang = maps:get(lang, Prefs, en),
|
Lang = maps:get(lang, Prefs, en),
|
||||||
Trans = gd_jt:read_translations(?MODULE),
|
Trans = gd_jt:read_translations(?MODULE),
|
||||||
J = gd_jt:j(Lang, Trans),
|
J = gd_jt:j(Lang, Trans),
|
||||||
@@ -118,10 +118,17 @@ init({Prefs, Manifest}) ->
|
|||||||
TopSz = wxBoxSizer:new(?wxVERTICAL),
|
TopSz = wxBoxSizer:new(?wxVERTICAL),
|
||||||
_ = wxBoxSizer:add(TopSz, Panel, zxw:flags(wide)),
|
_ = wxBoxSizer:add(TopSz, Panel, zxw:flags(wide)),
|
||||||
MainSz = wxBoxSizer:new(?wxVERTICAL),
|
MainSz = wxBoxSizer:new(?wxVERTICAL),
|
||||||
|
LR_Sz = wxBoxSizer:new(?wxHORIZONTAL),
|
||||||
|
|
||||||
Picker = wxListBox:new(Panel, ?wxID_ANY, [{style, ?wxLC_SINGLE_SEL}]),
|
DeliverySz = wxBoxSizer:new(?wxVERTICAL),
|
||||||
Names = [Name || #wr{name = Name} <- Manifest],
|
DeliveryP = wxListBox:new(Panel, ?wxID_ANY, [{style, ?wxLC_SINGLE_SEL}]),
|
||||||
ok = wxListBox:set(Picker, Names),
|
|
||||||
|
% ok = wxListBox:set(DeliveryP, Names),
|
||||||
|
|
||||||
|
|
||||||
|
SendingSz = wxBoxDizer:new(?wxVERTICAL),
|
||||||
|
|
||||||
|
KeyNames = [Name || #wr{name = Name} <- KeyManifest],
|
||||||
|
|
||||||
ButtSz = wxBoxSizer:new(?wxHORIZONTAL),
|
ButtSz = wxBoxSizer:new(?wxHORIZONTAL),
|
||||||
ButtonTemplates =
|
ButtonTemplates =
|
||||||
@@ -130,12 +137,7 @@ init({Prefs, Manifest}) ->
|
|||||||
{move, J("Move")},
|
{move, J("Move")},
|
||||||
{import, J("Import")},
|
{import, J("Import")},
|
||||||
{drop, J("Drop")}],
|
{drop, J("Drop")}],
|
||||||
MakeButton =
|
MakeButton = button_maker(Panel, ButtSz),
|
||||||
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,
|
|
||||||
Buttons = lists:map(MakeButton, ButtonTemplates),
|
Buttons = lists:map(MakeButton, ButtonTemplates),
|
||||||
|
|
||||||
_ = wxSizer:add(MainSz, Picker, zxw:flags(wide)),
|
_ = wxSizer:add(MainSz, Picker, zxw:flags(wide)),
|
||||||
@@ -171,6 +173,14 @@ init({Prefs, Manifest}) ->
|
|||||||
{Frame, State}.
|
{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
|
%%% wx_object
|
||||||
|
|||||||
Reference in New Issue
Block a user