Skip to content
This repository
Browse code

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
... ... @@ -1,14 +1,16 @@
1 1 Version of session file format:
2 2 1
3 3 Time of storage:
4   - "Fri Oct 30 16:53:02 CET 2009"
5   -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
6   -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])]
7   -Window size: (1412,995)
  4 + "Fri Feb 26 17:11:46 CET 2010"
  5 +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
  6 +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])]
  7 +Window size: (1643,1030)
8 8 Workspace: Nothing
9   -Active pane: Just "_Eval.hs"
  9 +Active pane: Nothing
10 10 Toolbar visible:
11 11 True
12   -FindbarState: (False,FindState {entryStr = "ints", entryHist = [], replaceStr = "", replaceHist = [], caseSensitive = False, entireWord = False, wrapAround = True, regex = False, lineNr = 1})
  12 +FindbarState: (True,FindState {entryStr = "", entryHist = [], replaceStr = "", replaceHist = [], caseSensitive = False, entireWord = False, wrapAround = False, regex = False, lineNr = 1})
13 13 Recently opened files:
14   - []
  14 + ["/home/jutaro/.cabal/share/leksah-0.7/data/welcome.txt"]
  15 +Recently opened workspaces:
  16 + []
4 data/keymap.lkshk
@@ -79,7 +79,7 @@ F3 -> EditFindNext "Find the next occurenc
79 79 <ctrl>j -> NextError
80 80 <ctrl><shift>j -> PreviousError
81 81
82   -<ctrl>m -> ShowModules
  82 +<ctrl>o -> ShowModules
83 83
84 84
85 85 --<ctrl>i -> ShowInterface
@@ -106,5 +106,7 @@ F8 -> DebugStepModule
106 106 F9 -> DebugContinue
107 107
108 108 <ctrl>Return -> ExecuteSelection
  109 +<ctrl>m -> UpdateMetadataCurrent
  110 +
109 111
110 112
1  data/leksah.menu
@@ -93,6 +93,7 @@
93 93 <menuitem name="_Browser" action="ShowBrowser" />
94 94 <menuitem name="_Debugger" action="ShowDebugger" />
95 95 <menuitem name="_Errors" action="ShowErrors" />
  96 + <menuitem name="_Grep" action="ShowGrep" />
96 97 <menuitem name="_Log" action="ShowLog" />
97 98 <menuitem name="_References" action="ShowReferences" />
98 99 <menuitem name="_Search" action="ShowSearch" />
30 data/prefs.lkshp
@@ -2,12 +2,12 @@ Version number of preferences file format:
2 2 1
3 3 --Integer
4 4 Time of last storage:
5   - "Thu Jan 28 13:31:43 Westeurop\228ische Normalzeit 2010"
  5 + "Fri Feb 26 16:43:57 CET 2010"
6 6 Show line numbers:
7 7 True
8 8 --(True/False)
9   -TextView Font: "Monospace 9"
10   -Right margin: 110
  9 +TextView Font: "Monospace 10"
  10 +Right margin: 100
11 11 --Size or 0 for no right margin
12 12 Tab width: 4
13 13 Use standard line ends even on windows:
@@ -16,7 +16,7 @@ Remove trailing blanks when saving a file:
16 16 True
17 17 Source candy: "candy"
18 18 --Empty for do not use or the name of a candy file in a config dir
19   -Editor Style: "kate"
  19 +Editor Style: ""
20 20 Found Text Background:
21 21 Color 65535 65535 32768
22 22 Execution Context Text Background:
@@ -25,11 +25,11 @@ Breakpoint Text Background:
25 25 Color 65535 49152 32768
26 26 Use Yi - Experimental feature (could wipe your files):
27 27 False
28   -LogView Font: "Sans 10"
  28 +LogView Font: "Sans 12"
29 29 Window default size:
30   - (800,800)
  30 + (1024,800)
31 31 --Default size of the main ide window specified as pair (int,int)
32   -Use ctrl Tab for Notebook flipper:
  32 +Use ctrl Tab for Notebook flipper:
