Skip to content

Commit 9b4addc

Browse files
committed
Merge remote-tracking branch 'origin/pr/1286'
2 parents 42bb666 + dcc2e4c commit 9b4addc

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed

ghcup.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ library ghcup-tui
377377
GHCup.Brick.Widgets.SectionList
378378
GHCup.Brick.Widgets.Menu
379379
GHCup.Brick.Widgets.Menus.Context
380-
GHCup.Brick.Widgets.Menus.AdvanceInstall
380+
GHCup.Brick.Widgets.Menus.AdvancedInstall
381381
GHCup.Brick.Widgets.Menus.CompileGHC
382382
GHCup.Brick.Widgets.Menus.CompileHLS
383383
GHCup.Brick.Actions

lib-tui/GHCup/Brick/Actions.hs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import GHCup.Brick.BrickState
2828
import GHCup.Brick.Widgets.SectionList
2929
import qualified GHCup.Brick.Widgets.Menus.Context as ContextMenu
3030
import GHCup.Brick.Widgets.Navigation (BrickInternalState)
31-
import qualified GHCup.Brick.Widgets.Menus.AdvanceInstall as AdvanceInstall
31+
import qualified GHCup.Brick.Widgets.Menus.AdvancedInstall as AdvancedInstall
3232
import qualified GHCup.Brick.Widgets.Menus.CompileGHC as CompileGHC
3333
import GHCup.Brick.Widgets.Menu (MenuKeyBindings(..))
3434

@@ -182,19 +182,19 @@ withIOAction action = do
182182
Left err -> throwIO $ userError err
183183

184184
installWithOptions :: (MonadReader AppState m, MonadIO m, MonadThrow m, MonadFail m, MonadMask m, MonadUnliftIO m, Alternative m)
185-
=> AdvanceInstall.InstallOptions
185+
=> AdvancedInstall.InstallOptions
186186
-> (Int, ListResult)
187187
-> m (Either String ())
188188
installWithOptions opts (_, ListResult {..}) = do
189189
AppState { ghcupInfo = GHCupInfo { _ghcupDownloads = dls }} <- ask
190190
let
191-
misolated = opts ^. AdvanceInstall.isolateDirL
192-
shouldIsolate = maybe GHCupInternal IsolateDir (opts ^. AdvanceInstall.isolateDirL)
193-
shouldForce = opts ^. AdvanceInstall.forceInstallL
194-
shouldSet = opts ^. AdvanceInstall.instSetL
195-
extraArgs = opts ^. AdvanceInstall.addConfArgsL
196-
installTargets = opts ^. AdvanceInstall.installTargetsL
197-
v = fromMaybe (GHCTargetVersion lCross lVer) (opts ^. AdvanceInstall.instVersionL)
191+
misolated = opts ^. AdvancedInstall.isolateDirL
192+
shouldIsolate = maybe GHCupInternal IsolateDir (opts ^. AdvancedInstall.isolateDirL)
193+
shouldForce = opts ^. AdvancedInstall.forceInstallL
194+
shouldSet = opts ^. AdvancedInstall.instSetL
195+
extraArgs = opts ^. AdvancedInstall.addConfArgsL
196+
installTargets = opts ^. AdvancedInstall.installTargetsL
197+
v = fromMaybe (GHCTargetVersion lCross lVer) (opts ^. AdvancedInstall.instVersionL)
198198
toolV = _tvVersion v
199199
let run =
200200
runResourceT
@@ -244,7 +244,7 @@ installWithOptions opts (_, ListResult {..}) = do
244244
lift $ logWarn
245245
"...waiting for 5 seconds, you can still abort..."
246246
liftIO $ threadDelay 5000000 -- give the user a sec to intervene
247-
case opts ^. AdvanceInstall.instBindistL of
247+
case opts ^. AdvancedInstall.instBindistL of
248248
Nothing -> do
249249
liftE $
250250
runBothE'
@@ -272,7 +272,7 @@ installWithOptions opts (_, ListResult {..}) = do
272272
lift $ logWarn
273273
"...waiting for 5 seconds, you can still abort..."
274274
liftIO $ threadDelay 5000000 -- give the user a sec to intervene
275-
case opts ^. AdvanceInstall.instBindistL of
275+
case opts ^. AdvancedInstall.instBindistL of
276276
Nothing -> do
277277
liftE $
278278
runBothE'
@@ -301,7 +301,7 @@ installWithOptions opts (_, ListResult {..}) = do
301301
lift $ logWarn
302302
"...waiting for 5 seconds, you can still abort..."
303303
liftIO $ threadDelay 5000000 -- give the user a sec to intervene
304-
case opts ^. AdvanceInstall.instBindistL of
304+
case opts ^. AdvancedInstall.instBindistL of
305305
Nothing -> do
306306
liftE $
307307
runBothE'
@@ -321,7 +321,7 @@ installWithOptions opts (_, ListResult {..}) = do
321321

