Commit 4c2bae7d authored by Diederik van Arkel's avatar Diederik van Arkel

improve file save handling

parent da3a144d
......@@ -39,15 +39,6 @@ where
texts = ["Save changes to","\""+++RemovePath pathname+++"\"?"]
= ask texts win res ps
save win ps
# (reply,ps) = message win msgSave ps
| isNothing reply
= okNotice ["Save failed:","Internal error [edfiles:ed_ask_save_all]"] ps
# error = fromJust reply
| isJust error
= okNotice ["Save failed:",fromJust error] ps
= ps
ask texts win res ps
# (sId,ps) = openId ps
# (okId,ps) = openId ps
......@@ -76,7 +67,7 @@ where
] // not this one but continue with rest
:+: ButtonControl "&Yes"
[ ControlId okId
, ControlFunction (noLS (doall res o maybeclose win o save win o (closeWindow sId)))
, ControlFunction (noLS (try_save sId))
, ControlWidth (ContentWidth "Cancel")
] // do this one and continue
)
......@@ -86,7 +77,27 @@ where
, WindowClose (noLS (mb_update_undoinfo o closeWindow sId))
, WindowInitActive okId
]
try_save sId ps
# ps = closeWindow sId ps
// # ps = save win ps
# (reply,ps) = message win msgSave ps
| isNothing reply
= okNotice ["Save failed:","Internal error [edfiles:ed_ask_save_all]","Aborting quit"] ps
# error = fromJust reply
| isJust error
= okNotice ["Save failed:",fromJust error,"Aborting quit"] ps
# ps = maybeclose win ps
= doall res ps
/*
save win ps
# (reply,ps) = message win msgSave ps
| isNothing reply
= okNotice ["Save failed:","Internal error [edfiles:ed_ask_save_all]"] ps
# error = fromJust reply
| isJust error
= okNotice ["Save failed:",fromJust error] ps
= ps
*/
ed_open_path_sel :: .String !Selection !*(PSt General) -> *PSt General
ed_open_path_sel pathName sel ps
# (mFHrecId,ps) = getFHI ps
......
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