33 33 True
34 34 Complete only on Hotkey:
35 35 False
@@ -37,23 +37,25 @@ Name of the keymap:
37 37 keymap
38 38 --The name of a keymap file in a config dir
39 39 Categories for panes:
40   - [("*ClassHierarchy","TreeCategory"),("*Debug","TreeCategory"),("*Grep","TreeCategory"),("*Info","LogCategory"),("*Log","LogCategory"),("*Modules","TreeCategory"),("*Package","DialogCategory"),("*Flags","DialogCategory"),("*Prefs","DialogCategory"),("*References","LogCategory"),("*Search","TreeCategory"),("*Errors","TreeCategory")]
  40 + [("*Debug","ToolCategory"),("*Grep","ToolCategory"),("*Log","LogCategory"),("*Search","ToolCategory"),("*Browser","ToolCategory"),("*Package","EditorCategory"),("*Flags","EditorCategory"),("*References","LogCategory"),("*Workspace","LogCategory"),("*Errors","ToolCategory")]
41 41 Pane path for category:
42   - [("EditorCategory",[SplitP LeftP]),("TreeCategory",[SplitP RightP,SplitP TopP]),("LogCategory",[SplitP RightP,SplitP BottomP]),("DialogCategory",[SplitP LeftP])]
  42 + [("EditorCategory",[SplitP LeftP]),("ToolCategory",[SplitP RightP,SplitP TopP]),("LogCategory",[SplitP RightP,SplitP BottomP])]
43 43 Default pane path:
44 44 [SplitP LeftP]
45 45 Paths under which haskell sources for packages may be found:
46   - ["~/Develop"]
  46 + []
47 47 Maybe a directory for unpacking cabal packages:
48   - Just "~/Haskell"
  48 + Just "~/.leksah-0.7/packageSources"
  49 +Maybe an URL to load prebuild metadata :
  50 + Just "http://www.leksah.org"
49 51 Update metadata at startup:
50 52 True
51   -Update metadata after every build:
52   - True
53 53 Port number for server connection:
54 54 11111
  55 +Server IP address :
  56 + "127.0.0.1"
55 57 Packages which are excluded from the modules pane:
56   - [Dependency (PackageName "base") (EarlierVersion (Version {versionBranch = [4,0,0,0], versionTags = []})),Dependency (PackageName "ghc") AnyVersion,Dependency (PackageName "haskell98") AnyVersion]
  58 + [Dependency (PackageName "ghc") AnyVersion]
57 59 Automatically save all files before building:
58 60 True
59 61 Background build:
8 data/prefscoll.lkshp
... ... @@ -0,0 +1,8 @@
  1 +Paths under which haskell sources for packages may be found:
  2 + []
  3 +Maybe a directory for unpacking cabal packages:
  4 + Just "~/.leksah-0.7/packageSources"
  5 +Maybe an URL to load prebuild metadata :
  6 + Just "http://www.leksah.org"
  7 +Port number for server connection:
  8 + 11111
61 data/welcome.txt
... ... @@ -1,6 +1,46 @@
1   -
2   -
3   -
  1 +
  2 + $=,:Z D7,,,,,,:7$Z
  3 + $......,= +.....,+$
  4 + =...,~:..,+D D:~~::~=$
  5 + O~.=????????..O 8III?II$Z
  6 + :.I??????????~:N 77I??778
  7 + ??7777777II????+?8 877??I$O
  8 + O:$$$ZDNDZ$77I??I:= I7I?I$D
  9 + Z?$D $77I?II7 87II77O
  10 + $$ 77III:$ DIIII7$
  11 + $N O7II7=D ?7II7Z
  12 + $D $77I77 87II7$
  13 + Z$II7Z 8I7I7$N
  14 + $777?D IIII$N
  15 + $777+ O7777Z
  16 + D$77$O I7I77
  17 + Z$III?Z Z777$D
  18 + $7III7? DI777D
  19 + $7777777Z I77$$
  20 + O?77$8$77I 8777$N
  21 + ?777D D77$$ O?77$N
  22 + Z77$7 $$7IO I777$
  23 + N+77$8 N$77? Z777$
  24 + $777O D$7$$ I777$
  25 + 7?77$ $77+.777O
  26 + N=77$O D$7I=I7$
  27 + 8+77$8 $7III$O
  28 + ?I777 N$7I7$
  29 + Z7I778 N7777$
  30 + N~II7$ $777$
  31 + 8I7I7$D $7I7:Z
  32 + I~I77O N7II=,N Z
  33 + $III7$ $7II7,N $
  34 + $:II7$8 $7II~~Z O7N
  35 + O~7II78 D$7I?:.=8 ~$$
  36 + ~III7$ O77??=..? N?,,$
  37 + O~I??7$D $7I???:.........,7
  38 + N,~I?I77 O7I???=,.....,+$N
  39 + $,II?I7$D $7I????????I7$8
  40 + O,:???I7D 77II?????I7$N
  41 + $.II??I7$ N77IIII77Z
  42 + DI?I77777$O Z7777$O
  43 +