322322
Stack -> do
323323
let vi = getVersionInfo v Stack dls
324-
case opts ^. AdvanceInstall.instBindistL of
324+
case opts ^. AdvancedInstall.instBindistL of
325325
Nothing -> do
326326
liftE $
327327
runBothE'
@@ -363,7 +363,7 @@ installWithOptions opts (_, ListResult {..}) = do
363363

364364
install' :: (MonadReader AppState m, MonadIO m, MonadThrow m, MonadFail m, MonadMask m, MonadUnliftIO m, Alternative m)
365365
=> (Int, ListResult) -> m (Either String ())
366-
install' = installWithOptions (AdvanceInstall.InstallOptions Nothing False Nothing Nothing False [] "install")
366+
install' = installWithOptions (AdvancedInstall.InstallOptions Nothing False Nothing Nothing False [] "install")
367367

368368
set' :: (MonadReader AppState m, MonadIO m, MonadThrow m, MonadFail m, MonadMask m, MonadUnliftIO m, Alternative m)
369369
=> (Int, ListResult)
@@ -759,7 +759,7 @@ keyHandlers KeyBindings {..} =
759759
, (bUp, const "Up", Common.zoom appState moveUp)
760760
, (bDown, const "Down", Common.zoom appState moveDown)
761761
, (KeyCombination (Vty.KChar 'h') [], const "help", mode .= KeyInfo)
762-
, (KeyCombination Vty.KEnter [], const "advance options", createMenuforTool )
762+
, (KeyCombination Vty.KEnter [], const "advanced options", createMenuforTool )
763763
]
764764
where
765765
createMenuforTool = do

lib-tui/GHCup/Brick/App.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ module GHCup.Brick.App where
2525

2626
import qualified GHCup.Brick.Actions as Actions
2727
import qualified GHCup.Brick.Attributes as Attributes
28-
import GHCup.Brick.BrickState (BrickState (..), advanceInstallMenu, appKeys, appSettings, appState, contextMenu, mode, compileGHCMenu, compileHLSMenu)
28+
import GHCup.Brick.BrickState (BrickState (..), advancedInstallMenu, appKeys, appSettings, appState, contextMenu, mode, compileGHCMenu, compileHLSMenu)
2929
import GHCup.Brick.Common (Mode (..), Name (..))
3030
import qualified GHCup.Brick.Common as Common
3131
import qualified GHCup.Brick.Widgets.KeyInfo as KeyInfo
3232
import qualified GHCup.Brick.Widgets.Menus.Context as ContextMenu
3333
import qualified GHCup.Brick.Widgets.Navigation as Navigation
3434
import qualified GHCup.Brick.Widgets.Tutorial as Tutorial
3535
import qualified GHCup.Brick.Widgets.Menu as Menu
36-
import qualified GHCup.Brick.Widgets.Menus.AdvanceInstall as AdvanceInstall
36+
import qualified GHCup.Brick.Widgets.Menus.AdvancedInstall as AdvancedInstall
3737

