last modified

This commit is contained in:
Cameron Taylor 2023-11-27 20:37:10 -05:00
parent 6421b5d57d
commit e44559d056

View file

@ -83,10 +83,18 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog
public function addRecentFilePath(state:ChartEditorState, chartPath:String):Void
{
var linkRecentChart:Link = new Link();
var fileNamePattern:EReg = new EReg("([^/\\\\]+)$", "");
var fileName:String = fileNamePattern.match(chartPath) ? fileNamePattern.matched(1) : chartPath;
linkRecentChart.text = fileName;
linkRecentChart.tooltip = chartPath;
#if sys
var lastModified:String = "Last Modified: " + sys.FileSystem.stat(chartPath).mtime.toString();
linkRecentChart.tooltip += "\n" + lastModified;
#end
linkRecentChart.onClick = function(_event) {
this.hideDialog(DialogButton.CANCEL);