4 44 # # ###### # #### #### # # ###### ##### ####
5 45 # # # # # # # # ## ## # # # #
6 46 # # ##### # # # # # ## # ##### # # #
@@ -14,12 +54,11 @@
14 54 # ##### #### #### # # ######
15 55 # # # # # ###### # #
16 56 # # # # # # # # # #
17   - ###### ###### # # #### # # # #
18   -
19   -
20   -
21   - "The miracle comes quietly into the mind that stops an instant and is still"
22   -
23   -
24   - For further info please consult: leksah.org
  57 + ###### ###### # # #### # # # # V.0.8
25 58
  59 + "The Miracle comes quietly into the mind that stops an instant and is still"
  60 + For further info please consult: leksah.org
  61 +
  62 +
  63 +
  64 +
1  leksah.cabal
@@ -23,6 +23,7 @@ data-files: LICENSE
23 23 data/keymap.lkshk
24 24 data/leksah.menu
25 25 data/prefs.lkshp
  26 + data/prefscoll.lkshp
26 27 data/emacs.lkshk
27 28 data/LICENSE
28 29 data/module.lksht
BIN  pics/leksah.png
13 src/IDE/Command.hs
@@ -82,7 +82,8 @@ import IDE.Pane.Workspace
82 82 import IDE.Pane.Variables (fillVariablesList)
83 83 import IDE.Pane.Trace (fillTraceList)
84 84 import IDE.PaneGroups
85   -import IDE.Pane.Search (setChoices, searchMetaGUI)
  85 +import IDE.Pane.Search (getSearch, setChoices, searchMetaGUI)
  86 +import IDE.Pane.Grep (getGrep)
86 87
87 88 --
88 89 -- | The Actions known to the system (they can be activated by keystrokes or menus)
@@ -311,7 +312,9 @@ mkActions =
311 312 ,AD "ShowDebugger" "Debugger" Nothing Nothing
312 313 showDebugger [] False
313 314 ,AD "ShowSearch" "Search" Nothing Nothing
314   - showSearchGroup [] False
  315 + (getSearch Nothing >>= \ p -> displayPane p False) [] False
  316 + ,AD "ShowGrep" "Grep" Nothing Nothing
  317 + (getGrep Nothing >>= \ p -> displayPane p False) [] False
315 318 ,AD "ShowErrors" "Errors" Nothing Nothing
316 319 (getErrors Nothing >>= \ p -> displayPane p False) [] False
317 320 ,AD "ShowLog" "Log" Nothing Nothing
@@ -525,7 +528,7 @@ textPopupMenu ideR menu = do
525 528 mbtext <- selectedText
526 529 case mbtext of
527 530 Just t -> searchMetaGUI t
528   - Nothing -> ideMessage Normal "Select a text first") ideR)
  531 + Nothing -> ideMessage Normal "Select a text first") ideR)