3838
import GHCup.List (ListResult)
3939
import GHCup.Types (AppState (AppState, keyBindings), KeyCombination (KeyCombination), KeyBindings (..))
@@ -103,7 +103,7 @@ drawUI dimAttrs st =
103103
Tutorial -> [Tutorial.draw (bQuit $ st ^. appKeys), navg]
104104
KeyInfo -> [KeyInfo.draw (st ^. appKeys), navg]
105105
ContextPanel -> [ContextMenu.draw (st ^. contextMenu), navg]
106-
AdvanceInstallPanel -> AdvanceInstall.draw (st ^. advanceInstallMenu) ++ [navg]
106+
AdvancedInstallPanel -> AdvancedInstall.draw (st ^. advancedInstallMenu) ++ [navg]
107107
CompileGHCPanel -> CompileGHC.draw (st ^. compileGHCMenu) ++ [navg]
108108
CompileHLSPanel -> CompileHLS.draw (st ^. compileHLSMenu) ++ [navg]
109109

@@ -146,13 +146,13 @@ contextMenuHandler ev = do
146146
case (ev, focusedElement) of
147147
(_ , Nothing) -> pure ()
148148
(VtyEvent (Vty.EvKey k m), Just n) | k == exitKey && m == mods -> mode .= Navigation
149-
(VtyEvent (Vty.EvKey Vty.KEnter []), Just (Common.MenuElement Common.AdvanceInstallButton) ) -> mode .= Common.AdvanceInstallPanel
149+
(VtyEvent (Vty.EvKey Vty.KEnter []), Just (Common.MenuElement Common.AdvancedInstallButton) ) -> mode .= Common.AdvancedInstallPanel
150150
(VtyEvent (Vty.EvKey Vty.KEnter []), Just (Common.MenuElement Common.CompileGHCButton) ) -> mode .= Common.CompileGHCPanel
151151
(VtyEvent (Vty.EvKey Vty.KEnter []), Just (Common.MenuElement Common.CompileHLSButton) ) -> mode .= Common.CompileHLSPanel
152152
_ -> Common.zoom contextMenu $ ContextMenu.handler ev
153153
--
154-
advanceInstallHandler :: BrickEvent Name e -> EventM Name BrickState ()
155-
advanceInstallHandler = menuWithOverlayHandler advanceInstallMenu Actions.installWithOptions AdvanceInstall.handler
154+
advancedInstallHandler :: BrickEvent Name e -> EventM Name BrickState ()
155+
advancedInstallHandler = menuWithOverlayHandler advancedInstallMenu Actions.installWithOptions AdvancedInstall.handler
156156

157157
compileGHCHandler :: BrickEvent Name e -> EventM Name BrickState ()
158158
compileGHCHandler = menuWithOverlayHandler compileGHCMenu Actions.compileGHC CompileGHC.handler
@@ -190,6 +190,6 @@ eventHandler ev = do
190190
Tutorial -> tutorialHandler ev
191191
Navigation -> navigationHandler ev
192192
ContextPanel -> contextMenuHandler ev
193-
AdvanceInstallPanel -> advanceInstallHandler ev
193+
AdvancedInstallPanel -> advancedInstallHandler ev
194194
CompileGHCPanel -> compileGHCHandler ev
195195
CompileHLSPanel -> compileHLSHandler ev

lib-tui/GHCup/Brick/BrickState.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ import GHCup.Types ( KeyBindings )
3232
import GHCup.Brick.Common ( BrickData(..), BrickSettings(..), Mode(..))
3333
import GHCup.Brick.Widgets.Navigation ( BrickInternalState)
3434
import GHCup.Brick.Widgets.Menus.Context (ContextMenu)
35-
import GHCup.Brick.Widgets.Menus.AdvanceInstall (AdvanceInstallMenu)
35+
import GHCup.Brick.Widgets.Menus.AdvancedInstall (AdvancedInstallMenu)
3636
import GHCup.Brick.Widgets.Menus.CompileGHC (CompileGHCMenu)
3737
import Optics.TH (makeLenses)
3838
import GHCup.Brick.Widgets.Menus.CompileHLS (CompileHLSMenu)
3939

