GTK: allow to start gui with specific directory
This commit is contained in:
parent
7c84dce09f
commit
074ee45961
@ -4,11 +4,22 @@ module Main where
|
|||||||
|
|
||||||
import Graphics.UI.Gtk
|
import Graphics.UI.Gtk
|
||||||
import GUI.Gtk.Gui
|
import GUI.Gtk.Gui
|
||||||
|
import Safe
|
||||||
|
(
|
||||||
|
headDef
|
||||||
|
)
|
||||||
|
import System.Environment
|
||||||
|
(
|
||||||
|
getArgs
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
_ <- initGUI
|
_ <- initGUI
|
||||||
|
|
||||||
startMainWindow
|
args <- getArgs
|
||||||
|
|
||||||
|
startMainWindow (headDef "/" args)
|
||||||
|
|
||||||
mainGUI
|
mainGUI
|
||||||
|
@ -458,8 +458,8 @@ withErrorDialog io = do
|
|||||||
|
|
||||||
|
|
||||||
-- |Set up the GUI.
|
-- |Set up the GUI.
|
||||||
startMainWindow :: IO ()
|
startMainWindow :: FilePath -> IO ()
|
||||||
startMainWindow = do
|
startMainWindow startdir = do
|
||||||
|
|
||||||
settings <- newTVarIO (MkFMSettings False True)
|
settings <- newTVarIO (MkFMSettings False True)
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ startMainWindow = do
|
|||||||
filePix <- getIcon IFile 24
|
filePix <- getIcon IFile 24
|
||||||
errorPix <- getIcon IError 24
|
errorPix <- getIcon IError 24
|
||||||
|
|
||||||
fsState <- readPath' "/" >>= newTVarIO
|
fsState <- readPath' startdir >>= newTVarIO
|
||||||
|
|
||||||
operationBuffer <- newTVarIO (Right None)
|
operationBuffer <- newTVarIO (Right None)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user