529 532 menuShellAppend menu mi3
530 533 let interpretingEntries = [castToWidget mi16]
531 534 let interpretingSelEntries = [castToWidget mi1, castToWidget mi11, castToWidget mi12,
@@ -536,8 +539,8 @@ textPopupMenu ideR menu = do
536 539 selected <- (reflectIDE selectedText ideR)
537 540 unless isInterpreting'
538 541 $ mapM_ (\w -> widgetSetSensitive w False) (interpretingEntries ++ interpretingSelEntries)
539   - unless (isJust selected)
540   - $ mapM_ (\w -> widgetSetSensitive w False) (otherEntries ++ interpretingSelEntries)
  542 +-- unless (isJust selected)
  543 +-- $ mapM_ (\w -> widgetSetSensitive w False) (otherEntries ++ interpretingSelEntries)
541 544 mapM_ widgetShow interpretingEntries
542 545 mapM_ widgetShow interpretingSelEntries
543 546 mapM_ widgetShow (castToWidget sep1 : castToWidget sep2 : otherEntries)
9 src/IDE/Core/Types.hs
@@ -343,11 +343,7 @@ data Prefs = Prefs {
343 343 , defaultPath :: PanePath
344 344 , categoryForPane :: [(String, String)]
345 345 , packageBlacklist :: [Dependency]
346   - , collectAfterBuild :: Bool
347 346 , collectAtStart :: Bool
348   - , sourceDirectories :: [FilePath]
349   - , unpackDirectory :: Maybe FilePath
350   - , retreiveURL :: Maybe String
351 347 , useCtrlTabFlipping :: Bool
352 348 , docuSearchURL :: String
353 349 , completeRestricted :: Bool
@@ -359,7 +355,12 @@ data Prefs = Prefs {
359 355 , breakOnException :: Bool
360 356 , breakOnError :: Bool
361 357 , printBindResult :: Bool
  358 + , serverIP :: String
  359 + -- As well used by server
362 360 , serverPort :: Int
  361 + , sourceDirectories :: [FilePath]
  362 + , unpackDirectory :: Maybe FilePath
  363 + , retreiveURL :: Maybe String
363 364 } deriving(Eq,Show)
364 365
365 366 data SearchHint = Forward | Backward | Insert | Delete | Initial
62 src/IDE/Leksah.hs
@@ -53,7 +53,7 @@ import IDE.Keymap
53 53 import IDE.Pane.SourceBuffer
54 54 import IDE.Find
55 55 import Graphics.UI.Editor.Composite (filesEditor, maybeEditor)
56   -import Graphics.UI.Editor.Simple (fileEditor)
  56 +import Graphics.UI.Editor.Simple (fileEditor, intEditor, stringEditor)
57 57 import IDE.Metainfo.Provider (initInfo)
58 58 import IDE.Workspaces (backgroundMake)
59 59 import IDE.Utils.GUIUtils
@@ -61,6 +61,10 @@ import System.FilePath((</>))
61 61 import Network (withSocketsDo)
62 62 import Control.Exception
63 63 import System.Exit(exitFailure)
  64 +import qualified IDE.StrippedPrefs as SP
  65 +import IDE.Utils.Tool (runTool,toolline)
  66 +import Debug.Trace
  67 +import System.Process(waitForProcess)
64 68 #if defined(mingw32_HOST_OS) || defined(__MINGW32__)
65 69 #else
66 70 import qualified System.Posix as P
@@ -102,6 +106,7 @@ main = withSocketsDo $ handleExceptions $ do
102 106 args <- getArgs
103 107
104 108 (o,_) <- ideOpts args
  109 + isFirstStart <- liftM not hasConfigDir
105 110 let sessions = filter (\x -> case x of
106 111 SessionN _ -> True
107 112 _ -> False) o
@@ -109,14 +114,14 @@ main = withSocketsDo $ handleExceptions $ do
109 114 then (head $ map (\ (SessionN x) -> x) sessions) ++ leksahSessionFileExtension
110 115 else standardSessionFilename
111 116 when (elem VersionF o)
112   - (sysMessage Normal $ "Leksah an IDE for Haskell, version " ++ showVersion version)
  117 + (sysMessage Normal $ "Leksah the Haskell IDE, version " ++ showVersion version)
113 118 when (elem Help o)
114   - (sysMessage Normal $ "Leksah an IDE for Haskell, version " ++ usageInfo header options)
  119 + (sysMessage Normal $ "Leksah the Haskell IDE, version " ++ usageInfo header options)
115 120 dataDir <- getDataDir
116 121 prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
117 122 prefs <- readPrefs prefsPath
118 123 when (not (elem VersionF o) && not (elem Help o))
119   - (startGUI sessionFilename prefs)
  124 + (startGUI sessionFilename prefs isFirstStart)
120 125
121 126 handleExceptions inner =
122 127 catch inner (\(exception :: SomeException) -> do
@@ -127,8 +132,8 @@ handleExceptions inner =
127 132 -- ---------------------------------------------------------------------
128 133 -- | Start the GUI
129 134
130   -startGUI :: String -> Prefs -> IO ()
131   -startGUI sessionFilename iprefs = do
  135 +startGUI :: String -> Prefs -> Bool -> IO ()
  136 +startGUI sessionFilename iprefs isFirstStart = do
132 137 st <- unsafeInitGUIForThreadedRTS
133 138 when rtsSupportsBoundThreads
134 139 (sysMessage Normal "Linked with -threaded")
@@ -137,15 +142,14 @@ startGUI sessionFilename iprefs = do
137 142 initGtkRc
138 143 uiManager <- uiManagerNew
139 144 newIcons
140   - hasConfigDir' <- hasConfigDir
141 145 dataDir <- getDataDir
142   - (startupPrefs,isFirstStart) <- if hasConfigDir'
143   - then return (iprefs,False)
  146 + startupPrefs <- if not isFirstStart
  147 + then return iprefs
144 148 else do
145 149 firstStart iprefs
146 150 prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
147 151 prefs <- readPrefs prefsPath
148   - return (prefs,True)
  152 + return prefs
149 153 candyPath <- getConfigFilePathForLoad
150 154 (case sourceCandy startupPrefs of
151 155 Nothing -> standardCandyFilename
@@ -270,13 +274,23 @@ fDescription configPath = VFD emptyParams [
270 274 unpackDirectory
271 275 (\b a -> a{unpackDirectory = b})
272 276 (maybeEditor ((fileEditor (Just (configPath </> "packageSources")) FileChooserActionSelectFolder
273   - "Select folder for unpacking cabal packages"), emptyParams) True "Yes")]
  277 + "Select folder for unpacking cabal packages"), emptyParams) True "Yes")
  278 + , mkField
  279 + (paraName <<<- ParaName "Port number for server connection" $ emptyParams)
  280 + serverPort
  281 + (\b a -> a{serverPort = b})
  282 + (intEditor (1.0, 65535.0, 1.0))
  283 + , mkField
  284 + (paraName <<<- ParaName "Server IP address " $ emptyParams)
  285 + serverIP
  286 + (\b a -> a{serverIP = b})
  287 + (stringEditor (\ s -> not $ null s))]