4040

4141
data BrickState = BrickState
42-
{ _appData :: BrickData
43-
, _appSettings :: BrickSettings
44-
, _appState :: BrickInternalState
45-
, _contextMenu :: ContextMenu
46-
, _advanceInstallMenu :: AdvanceInstallMenu
47-
, _compileGHCMenu :: CompileGHCMenu
48-
, _compileHLSMenu :: CompileHLSMenu
49-
, _appKeys :: KeyBindings
50-
, _mode :: Mode
42+
{ _appData :: BrickData
43+
, _appSettings :: BrickSettings
44+
, _appState :: BrickInternalState
45+
, _contextMenu :: ContextMenu
46+
, _advancedInstallMenu :: AdvancedInstallMenu
47+
, _compileGHCMenu :: CompileGHCMenu
48+
, _compileHLSMenu :: CompileHLSMenu
49+
, _appKeys :: KeyBindings
50+
, _mode :: Mode
5151
}
5252
--deriving Show
5353

lib-tui/GHCup/Brick/Common.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module GHCup.Brick.Common (
4545
UrlEditBox, SetCheckBox, IsolateEditBox, ForceCheckBox, AdditionalEditBox
4646
, TargetGhcEditBox, BootstrapGhcEditBox, HadrianGhcEditBox, JobsEditBox, BuildConfigEditBox
4747
, PatchesEditBox, CrossTargetEditBox, AddConfArgsEditBox, OvewrwiteVerEditBox
48-
, BuildFlavourEditBox, BuildSystemEditBox, OkButton, AdvanceInstallButton
48+
, BuildFlavourEditBox, BuildSystemEditBox, OkButton, AdvancedInstallButton
4949
, CompileGHCButton, CompileHLSButton, CabalProjectEditBox
5050
, CabalProjectLocalEditBox, UpdateCabalCheckBox, GitRefEditBox
5151
, BootstrapGhcSelectBox, HadrianGhcSelectBox, ToolVersionBox, GHCInstallTargets
@@ -77,8 +77,8 @@ newtype ResourceId = ResourceId Int deriving (Eq, Ord, Show)
7777

7878
pattern OkButton :: ResourceId
7979
pattern OkButton = ResourceId 0
80-
pattern AdvanceInstallButton :: ResourceId
81-
pattern AdvanceInstallButton = ResourceId 100
80+
pattern AdvancedInstallButton :: ResourceId
81+
pattern AdvancedInstallButton = ResourceId 100
8282
pattern CompileGHCButton :: ResourceId
8383
pattern CompileGHCButton = ResourceId 101
8484
pattern CompileHLSButton :: ResourceId
@@ -149,7 +149,7 @@ data Name = AllTools -- ^ The main list widget
149149
| TutorialBox -- ^ The tutorial widget
150150
| ContextBox -- ^ The resource for Context Menu
151151
| CompileGHCBox -- ^ The resource for CompileGHC Menu
152-
| AdvanceInstallBox -- ^ The resource for AdvanceInstall Menu
152+
| AdvancedInstallBox -- ^ The resource for AdvancedInstall Menu
153153
| MenuElement ResourceId -- ^ Each element in a Menu. Resources must not be share for visible
154154
-- Menus, but MenuA and MenuB can share resources if they both are
155155
-- invisible, or just one of them is visible.
@@ -161,7 +161,7 @@ data Mode = Navigation
161161
| KeyInfo
162162
| Tutorial
163163
| ContextPanel
164-
| AdvanceInstallPanel
164+
| AdvancedInstallPanel
165165
| CompileGHCPanel
166166
| CompileHLSPanel
167167
deriving (Eq, Show, Ord)

lib-tui/GHCup/Brick/Widgets/Menus/AdvanceInstall.hs renamed to lib-tui/GHCup/Brick/Widgets/Menus/AdvancedInstall.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
{-# LANGUAGE InstanceSigs #-}
1515
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
1616

17-
module GHCup.Brick.Widgets.Menus.AdvanceInstall (
17+
module GHCup.Brick.Widgets.Menus.AdvancedInstall (
1818
InstallOptions (..),
19-
AdvanceInstallMenu,
19+
AdvancedInstallMenu,
2020
create,
2121
handler,
2222
draw,
@@ -70,10 +70,10 @@ makeLensesFor [
7070
]
7171
''InstallOptions
7272

73-
type AdvanceInstallMenu = Menu InstallOptions Name
73+
type AdvancedInstallMenu = Menu InstallOptions Name
7474

75-
create :: MenuKeyBindings -> AdvanceInstallMenu
76-
create k = Menu.createMenu AdvanceInstallBox initialState "Advance Install" validator k [ok] fields
75+
create :: MenuKeyBindings -> AdvancedInstallMenu
76+
create k = Menu.createMenu AdvancedInstallBox initialState "Advanced Install" validator k [ok] fields
7777
where
7878
initialInstallTargets = "install"
7979
initialState = InstallOptions Nothing False Nothing Nothing False [] initialInstallTargets
@@ -124,12 +124,12 @@ create k = Menu.createMenu AdvanceInstallBox initialState "Advance Install" vali
124124
]
125125

126126
ok = Menu.createButtonField (Common.MenuElement Common.OkButton)
127-
& Menu.fieldLabelL .~ "Advance Install"
127+
& Menu.fieldLabelL .~ "Advanced Install"
128128
& Menu.fieldHelpMsgL .~ "Install with options below"
129129

130-
handler :: BrickEvent Name e -> EventM Name AdvanceInstallMenu ()
130+
handler :: BrickEvent Name e -> EventM Name AdvancedInstallMenu ()
131131
handler = Menu.handlerMenu
132132

133133

134-
draw :: AdvanceInstallMenu -> [Widget Name]
134+
draw :: AdvancedInstallMenu -> [Widget Name]
135135
draw = Menu.drawMenu

lib-tui/GHCup/Brick/Widgets/Menus/Context.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ create :: ListResult -> MenuKeyBindings -> ContextMenu
3232
create lr keyBindings = Menu.createMenu Common.ContextBox lr "" validator keyBindings buttons []
3333
where
3434
advInstallButton =
35-
Menu.createButtonField (MenuElement Common.AdvanceInstallButton)
35+
Menu.createButtonField (MenuElement Common.AdvancedInstallButton)
3636
& Menu.fieldLabelL .~ "Install"
37-
& Menu.fieldHelpMsgL .~ "Advance Installation Settings"
37+
& Menu.fieldHelpMsgL .~ "Advanced Installation Settings"
3838
compileGhcButton =
3939
Menu.createButtonField (MenuElement Common.CompileGHCButton)
4040
& Menu.fieldLabelL .~ "Compile"

lib-tui/GHCup/BrickMain.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import qualified GHCup.Brick.Attributes as Attributes
2727
import qualified GHCup.Brick.BrickState as AppState
2828
import qualified GHCup.Brick.Widgets.Menus.Context as ContextMenu
2929
import qualified GHCup.Brick.Widgets.SectionList as Navigation
30-
import qualified GHCup.Brick.Widgets.Menus.AdvanceInstall as AdvanceInstall
30+
import qualified GHCup.Brick.Widgets.Menus.AdvancedInstall as AdvancedInstall
3131
import qualified GHCup.Brick.Widgets.Menus.CompileGHC as CompileGHC
3232
import GHCup.Brick.Widgets.Menu (MenuKeyBindings(..))
3333
import qualified Brick
@@ -73,7 +73,7 @@ brickMain s = do
7373
Common.defaultAppSettings
7474
initial_list
7575
(ContextMenu.create e exit_key)
76-
(AdvanceInstall.create exit_key)
76+
(AdvancedInstall.create exit_key)
7777
(CompileGHC.create exit_key installedGHCs)
7878
(CompileHLS.create exit_key installedGHCs)
7979
(keyBindings s)

0 commit comments

Comments
 (0)