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
, 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
# (wid,ps) = openId ps
# (okId,ps) = openId ps
......@@ -469,12 +483,19 @@ envDialog ap pp ts ct getTs setTs ps
) // selection update function
lbsllId
[ControlViewSize {h=siz.Size.h,w=300}]
# (compId,ps) = openId ps
# (cgenId,ps) = openId ps
# (linkId,ps) = openId ps
# (dynlId,ps) = openId ps
# (versId,ps) = openId ps
# (methId,ps) = openId ps
# ([compId,cgenId,linkId,dynlId,versId,methId,abcOptId,bcGenId,bcLinkId,bcStripId:_],ps) = openIds 10 ps
# environmentSettingsIds =
{ compId = compId
, cgenId = cgenId
, linkId = linkId
, dynlId = dynlId
, versId = versId
, methId = methId
, abcOptId = abcOptId
, bcGenId = bcGenId
, bcLinkId = bcLinkId
, bcStripId = bcStripId
}
# (c1id,ps) = openId ps
# (c2id,ps) = openId ps
# (c3id,ps) = openId ps
......@@ -495,7 +516,7 @@ envDialog ap pp ts ct getTs setTs ps
}
# (_,ps) = openModalDialog iniLS
(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
) ps
= ps
......@@ -503,22 +524,22 @@ where
tg = ts!!ct
inifull = False
ddef wid okId cancelId lbobj lbobjId lblib lblibId height lbpadId lbsll lbsllId siz compId cgenId linkId dynlId
versId methId c1id c2id c3id c4id r1id r2id r3id r4id
ddef wid okId cancelId lbobj lbobjId lblib lblibId height lbpadId lbsll lbsllId siz environmentSettingsIds
c1id c2id c3id c4id r1id r2id r3id r4id
= Dialog ("Environment: "+++tg.target_name)
(title :+: panes :+: buttons`)
[WindowId wid, WindowOk okId, WindowClose (noLS (closeWindow wid)), WindowCancel cancelId]
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
( 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 "Dynamic Libraries" (dlibpane inifull lblib c2id r2id)
:+: Pane "Static Libraries" (slibpane inifull lbsll c3id r3id)
:+: Pane "Object Modules" (objmpane inifull lbobj c4id r4id)
) [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"
[ ControlFunction savefun
, ControlId okId, ControlPos (Right,zero)
......@@ -568,12 +589,14 @@ where
| isNothing wdef
= abort "Fatal error in environment dialog: window has disappeared."
# wdef = fromJust wdef
# [(ok1,comp),(ok2,cgen),(ok3,link),(ok4,dynl),(ok5,vers),(ok6,mnum):_]
= getControlTexts [compId,cgenId,linkId,dynlId,versId,methId] wdef
| not (ok1 && ok2 && ok3 && ok4 && ok5 && ok6)
# [(ok1,comp),(ok2,cgen),(ok3,link),(ok4,dynl),(ok5,vers),(ok6,mnum),
(ok7,abcopt),(ok8,bcgen),(ok9,bclink),(ok10,bcstrip):_]
= 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."
| (isNothing comp) || (isNothing cgen) || (isNothing link) || (isNothing dynl)
|| (isNothing vers) || (isNothing mnum)
|| isNothing abcopt || isNothing bcgen || isNothing bclink || isNothing bcstrip
= abort "Fatal error in environment dialog: controls are empty."
# comp = fromJust comp
# cgen = fromJust cgen
......@@ -581,6 +604,10 @@ where
# dynl = fromJust dynl
# vers = fromJust vers
# mnum = fromJust mnum
# abcopt = fromJust abcopt
# bcgen = fromJust bcgen
# bclink = fromJust bclink
# bcstrip = fromJust bcstrip
# ls =
{ ls
& tg.target_comp = comp
......@@ -588,6 +615,10 @@ where
, tg.target_link = link
, tg.target_dynl = dynl
, 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
(CompileAsync _) -> {ls & tg.target_meth = CompileAsync (toInt mnum)}
......@@ -600,7 +631,7 @@ where
title
= 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]
:+: EditControl tg.target_comp (PixelWidth 250) 1
[ ControlId compId
......@@ -621,6 +652,26 @@ toolpane tg compId cgenId linkId dynlId versId methId
[ ControlId dynlId
, 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]
:+: EditControl (toString tg.target_vers) (PixelWidth 250) 1
[ ControlId versId
......@@ -658,7 +709,7 @@ toolpane tg compId cgenId linkId dynlId versId methId
, ControlActivate (noLS (appPIO (setEditControlSelection methId 1 0)))
]
where
textWidth = ContentWidth "Dynamic Linker: "
textWidth = ContentWidth "Bytecode Generator: "
redcfun (ls,ps)
# 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