274 288
275 289 --
276   --- | Called when leksah ist first called (the .leksah directory does not exist)
  290 +-- | Called when leksah ist first called (the .leksah-xx directory does not exist)
277 291 --
278 292 firstStart :: Prefs -> IO ()
279   -firstStart prefs = do
  293 +firstStart prefs = trace "firstStart" $ do
280 294 dataDir <- getDataDir
281 295 prefsPath <- getConfigFilePathForLoad standardPreferencesFilename Nothing dataDir
282 296 prefs <- readPrefs prefsPath
@@ -288,10 +302,11 @@ firstStart prefs = do
288 302 cancel <- buttonNewFromStock "gtk-cancel"
289 303 boxPackStart bb ok PackNatural 0
290 304 boxPackStart bb cancel PackNatural 0
291   - label <- labelNew (Just ("Welcome to Leksah, an IDE for Haskell.\n" ++
  305 + label <- labelNew (Just ("Welcome to Leksah, the Haskell IDE.\n" ++
292 306 "At the first start, Leksah will collect metadata about your installed haskell packages.\n" ++
293   - "Select folders under which you have installed Haskell packages with sources below and click add.\n" ++
294   - "It may take some time before Leksah starts up."))
  307 + "You can add folders under which you have sources for Haskell packages not available from Hackage.\n" ++
  308 + "If you are not shure what to do, just keep the defaults \n" ++
  309 + "This process may take a long time, but it only needs to run one time."))
