Skip to content

Commit

Permalink
Add more haddocks
Browse files Browse the repository at this point in the history
  • Loading branch information
cdepillabout committed Oct 23, 2023
1 parent 2c900eb commit 8466908
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Termonad/Preferences.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{-# LANGUAGE CPP #-}

-- | Description : Controls the Preferences dialog and setting app preferences
-- Copyright : (c) Dennis Gosnell, 2023
-- License : BSD3
-- Stability : experimental
-- Portability : POSIX
--
-- This module controls the Preferences dialog, which lets you set Termonad
-- preferences at run-time.
--
-- It also exports helpful functions from "Termonad.Preferences.File".

module Termonad.Preferences
( module Termonad.Preferences.File
, showPreferencesDialog
Expand Down Expand Up @@ -160,6 +171,12 @@ applyNewPreferencesToWindow mvarTMState tmWinId = do
-- Sets the remaining preferences to each tab
foldMap (applyNewPreferencesToTab mvarTMState) tabFocusList

-- | Takes a 'TMState', and looks at the 'TMConfig' within.
-- Take all the configuration options from the 'TMConfig' and apply them to the
-- current 'Application', 'Window's, and 'Term's.
--
-- This function is meant to be used after a big update to the 'TMConfig' within a
-- 'TMState'.
applyNewPreferences :: TMState -> IO ()
applyNewPreferences mvarTMState = do
tmState <- readMVar mvarTMState
Expand Down Expand Up @@ -296,4 +313,3 @@ showPreferencesDialog mvarTMState = do
applyNewPreferences mvarTMState

widgetDestroy preferencesDialog

13 changes: 13 additions & 0 deletions src/Termonad/Preferences/File.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
{-# LANGUAGE CPP #-}

-- | Description : Read and write to the Preferences file
-- Copyright : (c) Dennis Gosnell, 2023
-- License : BSD3
-- Stability : experimental
-- Portability : POSIX
--
-- This module contains functions for reading and writing to the preferences file.
--
-- The preferences file is generally stored in
-- @~/.config/termonad/termonad.yaml@. It stores run-time preferences that
-- have been set through the Preferences dialog. Preferences are loaded on
-- app startup, but only if the @termonad.hs@ configuration file doesn't exist.

module Termonad.Preferences.File where

import Termonad.Prelude
Expand Down

0 comments on commit 8466908

Please sign in to comment.