remove browse mode and code that became dead as a result of its removal, because the new plan is to launch the program from the terminal (and terminal navigation is okay)
This commit is contained in:
@@ -45,36 +45,6 @@ struct
|
||||
TextIO.closeOut io
|
||||
end
|
||||
|
||||
fun getDirList (dir, acc, rootPath) =
|
||||
case OS.FileSys.readDir dir of
|
||||
SOME path =>
|
||||
let
|
||||
val folderPath = String.concat [rootPath, "/", path]
|
||||
in
|
||||
if OS.FileSys.isDir folderPath then
|
||||
getDirList (dir, AppType.IS_FOLDER path :: acc, rootPath)
|
||||
else if OS.FileSys.isLink folderPath then
|
||||
getDirList (dir, acc, rootPath)
|
||||
else
|
||||
getDirList (dir, AppType.IS_FILE path :: acc, rootPath)
|
||||
end
|
||||
| NONE => let val acc = List.rev acc in Vector.fromList acc end
|
||||
|
||||
fun loadFiles (path, inputMailbox) =
|
||||
let
|
||||
val path = if String.size path = 0 then OS.FileSys.getDir () else path
|
||||
val dir = OS.FileSys.openDir path
|
||||
val dirList = getDirList (dir, [], path)
|
||||
val _ = OS.FileSys.closeDir dir
|
||||
val inputMsg = FILE_BROWSER_AND_PATH {fileBrowser = dirList, path = path}
|
||||
in
|
||||
Mailbox.send (inputMailbox, inputMsg)
|
||||
end
|
||||
|
||||
fun selectPath (path, inputMailbox) =
|
||||
if OS.FileSys.isDir path then loadFiles (path, inputMailbox)
|
||||
else loadSquares (path, inputMailbox)
|
||||
|
||||
fun run (fileMailbox, inputMailbox) =
|
||||
let
|
||||
val _ =
|
||||
@@ -83,8 +53,6 @@ struct
|
||||
| EXPORT_SQUARES str => saveString (exportFilename, str)
|
||||
| EXPORT_COLLISIONS str => saveString (collisionFilename, str)
|
||||
| LOAD_SQUARES => loadSquares (filename, inputMailbox)
|
||||
| LOAD_FILES path => loadFiles (path, inputMailbox)
|
||||
| SELECT_PATH path => selectPath (path, inputMailbox)
|
||||
in
|
||||
run (fileMailbox, inputMailbox)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user