GTK: rename fileChooserDialog and add title parameter
This commit is contained in:
parent
71a2cb90be
commit
3edd3c8a19
@ -267,8 +267,8 @@ upDir mygui myview = withErrorDialog $ do
|
|||||||
-- |Go up one directory and visualize it in the treeView.
|
-- |Go up one directory and visualize it in the treeView.
|
||||||
newFile :: MyGUI -> MyView -> IO ()
|
newFile :: MyGUI -> MyView -> IO ()
|
||||||
newFile mygui myview = withErrorDialog $ do
|
newFile mygui myview = withErrorDialog $ do
|
||||||
cdir <- getCurrentDir myview
|
cdir <- getCurrentDir myview
|
||||||
mfn <- fileChooserDialog
|
mfn <- textInputDialog "Enter file name"
|
||||||
maybe (return ()) (\fn -> do
|
maybe (return ()) (\fn -> do
|
||||||
createFile cdir fn
|
createFile cdir fn
|
||||||
refreshTreeView' mygui myview cdir
|
refreshTreeView' mygui myview cdir
|
||||||
|
@ -161,16 +161,16 @@ withErrorDialog io = do
|
|||||||
|
|
||||||
-- |Asks the user which directory copy mode he wants via dialog popup
|
-- |Asks the user which directory copy mode he wants via dialog popup
|
||||||
-- and returns 'DirCopyMode'.
|
-- and returns 'DirCopyMode'.
|
||||||
fileChooserDialog :: IO (Maybe String)
|
textInputDialog :: String -> IO (Maybe String)
|
||||||
fileChooserDialog = do
|
textInputDialog title = do
|
||||||
chooserDialog <- messageDialogNew Nothing
|
chooserDialog <- messageDialogNew Nothing
|
||||||
[DialogDestroyWithParent]
|
[DialogDestroyWithParent]
|
||||||
MessageQuestion
|
MessageQuestion
|
||||||
ButtonsNone
|
ButtonsNone
|
||||||
"Enter filename"
|
title
|
||||||
entry <- entryNew
|
entry <- entryNew
|
||||||
cbox <- dialogGetActionArea chooserDialog
|
cbox <- dialogGetActionArea chooserDialog
|
||||||
dialogAddButton chooserDialog "Create" (ResponseUser 0)
|
dialogAddButton chooserDialog "Ok" (ResponseUser 0)
|
||||||
dialogAddButton chooserDialog "Cancel" (ResponseUser 1)
|
dialogAddButton chooserDialog "Cancel" (ResponseUser 1)
|
||||||
boxPackStart (castToBox cbox) entry PackNatural 5
|
boxPackStart (castToBox cbox) entry PackNatural 5
|
||||||
widgetShowAll chooserDialog
|
widgetShowAll chooserDialog
|
||||||
|
Loading…
Reference in New Issue
Block a user