Commit 38a42b3e authored by Will Thompson's avatar Will Thompson

Merge branch '15-no-close-confirmation' into 'master'

Drop close-without-saving confirmation dialog

Closes #15

See merge request !18
parents 4561b4ea 0fe006d1
Pipeline #104510 passed with stages
in 19 minutes and 10 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))
[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
......
resolver: lts-12.20
resolver: lts-14.22
packages:
- .
flags:
bustle:
# https://gitlab.freedesktop.org/bustle/bustle/issues/13
hgettext: false
allow-newer: true
extra-deps:
- hgettext-0.1.31.0
- pcap-0.4.5.2
- cairo-0.13.8.0@sha256:9b64a376ebaa4f153bba5866a32291fd4bed48147009cce9158ce6533928eba8,4075
- gio-0.13.8.0@sha256:5691212b07dc4193ea6f8202a625c9515d750b249aeafc659139e29a5ec61436,3116
- glib-0.13.8.0@sha256:97698bd054bad38756f3ef0220d7684f72e42660d261e9b118aa73419ce9207d,3136
- gtk3-0.15.4@sha256:e8de08763cb757c4be202a4eb7551a108b49cd59aa90bc7e2d680893d5fccec1,19491
- pango-0.13.8.0@sha256:690149ea2efb03c783937b69a5ec6ac854806146fd760e28e800634a6c2243c1,3897
- pcap-0.4.5.2@sha256:9f9f64abf126b9bbbe2698dd2ec31d25b445d70aab6c845aadd75ae79b6cc0b3,1313
- gtk2hs-buildtools-0.13.8.0@sha256:132f38155fc677430a47ea750918973161c876fb6f281d342ac2f07eb99229ce,5238
nix:
packages: [libpcap, pkgconfig, libxml2, glib, cairo, pango, gnome3.gtk]
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