From 9b43814846f4866aa0beb96a475cc06557194305 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 18 Apr 2016 01:02:18 +0200 Subject: [PATCH] GTK: clear move buffer after move Doesn't make sense to keep it since the buffer will probably point to a non-existing file afterwards. --- src/HSFM/GUI/Gtk/Callbacks.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/HSFM/GUI/Gtk/Callbacks.hs b/src/HSFM/GUI/Gtk/Callbacks.hs index 97a5a46..fad8899 100644 --- a/src/HSFM/GUI/Gtk/Callbacks.hs +++ b/src/HSFM/GUI/Gtk/Callbacks.hs @@ -352,7 +352,7 @@ copyInit _ _ _ = withErrorDialog -- |Finalizes a file operation, such as copy or move. operationFinal :: MyGUI -> MyView -> Maybe Item -> IO () -operationFinal _ myview mitem = withErrorDialog $ do +operationFinal mygui myview mitem = withErrorDialog $ do op <- readTVarIO (operationBuffer myview) cdir <- case mitem of Nothing -> path <$> getCurrentDir myview @@ -363,15 +363,16 @@ operationFinal _ myview mitem = withErrorDialog $ do ++ " to \"" ++ P.fpToString (P.fromAbs cdir) ++ "\"?" withConfirmationDialog cmsg . withCopyModeDialog - $ \cm -> void $ runFileOp (FMove . MC s cdir $ cm) - return () + $ \cm -> do + void $ runFileOp (FMove . MC s cdir $ cm) + popStatusbar mygui + writeTVarIO (operationBuffer myview) None FCopy (CP1 s) -> do let cmsg = "Really copy " ++ imsg s ++ " to \"" ++ P.fpToString (P.fromAbs cdir) ++ "\"?" withConfirmationDialog cmsg . withCopyModeDialog $ \cm -> void $ runFileOp (FCopy . CC s cdir $ cm) - return () _ -> return () where imsg s = case s of