Merge pull request #551 from and3md/filename_filedialog

Fix setting default filename in (save as) FileDialog.
This commit is contained in:
Vadim Lopatin 2018-02-08 15:57:16 +03:00 committed by GitHub
commit 2312c5aa2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -713,6 +713,9 @@ class FileDialog : Dialog, CustomGridCellAdapter {
/// override to implement creation of dialog controls
override void initialize() {
// remember filename specified by user, file grid initialization can change it
string defaultFilename = _filename;
_roots = getRootPaths() ~ getBookmarkPaths();
layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT).minWidth(WIDGET_STYLE_CONSOLE ? 50 : 600);
@ -821,6 +824,9 @@ class FileDialog : Dialog, CustomGridCellAdapter {
openDirectory(_path, _filename);
_fileList.layoutHeight = FILL_PARENT;
// set default file name if specified by user
if (defaultFilename.length != 0)
_edFilename.text = toUTF32(baseName(defaultFilename));
}
/// get sort order suffix for column title