Verified Commit 936b9ba7 authored by Camil Staps's avatar Camil Staps 🚀

Add options to edit bytecode tool paths in environment toolpane

parent 464f7de9
...@@ -413,6 +413,20 @@ editTargets getTs setTs ps ...@@ -413,6 +413,20 @@ editTargets getTs setTs ps
, lbpadId :: !ExtListBoxId ps , lbpadId :: !ExtListBoxId ps
} }
:: EnvironmentSettingsIds =
{ compId :: !Id // compiler
, cgenId :: !Id // code generator
, linkId :: !Id // linker
, dynlId :: !Id // dynamic linker
, versId :: !Id // ABC version
, methId :: !Id // compilation method
, abcOptId :: !Id // ABC optimiser
, bcGenId :: !Id // bytecode generator
, bcLinkId :: !Id // bytecode linker
, bcStripId :: !Id // bytecode stripper
}
envDialog ap pp ts ct getTs setTs ps envDialog ap pp ts ct getTs setTs ps
# (wid,ps) = openId ps # (wid,ps) = openId ps
# (okId,ps) = openId ps # (okId,ps) = openId ps
...@@ -469,12 +483,19 @@ envDialog ap pp ts ct getTs setTs ps ...@@ -469,12 +483,19 @@ envDialog ap pp ts ct getTs setTs ps
) // selection update function ) // selection update function
lbsllId lbsllId
[ControlViewSize {h=siz.Size.h,w=300}] [ControlViewSize {h=siz.Size.h,w=300}]
# (compId,ps) = openId ps # ([compId,cgenId,linkId,dynlId,versId,methId,abcOptId,bcGenId,bcLinkId,bcStripId:_],ps) = openIds 10 ps
# (cgenId,ps) = openId ps # environmentSettingsIds =
# (linkId,ps) = openId ps { compId = compId
# (dynlId,ps) = openId ps , cgenId = cgenId
# (versId,ps) = openId ps , linkId = linkId
# (methId,ps) = openId ps , dynlId = dynlId
, versId = versId
, methId = methId
, abcOptId = abcOptId
, bcGenId = bcGenId
, bcLinkId = bcLinkId
, bcStripId = bcStripId
}
# (c1id,ps) = openId ps # (c1id,ps) = openId ps
# (c2id,ps) = openId ps # (c2id,ps) = openId ps
# (c3id,ps) = openId ps # (c3id,ps) = openId ps
...@@ -495,7 +516,7 @@ envDialog ap pp ts ct getTs setTs ps ...@@ -495,7 +516,7 @@ envDialog ap pp ts ct getTs setTs ps
} }
# (_,ps) = openModalDialog iniLS # (_,ps) = openModalDialog iniLS
(ddef wid okId cancelId lbobj lbobjId lblib lblibId (path_size.Size.h) lbpadId lbsll (ddef wid okId cancelId lbobj lbobjId lblib lblibId (path_size.Size.h) lbpadId lbsll
lbsllId siz compId cgenId linkId dynlId versId methId c1id c2id c3id c4id lbsllId siz environmentSettingsIds c1id c2id c3id c4id
r1id r2id r3id r4id r1id r2id r3id r4id
) ps ) ps
= ps = ps
...@@ -503,22 +524,22 @@ where ...@@ -503,22 +524,22 @@ where
tg = ts!!ct tg = ts!!ct
inifull = False inifull = False
ddef wid okId cancelId lbobj lbobjId lblib lblibId height lbpadId lbsll lbsllId siz compId cgenId linkId dynlId ddef wid okId cancelId lbobj lbobjId lblib lblibId height lbpadId lbsll lbsllId siz environmentSettingsIds
versId methId c1id c2id c3id c4id r1id r2id r3id r4id c1id c2id c3id c4id r1id r2id r3id r4id
= Dialog ("Environment: "+++tg.target_name) = Dialog ("Environment: "+++tg.target_name)
(title :+: panes :+: buttons`) (title :+: panes :+: buttons`)
[WindowId wid, WindowOk okId, WindowClose (noLS (closeWindow wid)), WindowCancel cancelId] [WindowId wid, WindowOk okId, WindowClose (noLS (closeWindow wid)), WindowCancel cancelId]
where where
buttons` = buttons wid okId cancelId getTs setTs ct ts compId cgenId linkId dynlId versId methId buttons` = buttons wid okId cancelId getTs setTs ct ts environmentSettingsIds
panes = TabControl panes = TabControl
( Pane "Tools" (toolpane tg compId cgenId linkId dynlId versId methId) ( Pane "Tools" (toolpane tg environmentSettingsIds)
:+: Pane "Paths" (pathpane ap pp tg.target_path inifull height lbpadId c1id r1id) :+: Pane "Paths" (pathpane ap pp tg.target_path inifull height lbpadId c1id r1id)
:+: Pane "Dynamic Libraries" (dlibpane inifull lblib c2id r2id) :+: Pane "Dynamic Libraries" (dlibpane inifull lblib c2id r2id)
:+: Pane "Static Libraries" (slibpane inifull lbsll c3id r3id) :+: Pane "Static Libraries" (slibpane inifull lbsll c3id r3id)
:+: Pane "Object Modules" (objmpane inifull lbobj c4id r4id) :+: Pane "Object Modules" (objmpane inifull lbobj c4id r4id)
) [ControlPos (Left,zero)] ) [ControlPos (Left,zero)]
buttons wid okId cancelId getTs setTs ct ts compId cgenId linkId dynlId versId methId buttons wid okId cancelId getTs setTs ct ts {compId,cgenId,linkId,dynlId,versId,methId,abcOptId,bcGenId,bcLinkId,bcStripId}
= ButtonControl "Done" = ButtonControl "Done"
[ ControlFunction savefun [ ControlFunction savefun
, ControlId okId, ControlPos (Right,zero) , ControlId okId, ControlPos (Right,zero)
...@@ -568,12 +589,14 @@ where ...@@ -568,12 +589,14 @@ where
| isNothing wdef | isNothing wdef
= abort "Fatal error in environment dialog: window has disappeared." = abort "Fatal error in environment dialog: window has disappeared."
# wdef = fromJust wdef # wdef = fromJust wdef
# [(ok1,comp),(ok2,cgen),(ok3,link),(ok4,dynl),(ok5,vers),(ok6,mnum):_] # [(ok1,comp),(ok2,cgen),(ok3,link),(ok4,dynl),(ok5,vers),(ok6,mnum),
= getControlTexts [compId,cgenId,linkId,dynlId,versId,methId] wdef (ok7,abcopt),(ok8,bcgen),(ok9,bclink),(ok10,bcstrip):_]
| not (ok1 && ok2 && ok3 && ok4 && ok5 && ok6) = getControlTexts [compId,cgenId,linkId,dynlId,versId,methId,abcOptId,bcGenId,bcLinkId,bcStripId] wdef
| not (ok1 && ok2 && ok3 && ok4 && ok5 && ok6 && ok7 && ok8 && ok9 && ok10)
= abort "Fatal error in environment dialog: controls have disappeared." = abort "Fatal error in environment dialog: controls have disappeared."
| (isNothing comp) || (isNothing cgen) || (isNothing link) || (isNothing dynl) | (isNothing comp) || (isNothing cgen) || (isNothing link) || (isNothing dynl)
|| (isNothing vers) || (isNothing mnum) || (isNothing vers) || (isNothing mnum)
|| isNothing abcopt || isNothing bcgen || isNothing bclink || isNothing bcstrip
= abort "Fatal error in environment dialog: controls are empty." = abort "Fatal error in environment dialog: controls are empty."
# comp = fromJust comp # comp = fromJust comp
# cgen = fromJust cgen # cgen = fromJust cgen
...@@ -581,6 +604,10 @@ where ...@@ -581,6 +604,10 @@ where
# dynl = fromJust dynl # dynl = fromJust dynl
# vers = fromJust vers # vers = fromJust vers
# mnum = fromJust mnum # mnum = fromJust mnum
# abcopt = fromJust abcopt
# bcgen = fromJust bcgen
# bclink = fromJust bclink
# bcstrip = fromJust bcstrip
# ls = # ls =
{ ls { ls
& tg.target_comp = comp & tg.target_comp = comp
...@@ -588,6 +615,10 @@ where ...@@ -588,6 +615,10 @@ where
, tg.target_link = link , tg.target_link = link
, tg.target_dynl = dynl , tg.target_dynl = dynl
, tg.target_vers = toInt vers , tg.target_vers = toInt vers
, tg.target_abcopt = abcopt
, tg.target_bcgen = bcgen
, tg.target_bclink = bclink
, tg.target_bcstrip = bcstrip
} }
# ls = case ls.tg.target_meth of # ls = case ls.tg.target_meth of
(CompileAsync _) -> {ls & tg.target_meth = CompileAsync (toInt mnum)} (CompileAsync _) -> {ls & tg.target_meth = CompileAsync (toInt mnum)}
...@@ -600,7 +631,7 @@ where ...@@ -600,7 +631,7 @@ where
title title
= TextControl "Environment Options" [ControlPos (Center,zero)] = TextControl "Environment Options" [ControlPos (Center,zero)]
toolpane tg compId cgenId linkId dynlId versId methId toolpane tg {compId,cgenId,linkId,dynlId,versId,methId,abcOptId,bcGenId,bcLinkId,bcStripId}
= TextControl "Compiler: " [ControlWidth textWidth] = TextControl "Compiler: " [ControlWidth textWidth]
:+: EditControl tg.target_comp (PixelWidth 250) 1 :+: EditControl tg.target_comp (PixelWidth 250) 1
[ ControlId compId [ ControlId compId
...@@ -621,6 +652,26 @@ toolpane tg compId cgenId linkId dynlId versId methId ...@@ -621,6 +652,26 @@ toolpane tg compId cgenId linkId dynlId versId methId
[ ControlId dynlId [ ControlId dynlId
, ControlActivate (noLS (appPIO (setEditControlSelection dynlId 1 0))) , ControlActivate (noLS (appPIO (setEditControlSelection dynlId 1 0)))
] ]
:+: TextControl "ABC Optimiser: " [ControlPos (Left,zero),ControlWidth textWidth]
:+: EditControl tg.target_abcopt (PixelWidth 250) 1
[ ControlId abcOptId
, ControlActivate (noLS (appPIO (setEditControlSelection abcOptId 1 0)))
]
:+: TextControl "Bytecode Generator: " [ControlPos (Left,zero),ControlWidth textWidth]
:+: EditControl tg.target_bcgen (PixelWidth 250) 1
[ ControlId bcGenId
, ControlActivate (noLS (appPIO (setEditControlSelection bcGenId 1 0)))
]
:+: TextControl "Bytecode Linker: " [ControlPos (Left,zero),ControlWidth textWidth]
:+: EditControl tg.target_bclink (PixelWidth 250) 1
[ ControlId bcLinkId
, ControlActivate (noLS (appPIO (setEditControlSelection bcLinkId 1 0)))
]
:+: TextControl "Bytecode Stripper: " [ControlPos (Left,zero),ControlWidth textWidth]
:+: EditControl tg.target_bcstrip (PixelWidth 250) 1
[ ControlId bcStripId
, ControlActivate (noLS (appPIO (setEditControlSelection bcStripId 1 0)))
]
:+: TextControl "ABC version: " [ControlPos (Left,zero),ControlWidth textWidth] :+: TextControl "ABC version: " [ControlPos (Left,zero),ControlWidth textWidth]
:+: EditControl (toString tg.target_vers) (PixelWidth 250) 1 :+: EditControl (toString tg.target_vers) (PixelWidth 250) 1
[ ControlId versId [ ControlId versId
...@@ -658,7 +709,7 @@ toolpane tg compId cgenId linkId dynlId versId methId ...@@ -658,7 +709,7 @@ toolpane tg compId cgenId linkId dynlId versId methId
, ControlActivate (noLS (appPIO (setEditControlSelection methId 1 0))) , ControlActivate (noLS (appPIO (setEditControlSelection methId 1 0)))
] ]
where where
textWidth = ContentWidth "Dynamic Linker: " textWidth = ContentWidth "Bytecode Generator: "
redcfun (ls,ps) redcfun (ls,ps)
# ls = {ls & tg.target_redc = not ls.tg.target_redc} # ls = {ls & tg.target_redc = not ls.tg.target_redc}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment