canvas.gui.MessageBox: Ensure path for saving selections exists.
This commit is contained in:
parent
0f692bf89c
commit
1864153b9a
1 changed files with 4 additions and 1 deletions
|
@ -189,7 +189,7 @@ var MessageBox = {
|
|||
_loadSelection: func
|
||||
{
|
||||
var dlg_id = md5(me._title ~ me._text ~ me._standard_buttons);
|
||||
me._save_path = getprop("/sim/fg-home") ~ "/cache/MessageBox-" ~ dlg_id;
|
||||
me._save_path = getprop("/sim/fg-home") ~ "/cache/MessageBox/sel-" ~ dlg_id;
|
||||
|
||||
if( io.stat(me._save_path) != nil )
|
||||
{
|
||||
|
@ -203,6 +203,9 @@ var MessageBox = {
|
|||
{
|
||||
printlog("info", "Saving dialog selection to '" ~ me._save_path ~ "'");
|
||||
|
||||
# ensure directory exists
|
||||
os.path.new(me._save_path).create_dir();
|
||||
|
||||
var fh = io.open(me._save_path, "w");
|
||||
io.write(fh, '' ~ sel);
|
||||
io.close(fh);
|
||||
|
|
Loading…
Reference in a new issue