Improve default file chooser settings

If the user hasn't specified a file on CLI, the button
now correctly shows "None" and has $HOME as start dir.
This commit is contained in:
hasufell 2014-10-02 14:36:23 +02:00
parent d39180a723
commit cb53b2b61d
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 7 additions and 2 deletions

9
Gtk.hs
View File

@ -35,8 +35,13 @@ makeGUI startFile = do
hscale <- xmlGetWidget xml castToHScale "hscale"
-- adjust properties
_ <- fileChooserSetCurrentFolder fileButton homedir
_ <- fileChooserSetFilename fileButton startFile
case startFile == "" of
True -> do
_ <- fileChooserSetCurrentFolder fileButton homedir
return ()
False -> do
_ <- fileChooserSetFilename fileButton startFile
return ()
-- callbacks
_ <- onDestroy window mainQuit