Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

server start and configuration.

Ignore-this: 490469f8db31fc9db3f62860b76793d1

darcs-hash:20100226161851-e153b-30bba665310ce7d4c0c3e72eb870e22680221dc5.gz
  • Loading branch information...
commit 42c80a86e95f4be0cfd8ebad594da1bab839dcbb 1 parent 621b01b
jutaro authored
16 data/current.lkshs
View
@@ -1,14 +1,16 @@
Version of session file format:
1
Time of storage:
- "Fri Oct 30 16:53:02 CET 2009"
-Layout: VerticalP (TerminalP {paneGroups = fromList [], paneTabs = Just LeftP, currentPage = -1, detachedId = Nothing, detachedSize = Nothing}) (HorizontalP (TerminalP {paneGroups = fromList [("Browser",HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 461),("Debug",HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Just TopP, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 482),("Search",HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 447)], paneTabs = Just BottomP, currentPage = 3, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 717) 792
-Population: [(Just (BreakpointsSt BreakpointsState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (ErrorsSt ErrorsState),[SplitP RightP,SplitP TopP]),(Just (GrepSt GrepState),[SplitP RightP,SplitP TopP,GroupP "Search",SplitP BottomP]),(Just (InfoSt (InfoState (Just (Descr {descrName' = "Bitmap", typeInfo' = Just "type Bitmap\n = [StgWord]\n", descrModu' = Just (PM {pack = PackageIdentifier {pkgName = PackageName "ghc", pkgVersion = Version {versionBranch = [6,10,4], versionTags = []}}, modu = ModuleName ["Bitmap"]}), mbLocation' = Just (Location {locationSLine = 37, locationSCol = 0, locationELine = 37, locationECol = 23}), mbComment' = Just "A bitmap represented by a sequence of 'StgWord's on the /target/\narchitecture. These are used for bitmaps in info tables and other\ngenerated code which need to be emitted as sequences of StgWords.\n\n", details' = TypeDescr})))),[SplitP RightP,SplitP TopP,GroupP "Browser",SplitP BottomP]),(Just (LogSt LogState),[SplitP RightP,SplitP BottomP]),(Just (ModulesSt (ModulesState 426 (SystemScope,True) (Nothing,Nothing) (ExpanderState {packageExp = ([[1,17],[1,14],[1,8],[1,1],[1]],[]), packageExpNoBlack = ([[1,17],[1,1],[1]],[]), packageDExp = ([[10,17],[10],[9,0,0],[9,0],[9]],[]), packageDExpNoBlack = ([[155,17],[155],[70,6],[70]],[]), workspaceExp = ([[5,17],[5,14],[5,8],[5,1],[5],[4,0,1],[4,0,0],[4,0],[4],[1,0],[1],[0]],[]), workspaceExpNoBlack = ([],[]), workspaceDExp = ([[15,12],[15,7],[15,6],[15,4],[15],[10,17],[10,1],[10],[9,0,0],[9,0],[9],[8],[2]],[]), workspaceDExpNoBlack = ([],[]), systemExp = ([[20],[19],[18,0],[18],[17,7],[17,6],[17,5,1],[17,5,0],[17,5],[17,4],[17,2],[17,1,0],[17,1],[17,0],[17],[16,1],[16,0],[16],[15,15],[15,14,11],[15,14,7],[15,14,1],[15,14],[15,13],[15,10],[15,9,1],[15,9,0],[15,9],[15,8],[15,7],[15,6],[15,4],[15,2,0],[15,2],[15],[12,5],[12,4],[12,3],[12],[10,0,0,5],[10,0,0,4],[10,0,0,3],[10,0,0,2],[10,0,0,1],[10,0,0,0],[10,0,0],[10,0],[10],[9,0],[9],[8,3,3],[8,3,0],[8,3],[8,2,3,24],[8,2,3,22],[8,2,3,21,6],[8,2,3,21],[8,2,3,19],[8,2,3,18],[8,2,3,17],[8,2,3,16],[8,2,3,15],[8,2,3,14],[8,2,3,13],[8,2,3,12],[8,2,3,11],[8,2,3,10],[8,2,3,9],[8,2,3,8],[8,2,3,7],[8,2,3,6],[8,2,3,5],[8,2,3,4],[8,2,3,2],[8,2,3,1],[8,2,3,0],[8,2,3],[8,2,2,1],[8,2,2],[8,2,1],[8,2,0],[8,2],[8,1],[8,0,1,1],[8,0,1,0,29],[8,0,1,0,18],[8,0,1,0],[8,0,1],[8,0,0,0,2],[8,0,0,0,1],[8,0,0,0,0],[8,0,0,0],[8,0,0],[8,0],[8],[7],[6,3],[6,0],[6],[5,11,14],[5,11,0],[5,11],[5,8],[5,0],[5],[3,0],[3],[2,32,1],[2,32,0],[2,32],[2,31],[2,28],[2,14,0,8],[2,14,0,5],[2,14,0,4],[2,14,0],[2,14],[2,4,3],[2,4],[2,1],[2,0,5,3],[2,0,5],[2,0,3],[2,0],[2],[1,8],[1,6,12],[1,6,10],[1,6,8],[1,6,7],[1,6,6],[1,6,1],[1,6,0],[1,6],[1,5],[1,3,4],[1,3],[1],[0,1,1],[0,1],[0,0,0],[0,0],[0]],[]), systemExpNoBlack = ([],[])}))),[SplitP RightP,SplitP TopP,GroupP "Browser",SplitP TopP]),(Just (ReferencesSt (ReferencesState {refTo = Just (Descr {descrName' = "belongsToActivePackage", typeInfo' = Just "belongsToActivePackage :: IDEBuffer -> IDEM Bool\n", descrModu' = Just (PM {pack = PackageIdentifier {pkgName = PackageName "leksah", pkgVersion = Version {versionBranch = [0,7], versionTags = []}}, modu = ModuleName ["IDE","Package"]}), mbLocation' = Just (Location {locationSLine = 126, locationSCol = 0, locationELine = 155, locationECol = 53}), mbComment' = Nothing, details' = VariableDescr}), refScope = PackageScope True})),[SplitP RightP,SplitP TopP]),(Just (SearchSt (SearchState {searchString = "", searchScope = SystemScope, searchMode = Regex {caseSense = False}})),[SplitP RightP,SplitP TopP,GroupP "Search",SplitP TopP]),(Just (TraceSt TraceState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (VariablesSt VariablesState),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP BottomP]),(Just (WorkspaceSt WorkspaceState),[SplitP RightP,SplitP TopP]),(Just (BufferSt (BufferStateTrans "_Eval.hs" "\n" 0)),[SplitP RightP,SplitP TopP,GroupP "Debug",SplitP TopP])]
-Window size: (1412,995)
+ "Fri Feb 26 17:11:46 CET 2010"
+Layout: VerticalP (TerminalP {paneGroups = fromList [], paneTabs = Just TopP, currentPage = -1, detachedId = Nothing, detachedSize = Nothing}) (HorizontalP (TerminalP {paneGroups = fromList [("Browser",HorizontalP (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Nothing, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 329)], paneTabs = Just BottomP, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) (TerminalP {paneGroups = fromList [], paneTabs = Just BottomP, currentPage = 0, detachedId = Nothing, detachedSize = Nothing}) 658) 886
+Population: [(Just (InfoSt (InfoState Nothing)),[SplitP RightP,SplitP TopP,GroupP "Browser",SplitP BottomP]),(Just (LogSt LogState),[SplitP RightP,SplitP BottomP]),(Just (ModulesSt (ModulesState 401 (SystemScope,True) (Nothing,Nothing) (ExpanderState {packageExp = ([],[]), packageExpNoBlack = ([],[]), packageDExp = ([],[]), packageDExpNoBlack = ([],[]), workspaceExp = ([],[]), workspaceExpNoBlack = ([[6,13],[6]],[]), workspaceDExp = ([],[]), workspaceDExpNoBlack = ([],[]), systemExp = ([],[]), systemExpNoBlack = ([],[])}))),[SplitP RightP,SplitP TopP,GroupP "Browser",SplitP TopP]),(Just (WorkspaceSt WorkspaceState),[SplitP RightP,SplitP BottomP])]
+Window size: (1643,1030)
Workspace: Nothing
-Active pane: Just "_Eval.hs"
+Active pane: Nothing
Toolbar visible:
True
-FindbarState: (False,FindState {entryStr = "ints", entryHist = [], replaceStr = "", replaceHist = [], caseSensitive = False, entireWord = False, wrapAround = True, regex = False, lineNr = 1})
+FindbarState: (True,FindState {entryStr = "", entryHist = [], replaceStr = "", replaceHist = [], caseSensitive = False, entireWord = False, wrapAround = False, regex = False, lineNr = 1})
Recently opened files:
- []
+ ["/home/jutaro/.cabal/share/leksah-0.7/data/welcome.txt"]
+Recently opened workspaces:
+ []
4 data/keymap.lkshk
View
@@ -79,7 +79,7 @@ F3 -> EditFindNext "Find the next occurenc
<ctrl>j -> NextError
<ctrl><shift>j -> PreviousError
-<ctrl>m -> ShowModules
+<ctrl>o -> ShowModules
--<ctrl>i -> ShowInterface
@@ -106,5 +106,7 @@ F8 -> DebugStepModule
F9 -> DebugContinue
<ctrl>Return -> ExecuteSelection
+<ctrl>m -> UpdateMetadataCurrent
+
1  data/leksah.menu
View
@@ -93,6 +93,7 @@
<menuitem name="_Browser" action="ShowBrowser" />
<menuitem name="_Debugger" action="ShowDebugger" />
<menuitem name="_Errors" action="ShowErrors" />
+ <menuitem name="_Grep" action="ShowGrep" />
<menuitem name="_Log" action="ShowLog" />
<menuitem name="_References" action="ShowReferences" />
<menuitem name="_Search" action="ShowSearch" />
30 data/prefs.lkshp
View
@@ -2,12 +2,12 @@ Version number of preferences file format:
1
--Integer
Time of last storage:
- "Thu Jan 28 13:31:43 Westeurop\228ische Normalzeit 2010"
+ "Fri Feb 26 16:43:57 CET 2010"
Show line numbers:
True
--(True/False)
-TextView Font: "Monospace 9"
-Right margin: 110
+TextView Font: "Monospace 10"
+Right margin: 100
--Size or 0 for no right margin
Tab width: 4
Use standard line ends even on windows:
@@ -16,7 +16,7 @@ Remove trailing blanks when saving a file:
True
Source candy: "candy"
--Empty for do not use or the name of a candy file in a config dir
-Editor Style: "kate"
+Editor Style: ""
Found Text Background:
Color 65535 65535 32768
Execution Context Text Background:
@@ -25,11 +25,11 @@ Breakpoint Text Background:
Color 65535 49152 32768
Use Yi - Experimental feature (could wipe your files):
False
-LogView Font: "Sans 10"
+LogView Font: "Sans 12"
Window default size:
- (800,800)
+ (1024,800)
--Default size of the main ide window specified as pair (int,int)
-Use ctrl Tab for Notebook flipper:
+Use ctrl Tab for Notebook flipper:
True
Complete only on Hotkey:
False
@@ -37,23 +37,25 @@ Name of the keymap:
keymap
--The name of a keymap file in a config dir
Categories for panes:
- [("*ClassHierarchy","TreeCategory"),("*Debug","TreeCategory"),("*Grep","TreeCategory"),("*Info","LogCategory"),("*Log","LogCategory"),("*Modules","TreeCategory"),("*Package","DialogCategory"),("*Flags","DialogCategory"),("*Prefs","DialogCategory"),("*References","LogCategory"),("*Search","TreeCategory"),("*Errors","TreeCategory")]
+ [("*Debug","ToolCategory"),("*Grep","ToolCategory"),("*Log","LogCategory"),("*Search","ToolCategory"),("*Browser","ToolCategory"),("*Package","EditorCategory"),("*Flags","EditorCategory"),("*References","LogCategory"),("*Workspace","LogCategory"),("*Errors","ToolCategory")]
Pane path for category:
- [("EditorCategory",[SplitP LeftP]),("TreeCategory",[SplitP RightP,SplitP TopP]),("LogCategory",[SplitP RightP,SplitP BottomP]),("DialogCategory",[SplitP LeftP])]
+ [("EditorCategory",[SplitP LeftP]),("ToolCategory",[SplitP RightP,SplitP TopP]),("LogCategory",[SplitP RightP,SplitP BottomP])]
Default pane path:
[SplitP LeftP]
Paths under which haskell sources for packages may be found:
- ["~/Develop"]
+ []
Maybe a directory for unpacking cabal packages:
- Just "~/Haskell"
+ Just "~/.leksah-0.7/packageSources"
+Maybe an URL to load prebuild metadata :
+ Just "http://www.leksah.org"
Update metadata at startup:
True
-Update metadata after every build:
- True
Port number for server connection:
11111
+Server IP address :
+ "127.0.0.1"
Packages which are excluded from the modules pane:
- [Dependency (PackageName "base") (EarlierVersion (Version {versionBranch = [4,0,0,0], versionTags = []})),Dependency (PackageName "ghc") AnyVersion,Dependency (PackageName "haskell98") AnyVersion]
+ [Dependency (PackageName "ghc") AnyVersion]
Automatically save all files before building:
True
Background build:
8 data/prefscoll.lkshp
View
@@ -0,0 +1,8 @@
+Paths under which haskell sources for packages may be found:
+ []
+Maybe a directory for unpacking cabal packages:
+ Just "~/.leksah-0.7/packageSources"
+Maybe an URL to load prebuild metadata :
+ Just "http://www.leksah.org"
+Port number for server connection:
+ 11111
61 data/welcome.txt
View
@@ -1,6 +1,46 @@
-
-
-
+
+ $=,:Z D7,,,,,,:7$Z
+ $......,= +.....,+$
+ =...,~:..,+D D:~~::~=$
+ O~.=????????..O 8III?II$Z
+ :.I??????????~:N 77I??778
+ ??7777777II????+?8 877??I$O
+ O:$$$ZDNDZ$77I??I:= I7I?I$D
+ Z?$D $77I?II7 87II77O
+ $$ 77III:$ DIIII7$
+ $N O7II7=D ?7II7Z
+ $D $77I77 87II7$
+ Z$II7Z 8I7I7$N
+ $777?D IIII$N
+ $777+ O7777Z
+ D$77$O I7I77
+ Z$III?Z Z777$D
+ $7III7? DI777D
+ $7777777Z I77$$
+ O?77$8$77I 8777$N
+ ?777D D77$$ O?77$N
+ Z77$7 $$7IO I777$
+ N+77$8 N$77? Z777$
+ $777O D$7$$ I777$
+ 7?77$ $77+.777O
+ N=77$O D$7I=I7$
+ 8+77$8 $7III$O
+ ?I777 N$7I7$
+ Z7I778 N7777$
+ N~II7$ $777$
+ 8I7I7$D $7I7:Z
+ I~I77O N7II=,N Z
+ $III7$ $7II7,N $
+ $:II7$8 $7II~~Z O7N
+ O~7II78 D$7I?:.=8 ~$$
+ ~III7$ O77??=..? N?,,$
+ O~I??7$D $7I???:.........,7
+ N,~I?I77 O7I???=,.....,+$N
+ $,II?I7$D $7I????????I7$8
+ O,:???I7D 77II?????I7$N
+ $.II??I7$ N77IIII77Z
+ DI?I77777$O Z7777$O
+
# # ###### # #### #### # # ###### ##### ####
# # # # # # # # ## ## # # # #
# # ##### # # # # # ## # ##### # # #
@@ -14,12 +54,11 @@
# ##### #### #### # # ######
# # # # # ###### # #
# # # # # # # # # #
- ###### ###### # # #### # # # #
-
-
-
- "The miracle comes quietly into the mind that stops an instant and is still"
-
-
- For further info please consult: leksah.org
+ ###### ###### # # #### # # # # V.0.8
+ "The Miracle comes quietly into the mind that stops an instant and is still"
+ For further info please consult: leksah.org
+
+
+
+
1  leksah.cabal
View
@@ -23,6 +23,7 @@ data-files: LICENSE
data/keymap.lkshk
data/leksah.menu
data/prefs.lkshp
+ data/prefscoll.lkshp
data/emacs.lkshk
data/LICENSE
data/module.lksht
BIN  pics/leksah.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 src/IDE/Command.hs
View
@@ -82,7 +82,8 @@ import IDE.Pane.Workspace
import IDE.Pane.Variables (fillVariablesList)
import IDE.Pane.Trace (fillTraceList)
import IDE.PaneGroups
-import IDE.Pane.Search (setChoices, searchMetaGUI)
+import IDE.Pane.Search (getSearch, setChoices, searchMetaGUI)
+import IDE.Pane.Grep (getGrep)
--
-- | The Actions known to the system (they can be activated by keystrokes or menus)
@@ -311,7 +312,9 @@ mkActions =
,AD "ShowDebugger" "Debugger" Nothing Nothing
showDebugger [] False
,AD "ShowSearch" "Search" Nothing Nothing
- showSearchGroup [] False
+ (getSearch Nothing >>= \ p -> displayPane p False) [] False
+ ,AD "ShowGrep" "Grep" Nothing Nothing
+ (getGrep Nothing >>= \ p -> displayPane p False) [] False
,AD "ShowErrors" "Errors" Nothing Nothing
(getErrors Nothing >>= \ p -> displayPane p False) [] False
,AD "ShowLog" "Log" Nothing Nothing
@@ -525,7 +528,7 @@ textPopupMenu ideR menu = do
mbtext <- selectedText
case mbtext of
Just t -> searchMetaGUI t
- Nothing -> ideMessage Normal "Select a text first") ideR)
+ Nothing -> ideMessage Normal "Select a text first") ideR)
menuShellAppend menu mi3
let interpretingEntries = [castToWidget mi16]
let interpretingSelEntries = [castToWidget mi1, castToWidget mi11, castToWidget mi12,
@@ -536,8 +539,8 @@ textPopupMenu ideR menu = do
selected <- (reflectIDE selectedText ideR)
unless isInterpreting'
$ mapM_ (\w -> widgetSetSensitive w False) (interpretingEntries ++ interpretingSelEntries)
- unless (isJust selected)
- $ mapM_ (\w -> widgetSetSensitive w False) (otherEntries ++ interpretingSelEntries)
+-- unless (isJust selected)
+-- $ mapM_ (\w -> widgetSetSensitive w False) (otherEntries ++ interpretingSelEntries)
mapM_ widgetShow interpretingEntries
mapM_ widgetShow interpretingSelEntries
mapM_ widgetShow (castToWidget sep1 : castToWidget sep2 : otherEntries)
9 src/IDE/Core/Types.hs
View
@@ -343,11 +343,7 @@ data Prefs = Prefs {
, defaultPath :: PanePath
, categoryForPane :: [(String, String)]
, packageBlacklist :: [Dependency]
- , collectAfterBuild :: Bool
, collectAtStart :: Bool
- , sourceDirectories :: [FilePath]
- , unpackDirectory :: Maybe FilePath
- , retreiveURL :: Maybe String
, useCtrlTabFlipping :: Bool
, docuSearchURL :: String
, completeRestricted :: Bool
@@ -359,7 +355,12 @@ data Prefs = Prefs {
, breakOnException :: Bool
, breakOnError :: Bool
, printBindResult :: Bool
+ , serverIP :: String
+ -- As well used by server
, serverPort :: Int
+ , sourceDirectories :: [FilePath]
+ , unpackDirectory :: Maybe FilePath
+ , retreiveURL :: Maybe String
} deriving(Eq,Show)
data SearchHint = Forward | Backward | Insert | Delete | Initial
62 src/IDE/Leksah.hs
View
@@ -53,7 +53,7 @@ import IDE.Keymap
import IDE.Pane.SourceBuffer
import IDE.Find
import Graphics.UI.Editor.Composite (filesEditor, maybeEditor)
-import Graphics.UI.Editor.Simple (fileEditor)
+import Graphics.UI.Editor.Simple (fileEditor, intEditor, stringEditor)
import IDE.Metainfo.Provider (initInfo)
import IDE.Workspaces (backgroundMake)
import IDE.Utils.GUIUtils
@@ -61,6 +61,10 @@ import System.FilePath((</>))
import Network (withSocketsDo)
import Control.Exception
import System.Exit(exitFailure)
+import qualified IDE.StrippedPrefs as SP
+import IDE.Utils.Tool (runTool,toolline)
+import Debug.Trace
+import System.Process(waitForProcess)
#if defined(mingw32_HOST_OS) || defined(__MINGW32__)
#else
import qualified System.Posix as P
@@ -102,6 +106,7 @@ main = withSocketsDo $ handleExceptions $ do
args <- getArgs
(o,_) <- ideOpts args
+ isFirstStart <- liftM not hasConfigDir
let sessions = filter (\x -> case x of
SessionN _ -> True
_ -> False) o
@@ -109,14 +114,14 @@ main = withSocketsDo $ handleExceptions $ do
then (head $ map (\ (SessionN x) -> x) sessions) ++ leksahSessionFileExtension
else standardSessionFilename
when (elem VersionF o)
- (sysMessage Normal $ "Leksah an IDE for Haskell, version " ++ showVersion version)
+ (sysMessage Normal $ "Leksah the Haskell IDE, version " ++ showVersion version)
when (elem Help o)
- (sysMessage Normal $ "Leksah an IDE for Haskell, version " ++ usageInfo header options)
+ (sysMessage Normal $ "Leksah the Haskell IDE, version " ++ usageInfo header options)
dataDir <- getDataDir
prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
prefs <- readPrefs prefsPath
when (not (elem VersionF o) && not (elem Help o))
- (startGUI sessionFilename prefs)
+ (startGUI sessionFilename prefs isFirstStart)
handleExceptions inner =
catch inner (\(exception :: SomeException) -> do
@@ -127,8 +132,8 @@ handleExceptions inner =
-- ---------------------------------------------------------------------
-- | Start the GUI
-startGUI :: String -> Prefs -> IO ()
-startGUI sessionFilename iprefs = do
+startGUI :: String -> Prefs -> Bool -> IO ()
+startGUI sessionFilename iprefs isFirstStart = do
st <- unsafeInitGUIForThreadedRTS
when rtsSupportsBoundThreads
(sysMessage Normal "Linked with -threaded")
@@ -137,15 +142,14 @@ startGUI sessionFilename iprefs = do
initGtkRc
uiManager <- uiManagerNew
newIcons
- hasConfigDir' <- hasConfigDir
dataDir <- getDataDir
- (startupPrefs,isFirstStart) <- if hasConfigDir'
- then return (iprefs,False)
+ startupPrefs <- if not isFirstStart
+ then return iprefs
else do
firstStart iprefs
prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
prefs <- readPrefs prefsPath
- return (prefs,True)
+ return prefs
candyPath <- getConfigFilePathForLoad
(case sourceCandy startupPrefs of
Nothing -> standardCandyFilename
@@ -270,13 +274,23 @@ fDescription configPath = VFD emptyParams [
unpackDirectory
(\b a -> a{unpackDirectory = b})
(maybeEditor ((fileEditor (Just (configPath </> "packageSources")) FileChooserActionSelectFolder
- "Select folder for unpacking cabal packages"), emptyParams) True "Yes")]
+ "Select folder for unpacking cabal packages"), emptyParams) True "Yes")
+ , mkField
+ (paraName <<<- ParaName "Port number for server connection" $ emptyParams)
+ serverPort
+ (\b a -> a{serverPort = b})
+ (intEditor (1.0, 65535.0, 1.0))
+ , mkField
+ (paraName <<<- ParaName "Server IP address " $ emptyParams)
+ serverIP
+ (\b a -> a{serverIP = b})
+ (stringEditor (\ s -> not $ null s))]
--
--- | Called when leksah ist first called (the .leksah directory does not exist)
+-- | Called when leksah ist first called (the .leksah-xx directory does not exist)
--
firstStart :: Prefs -> IO ()
-firstStart prefs = do
+firstStart prefs = trace "firstStart" $ do
dataDir <- getDataDir
prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
prefs <- readPrefs prefsPath
@@ -288,10 +302,11 @@ firstStart prefs = do
cancel <- buttonNewFromStock "gtk-cancel"
boxPackStart bb ok PackNatural 0
boxPackStart bb cancel PackNatural 0
- label <- labelNew (Just ("Welcome to Leksah, an IDE for Haskell.\n" ++
+ label <- labelNew (Just ("Welcome to Leksah, the Haskell IDE.\n" ++
"At the first start, Leksah will collect metadata about your installed haskell packages.\n" ++
- "Select folders under which you have installed Haskell packages with sources below and click add.\n" ++
- "It may take some time before Leksah starts up."))
+ "You can add folders under which you have sources for Haskell packages not available from Hackage.\n" ++
+ "If you are not shure what to do, just keep the defaults \n" ++
+ "This process may take a long time, but it only needs to run one time."))
(widget, setInj, getExt,notifier)
<- buildEditor (fDescription configDir) prefs
ok `onClicked` (do
@@ -303,9 +318,15 @@ firstStart prefs = do
Just newPrefs -> do
fp <- getConfigFilePathForSave standardPreferencesFilename
writePrefs fp newPrefs
+ fp2 <- getConfigFilePathForSave strippedPreferencesFilename
+ SP.writeStrippedPrefs fp2
+ (SP.Prefs {SP.sourceDirectories = sourceDirectories newPrefs,
+ SP.unpackDirectory = unpackDirectory newPrefs,
+ SP.retreiveURL = retreiveURL newPrefs,
+ SP.serverPort = serverPort newPrefs})
widgetDestroy dialog
mainQuit
- --TODO firstBuild newPrefs
+ firstBuild newPrefs
)
cancel `onClicked` (do
widgetDestroy dialog
@@ -318,10 +339,15 @@ firstStart prefs = do
boxPackStart vb widget PackGrow 7
boxPackEnd vb bb PackNatural 7
containerAdd dialog vb
- widgetSetSizeRequest dialog 700 400
+ widgetSetSizeRequest dialog 1024 800
widgetShowAll dialog
mainGUI
return ()
+firstBuild newPrefs = do
+ (output, pid) <- runTool "leksah-server" ["-sbo"] Nothing
+ mapM_ (putStrLn . toolline) output
+ waitForProcess pid
+ return ()
2  src/IDE/Pane/Modules.hs
View
@@ -241,7 +241,7 @@ instance RecoverablePane IDEModules ModulesState IDEM where
panedAdd1 pane' sw
panedAdd2 pane' sw2
(x,y) <- widgetGetSize nb
- panedSetPosition pane' (x `quot` 2)
+ panedSetPosition pane' (max 200 (x `quot` 2))
box <- hBoxNew True 2
rb1 <- radioButtonNewWithLabel "Package"
rb2 <- radioButtonNewWithLabelFromWidget rb1 "Workspace"
35 src/IDE/Pane/Preferences.hs
View
@@ -61,6 +61,8 @@ import Graphics.UI.Gtk.SourceView
import System.Time (getClockTime)
import System.FilePath((</>))
import qualified IDE.StrippedPrefs as SP
+import Control.Exception(SomeException,catch)
+import Prelude hiding(catch)
-- ---------------------------------------------------------------------
-- This needs to be incremented, when the preferences format changes
@@ -135,9 +137,10 @@ instance RecoverablePane IDEPrefs PrefsState IDEM where
writePrefs fp newPrefs
fp2 <- getConfigFilePathForSave strippedPreferencesFilename
SP.writeStrippedPrefs fp2
- (SP.Prefs (sourceDirectories newPrefs)
- (unpackDirectory newPrefs)
- (retreiveURL newPrefs))
+ (SP.Prefs {SP.sourceDirectories = sourceDirectories newPrefs,
+ SP.unpackDirectory = unpackDirectory newPrefs,
+ SP.retreiveURL = retreiveURL newPrefs,
+ SP.serverPort = serverPort newPrefs})
reflectIDE (modifyIDE_ (\ide -> ide{prefs = newPrefs})) ideR )
closeB `onClicked` (reflectIDE (closePane prefsPane >> return ()) ideR )
registerEvent notifier FocusIn (Left (\e -> do
@@ -460,14 +463,6 @@ prefsDescription configDir packages = NFDPP [
boolEditor
(\i -> return ())
, mkFieldPP
- (paraName <<<- ParaName "Update metadata after every build" $ emptyParams)
- (PP.text . show)
- boolParser
- collectAfterBuild
- (\b a -> a{collectAfterBuild = b})
- boolEditor
- (\i -> return ())
- , mkFieldPP
(paraName <<<- ParaName "Port number for server connection" $ emptyParams)
(PP.text . show)
intParser
@@ -475,6 +470,14 @@ prefsDescription configDir packages = NFDPP [
(\b a -> a{serverPort = b})
(intEditor (1.0, 65535.0, 1.0))
(\i -> return ())
+ , mkFieldPP
+ (paraName <<<- ParaName "Server IP address " $ emptyParams)
+ (PP.text . show)
+ stringParser
+ serverIP
+ (\b a -> a{serverIP = b})
+ (stringEditor (\ s -> not $ null s))
+ (\i -> return ())
]),
("Blacklist", VFDPP emptyParams [
mkFieldPP
@@ -630,7 +633,6 @@ defaultPrefs = Prefs {
, ("*Prefs","ToolCategory")
, ("*References","ToolCategory")
, ("*Search","ToolCategory")]
- , collectAfterBuild = False
, collectAtStart = True
, unpackDirectory = Nothing
, retreiveURL = Just "http://www.leksah.org"
@@ -651,6 +653,7 @@ defaultPrefs = Prefs {
, breakOnError = True
, printBindResult = False
, serverPort = 11111
+ , serverIP = "127.0.0.1"
}
-- ------------------------------------------------------------
@@ -658,10 +661,12 @@ defaultPrefs = Prefs {
-- ------------------------------------------------------------
readPrefs :: FilePath -> IO Prefs
-readPrefs fn = do
+readPrefs fn = catch (do
configDir <- getConfigDir
- readFields fn (flattenFieldDescriptionPPToS (prefsDescription configDir [])) defaultPrefs
-
+ readFields fn (flattenFieldDescriptionPPToS (prefsDescription configDir [])) defaultPrefs)
+ (\ (e :: SomeException) -> do
+ sysMessage Normal (show e)
+ return defaultPrefs)
-- ------------------------------------------------------------
-- * Printing
-- ------------------------------------------------------------
48 src/IDE/PaneGroups.hs
View
@@ -18,7 +18,6 @@ module IDE.PaneGroups (
showBrowser
, setSensitivityDebugger
, showDebugger
-, showSearchGroup
) where
@@ -47,8 +46,6 @@ import IDE.Pane.SourceBuffer
import IDE.Pane.Breakpoints (IDEBreakpoints(..))
import IDE.Pane.Variables (IDEVariables(..))
import IDE.Pane.Trace (IDETrace(..))
-import IDE.Pane.Search (IDESearch(..))
-import IDE.Pane.Grep (IDEGrep(..))
showBrowser :: IDEAction
showBrowser = do
@@ -103,60 +100,29 @@ showDebugger = do
case ret of
(Just rpp, True) -> do
viewSplit' rpp Horizontal
- viewSplit' (rpp ++ [SplitP TopP]) Horizontal
let lowerP = rpp ++ [SplitP BottomP]
- let middleP = rpp ++ [SplitP TopP,SplitP BottomP]
- let upperP = rpp ++ [SplitP TopP,SplitP TopP]
+ let upperP = rpp ++ [SplitP TopP]
lower <- getNotebook lowerP
- middle <- getNotebook middleP
upper <- getNotebook upperP
liftIO $ do
notebookSetTabPos lower PosTop
- notebookSetTabPos middle PosTop
notebookSetTabPos upper PosTop
notebookSetShowTabs upper False
- getOrBuildPane (Left middleP) :: IDEM (Maybe IDEBreakpoints)
- getOrBuildPane (Left middleP) :: IDEM (Maybe IDEVariables)
+ getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEBreakpoints)
+ getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEVariables)
getOrBuildPane (Left lowerP) :: IDEM (Maybe IDETrace)
when (null $ filter (\b -> bufferName b == "_Eval.hs") bufs) $
newTextBuffer upperP "_Eval.hs" Nothing >> return ()
return ()
(Just rpp, False) -> do
let lowerP = getBestPanePath (rpp ++ [SplitP BottomP]) layout'
- let middleP = getBestPanePath (rpp ++ [SplitP TopP,SplitP BottomP]) layout'
- let upperP = getBestPanePath (rpp ++ [SplitP TopP,SplitP TopP]) layout'
- getOrBuildPane (Left middleP) :: IDEM (Maybe IDEBreakpoints)
- getOrBuildPane (Left middleP) :: IDEM (Maybe IDEVariables)
+ let upperP = getBestPanePath (rpp ++ [SplitP TopP]) layout'
+ getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEBreakpoints)
+ getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEVariables)
getOrBuildPane (Left lowerP) :: IDEM (Maybe IDETrace)
when (null $ filter (\b -> bufferName b == "_Eval.hs") bufs) $
newTextBuffer upperP "_Eval.hs" Nothing >> return ()
return ()
_ -> return ()
-showSearchGroup :: IDEAction
-showSearchGroup = do
- pp <- panePathForGroup "*Search"
- ret <- newGroupOrBringToFront "Search" pp
- layout' <- liftM layout (readIDE frameState)
- case ret of
- (Just rpp, True) -> do
- viewSplit' rpp Horizontal
- let lowerP = rpp ++ [SplitP BottomP]
- let upperP = rpp ++ [SplitP TopP]
- lower <- getNotebook lowerP
- upper <- getNotebook upperP
- liftIO $ do
- notebookSetTabPos lower PosTop
- notebookSetTabPos upper PosTop
- notebookSetShowTabs upper False
- notebookSetShowTabs lower False
- getOrBuildPane (Left upperP) :: IDEM (Maybe IDESearch)
- getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEGrep)
- return ()
- (Just rpp, False) -> do
- let lowerP = getBestPanePath (rpp ++ [SplitP BottomP]) layout'
- let upperP = getBestPanePath (rpp ++ [SplitP TopP]) layout'
- getOrBuildPane (Left upperP) :: IDEM (Maybe IDESearch)
- getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEGrep)
- return ()
- _ -> return ()
+
25 src/IDE/Utils/ServerConnection.hs
View
@@ -45,14 +45,16 @@ doServerCommand command cont = do
doServerCommand command cont
Nothing -> do
prefs' <- readIDE prefs
- handle <- liftIO $ do
- catch (connectTo "localhost" (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
+ handle <- reifyIDE $ \ideR -> do
+ catch (connectTo (serverIP prefs') (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
(\(exc :: SomeException) -> do
catch (startServer (serverPort prefs'))
(\(exc :: SomeException) -> throwIDE ("Can't start leksah-server" ++ show exc))
- threadDelay 5000000 -- in microseconds, so five seconds to start
- catch (connectTo "localhost" (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
- (\(exc :: SomeException) -> throwIDE ("Can't connect to leksah-server" ++ show exc)))
+ mbHandle <- waitForServer prefs' 100
+ case mbHandle of
+ Just handle -> return handle
+ Nothing -> throwIDE ("Can't connect to leksah-server"))
+ modifyIDE_ (\ ide -> ide{server = Just handle})
doCommand handle
return ()
where
@@ -74,3 +76,16 @@ startServer port = do
runCommand ("leksah-server --server=" ++ show port ++ " +RTS -N2 -RTS")
return ()
+-- | s is in tenth's of seconds
+waitForServer :: Prefs -> Int -> IO (Maybe Handle)
+waitForServer _ 0 = return Nothing
+waitForServer prefs s = do
+ threadDelay 100000 -- 0.1 second
+ catch (do
+ handle <- liftIO $ connectTo (serverIP prefs) (PortNumber(PortNum (fromIntegral $ serverPort prefs)))
+ return (Just handle))
+ (\(exc :: SomeException) -> waitForServer prefs (s-1))
+
+
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.