295 310 (widget, setInj, getExt,notifier)
296 311 <- buildEditor (fDescription configDir) prefs
297 312 ok `onClicked` (do
@@ -303,9 +318,15 @@ firstStart prefs = do
303 318 Just newPrefs -> do
304 319 fp <- getConfigFilePathForSave standardPreferencesFilename
305 320 writePrefs fp newPrefs
  321 + fp2 <- getConfigFilePathForSave strippedPreferencesFilename
  322 + SP.writeStrippedPrefs fp2
  323 + (SP.Prefs {SP.sourceDirectories = sourceDirectories newPrefs,
  324 + SP.unpackDirectory = unpackDirectory newPrefs,
  325 + SP.retreiveURL = retreiveURL newPrefs,
  326 + SP.serverPort = serverPort newPrefs})
306 327 widgetDestroy dialog
307 328 mainQuit
308   - --TODO firstBuild newPrefs
  329 + firstBuild newPrefs
309 330 )
310 331 cancel `onClicked` (do
311 332 widgetDestroy dialog
@@ -318,10 +339,15 @@ firstStart prefs = do
318 339 boxPackStart vb widget PackGrow 7
319 340 boxPackEnd vb bb PackNatural 7
320 341 containerAdd dialog vb
321   - widgetSetSizeRequest dialog 700 400
  342 + widgetSetSizeRequest dialog 1024 800
322 343 widgetShowAll dialog
323 344 mainGUI
324 345 return ()
325 346
  347 +firstBuild newPrefs = do
  348 + (output, pid) <- runTool "leksah-server" ["-sbo"] Nothing
  349 + mapM_ (putStrLn . toolline) output
  350 + waitForProcess pid
  351 + return ()
326 352
327 353
2  src/IDE/Pane/Modules.hs
@@ -241,7 +241,7 @@ instance RecoverablePane IDEModules ModulesState IDEM where
241 241 panedAdd1 pane' sw
242 242 panedAdd2 pane' sw2
243 243 (x,y) <- widgetGetSize nb
244   - panedSetPosition pane' (x `quot` 2)
  244 + panedSetPosition pane' (max 200 (x `quot` 2))
245 245 box <- hBoxNew True 2
246 246 rb1 <- radioButtonNewWithLabel "Package"
247 247 rb2 <- radioButtonNewWithLabelFromWidget rb1 "Workspace"
35 src/IDE/Pane/Preferences.hs
@@ -61,6 +61,8 @@ import Graphics.UI.Gtk.SourceView
61 61 import System.Time (getClockTime)
62 62 import System.FilePath((</>))
63 63 import qualified IDE.StrippedPrefs as SP
  64 +import Control.Exception(SomeException,catch)
  65 +import Prelude hiding(catch)
64 66
65 67 -- ---------------------------------------------------------------------
66 68 -- This needs to be incremented, when the preferences format changes
@@ -135,9 +137,10 @@ instance RecoverablePane IDEPrefs PrefsState IDEM where
135 137 writePrefs fp newPrefs
136 138 fp2 <- getConfigFilePathForSave strippedPreferencesFilename
137 139 SP.writeStrippedPrefs fp2
138   - (SP.Prefs (sourceDirectories newPrefs)
139   - (unpackDirectory newPrefs)
140   - (retreiveURL newPrefs))
  140 + (SP.Prefs {SP.sourceDirectories = sourceDirectories newPrefs,
  141 + SP.unpackDirectory = unpackDirectory newPrefs,
  142 + SP.retreiveURL = retreiveURL newPrefs,
  143 + SP.serverPort = serverPort newPrefs})
141 144 reflectIDE (modifyIDE_ (\ide -> ide{prefs = newPrefs})) ideR )
142 145 closeB `onClicked` (reflectIDE (closePane prefsPane >> return ()) ideR )
143 146 registerEvent notifier FocusIn (Left (\e -> do
@@ -460,14 +463,6 @@ prefsDescription configDir packages = NFDPP [
460 463 boolEditor
461 464 (\i -> return ())
462 465 , mkFieldPP
463   - (paraName <<<- ParaName "Update metadata after every build" $ emptyParams)
464   - (PP.text . show)
465   - boolParser
466   - collectAfterBuild
467   - (\b a -> a{collectAfterBuild = b})
468   - boolEditor
469   - (\i -> return ())
470   - , mkFieldPP
471 466 (paraName <<<- ParaName "Port number for server connection" $ emptyParams)
472 467 (PP.text . show)
473 468 intParser
@@ -475,6 +470,14 @@ prefsDescription configDir packages = NFDPP [
475 470 (\b a -> a{serverPort = b})
476 471 (intEditor (1.0, 65535.0, 1.0))
477 472 (\i -> return ())
  473 + , mkFieldPP
  474 + (paraName <<<- ParaName "Server IP address " $ emptyParams)
  475 + (PP.text . show)
  476 + stringParser
  477 + serverIP
  478 + (\b a -> a{serverIP = b})
  479 + (stringEditor (\ s -> not $ null s))
  480 + (\i -> return ())
478 481 ]),
479 482 ("Blacklist", VFDPP emptyParams [
480 483 mkFieldPP
@@ -630,7 +633,6 @@ defaultPrefs = Prefs {
630 633 , ("*Prefs","ToolCategory")
631 634 , ("*References","ToolCategory")
632 635 , ("*Search","ToolCategory")]
633   - , collectAfterBuild = False
634 636 , collectAtStart = True
635 637 , unpackDirectory = Nothing
636 638 , retreiveURL = Just "http://www.leksah.org"
@@ -651,6 +653,7 @@ defaultPrefs = Prefs {
651 653 , breakOnError = True
652 654 , printBindResult = False
653 655 , serverPort = 11111
  656 + , serverIP = "127.0.0.1"
654 657 }
655 658
656 659 -- ------------------------------------------------------------
@@ -658,10 +661,12 @@ defaultPrefs = Prefs {
658 661 -- ------------------------------------------------------------
659 662
660 663 readPrefs :: FilePath -> IO Prefs
661   -readPrefs fn = do
  664 +readPrefs fn = catch (do
662 665 configDir <- getConfigDir
663   - readFields fn (flattenFieldDescriptionPPToS (prefsDescription configDir [])) defaultPrefs
664   -
  666 + readFields fn (flattenFieldDescriptionPPToS (prefsDescription configDir [])) defaultPrefs)
  667 + (\ (e :: SomeException) -> do
  668 + sysMessage Normal (show e)
  669 + return defaultPrefs)
665 670 -- ------------------------------------------------------------
666 671 -- * Printing
667 672 -- ------------------------------------------------------------
48 src/IDE/PaneGroups.hs
@@ -18,7 +18,6 @@ module IDE.PaneGroups (
18 18 showBrowser
19 19 , setSensitivityDebugger
20 20 , showDebugger
21   -, showSearchGroup
22 21
23 22 ) where
24 23
@@ -47,8 +46,6 @@ import IDE.Pane.SourceBuffer
47 46 import IDE.Pane.Breakpoints (IDEBreakpoints(..))
48 47 import IDE.Pane.Variables (IDEVariables(..))
49 48 import IDE.Pane.Trace (IDETrace(..))
50   -import IDE.Pane.Search (IDESearch(..))
51   -import IDE.Pane.Grep (IDEGrep(..))
52 49
53 50 showBrowser :: IDEAction
54 51 showBrowser = do
@@ -103,60 +100,29 @@ showDebugger = do
103 100 case ret of
104 101 (Just rpp, True) -> do
105 102 viewSplit' rpp Horizontal
106   - viewSplit' (rpp ++ [SplitP TopP]) Horizontal
107 103 let lowerP = rpp ++ [SplitP BottomP]
108   - let middleP = rpp ++ [SplitP TopP,SplitP BottomP]
109   - let upperP = rpp ++ [SplitP TopP,SplitP TopP]
  104 + let upperP = rpp ++ [SplitP TopP]
110 105 lower <- getNotebook lowerP
111   - middle <- getNotebook middleP
112 106 upper <- getNotebook upperP
113 107 liftIO $ do
114 108 notebookSetTabPos lower PosTop
115   - notebookSetTabPos middle PosTop
116 109 notebookSetTabPos upper PosTop
117 110 notebookSetShowTabs upper False
118   - getOrBuildPane (Left middleP) :: IDEM (Maybe IDEBreakpoints)
119   - getOrBuildPane (Left middleP) :: IDEM (Maybe IDEVariables)
  111 + getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEBreakpoints)
  112 + getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEVariables)
120 113 getOrBuildPane (Left lowerP) :: IDEM (Maybe IDETrace)
121 114 when (null $ filter (\b -> bufferName b == "_Eval.hs") bufs) $
122 115 newTextBuffer upperP "_Eval.hs" Nothing >> return ()
123 116 return ()
124 117 (Just rpp, False) -> do
125 118 let lowerP = getBestPanePath (rpp ++ [SplitP BottomP]) layout'
126   - let middleP = getBestPanePath (rpp ++ [SplitP TopP,SplitP BottomP]) layout'
127   - let upperP = getBestPanePath (rpp ++ [SplitP TopP,SplitP TopP]) layout'
128   - getOrBuildPane (Left middleP) :: IDEM (Maybe IDEBreakpoints)
129   - getOrBuildPane (Left middleP) :: IDEM (Maybe IDEVariables)
  119 + let upperP = getBestPanePath (rpp ++ [SplitP TopP]) layout'
  120 + getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEBreakpoints)
  121 + getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEVariables)
130 122 getOrBuildPane (Left lowerP) :: IDEM (Maybe IDETrace)
131 123 when (null $ filter (\b -> bufferName b == "_Eval.hs") bufs) $
132 124 newTextBuffer upperP "_Eval.hs" Nothing >> return ()
133 125 return ()
134 126 _ -> return ()
135 127
136   -showSearchGroup :: IDEAction
137   -showSearchGroup = do
138   - pp <- panePathForGroup "*Search"
139   - ret <- newGroupOrBringToFront "Search" pp
140   - layout' <- liftM layout (readIDE frameState)
141   - case ret of
142   - (Just rpp, True) -> do
143   - viewSplit' rpp Horizontal
144   - let lowerP = rpp ++ [SplitP BottomP]
145   - let upperP = rpp ++ [SplitP TopP]
146   - lower <- getNotebook lowerP
147   - upper <- getNotebook upperP
148   - liftIO $ do
149   - notebookSetTabPos lower PosTop
150   - notebookSetTabPos upper PosTop
151   - notebookSetShowTabs upper False
152   - notebookSetShowTabs lower False
153   - getOrBuildPane (Left upperP) :: IDEM (Maybe IDESearch)
154   - getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEGrep)
155   - return ()
156   - (Just rpp, False) -> do
157   - let lowerP = getBestPanePath (rpp ++ [SplitP BottomP]) layout'
158   - let upperP = getBestPanePath (rpp ++ [SplitP TopP]) layout'
159   - getOrBuildPane (Left upperP) :: IDEM (Maybe IDESearch)
160   - getOrBuildPane (Left lowerP) :: IDEM (Maybe IDEGrep)
161   - return ()
162   - _ -> return ()
  128 +
