Commit 0fe006d1 authored by Will Thompson's avatar Will Thompson

Drop close-without-saving confirmation dialog

Anecdotally, most users (including me) rarely want to save their logs,
they just want to record them and read them. In any case, all the
temporary logs are actually kept (forever) in $XDG_CACHE_DIR.

Fixes #15.
parent ed60b853
Pipeline #104507 passed with stages
in 17 minutes and 27 seconds
......@@ -433,41 +433,6 @@ showSaveDialog wi savedCb = do
\\"%s\".") tempFilePath
displayError wi title (Just secondary)
-- | Show a confirmation dialog if the log is unsaved. Suitable for use as a
-- 'delete-event' handler.
promptToSave :: MonadIO io
=> WindowInfo
-> io Bool -- ^ True if we showed a prompt; False if we're
-- happy to quit
promptToSave wi = io $ do
mdetails <- readIORef (wiLogDetails wi)
case mdetails of
Just (RecordedLog tempFilePath) -> do
let tempFileName = takeFileName tempFilePath
title = printf (__ "Save log '%s' before closing?") tempFileName :: String
prompt <- messageDialogNew (Just (wiWindow wi))
messageDialogSetSecondaryText prompt
(__ "If you don't save, this log will be lost forever.")
dialogAddButton prompt (__ "Close _Without Saving") ResponseClose
dialogAddButton prompt stockCancel ResponseCancel
dialogAddButton prompt stockSave ResponseYes
widgetShowAll prompt
prompt `after` response $ \resp -> do
let closeUp = widgetDestroy (wiWindow wi)
case resp of
ResponseYes -> showSaveDialog wi closeUp
ResponseClose -> closeUp
_ -> return ()
widgetDestroy prompt
return True
_ -> return False
maybeQuit :: B ()
maybeQuit = do
n <- decWindows
......@@ -576,7 +541,6 @@ emptyWindow = do
, wiLogDetails = logDetailsRef
io $ window `on` deleteEvent $ promptToSave windowInfo
io $ widgetShow window
return windowInfo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment