summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2020-02-04 09:34:52 +0000
committerWill Thompson <will@willthompson.co.uk>2020-02-04 09:34:52 +0000
commit0fe006d171a10d0e1d6ed605661400bf02f76d38 (patch)
tree7e363454e1fbb6e00137f5b5acd1883ba9e29a0e
parented60b853bd5d11fc6c6e9aa28fae53f980c6a77d (diff)
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.
-rw-r--r--Bustle/UI.hs36
1 files changed, 0 insertions, 36 deletions
diff --git a/Bustle/UI.hs b/Bustle/UI.hs
index 6666c72..7eda4f7 100644
--- a/Bustle/UI.hs
+++ b/Bustle/UI.hs
@@ -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))
- [DialogModal]
- MessageWarning
- ButtonsNone
- title
- 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
incWindows
io $ widgetShow window
return windowInfo