25 src/IDE/Utils/ServerConnection.hs
@@ -45,14 +45,16 @@ doServerCommand command cont = do
45 45 doServerCommand command cont
46 46 Nothing -> do
47 47 prefs' <- readIDE prefs
48   - handle <- liftIO $ do
49   - catch (connectTo "localhost" (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
  48 + handle <- reifyIDE $ \ideR -> do
  49 + catch (connectTo (serverIP prefs') (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
50 50 (\(exc :: SomeException) -> do
51 51 catch (startServer (serverPort prefs'))
52 52 (\(exc :: SomeException) -> throwIDE ("Can't start leksah-server" ++ show exc))
53   - threadDelay 5000000 -- in microseconds, so five seconds to start
54   - catch (connectTo "localhost" (PortNumber(PortNum (fromIntegral $ serverPort prefs'))))
55   - (\(exc :: SomeException) -> throwIDE ("Can't connect to leksah-server" ++ show exc)))
  53 + mbHandle <- waitForServer prefs' 100
  54 + case mbHandle of
  55 + Just handle -> return handle
  56 + Nothing -> throwIDE ("Can't connect to leksah-server"))
  57 + modifyIDE_ (\ ide -> ide{server = Just handle})
56 58 doCommand handle
57 59 return ()
58 60 where
@@ -74,3 +76,16 @@ startServer port = do
74 76 runCommand ("leksah-server --server=" ++ show port ++ " +RTS -N2 -RTS")
75 77 return ()
76 78
  79 +-- | s is in tenth's of seconds
  80 +waitForServer :: Prefs -> Int -> IO (Maybe Handle)
  81 +waitForServer _ 0 = return Nothing
  82 +waitForServer prefs s = do
  83 + threadDelay 100000 -- 0.1 second
  84 + catch (do
  85 + handle <- liftIO $ connectTo (serverIP prefs) (PortNumber(PortNum (fromIntegral $ serverPort prefs)))
  86 + return (Just handle))
  87 + (\(exc :: SomeException) -> waitForServer prefs (s-1))
  88 +
  89 +
  90 +
  91 +

0 comments on commit 42c80a8

Please sign in to comment.
Something went wrong with that request. Please try again.