GUI: clean up copyFinal

Don't show CopyModeChooserDialog for file copy operations.
This commit is contained in:
Julian Ospald 2015-12-20 05:32:11 +01:00
parent 98216a97c3
commit 5bfea0db10
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -170,13 +170,14 @@ copyFinal :: MyGUI -> MyView -> IO ()
copyFinal mygui myview = do
op <- readTVarIO (operationBuffer myview)
case op of
FCopy (CP1 sourceDir) -> do
curDir <- anchor <$> readTVarIO (fsState myview)
let cmsg = "Really copy file \"" ++ sourceDir
++ "\"" ++ " to \"" ++ curDir ++ "\"?"
FCopy (CP1 source) -> do
dest <- anchor <$> readTVarIO (fsState myview)
isFile <- doesFileExist source
let cmsg = "Really copy file \"" ++ source
++ "\"" ++ " to \"" ++ dest ++ "\"?"
withConfirmationDialog cmsg $ do
copyMode <- showCopyModeChooserDialog
withErrorDialog ((runFileOp . FCopy . CC sourceDir curDir $ copyMode)
copyMode <- if isFile then return Strict else showCopyModeChooserDialog
withErrorDialog ((runFileOp . FCopy . CC source dest $ copyMode)
>> refreshTreeView mygui myview Nothing)
_ -> return ()