mirror of https://github.com/buggins/dlangui.git
Small fix for selecting directories
This commit is contained in:
parent
8eacdfd2c0
commit
2f72f5950a
|
|
@ -456,8 +456,14 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (action.id == StandardAction.Open || action.id == StandardAction.OpenDirectory || action.id == StandardAction.Save) {
|
if (action.id == StandardAction.Open || action.id == StandardAction.OpenDirectory || action.id == StandardAction.Save) {
|
||||||
_filename = _path ~ dirSeparator ~ toUTF8(_edFilename.text);
|
auto baseFilename = toUTF8(_edFilename.text);
|
||||||
if (_filename.length > 0) {
|
_filename = _path ~ dirSeparator ~ baseFilename;
|
||||||
|
|
||||||
|
if (action.id != StandardAction.OpenDirectory && isDir(_filename)) {
|
||||||
|
auto row = _fileList.row();
|
||||||
|
onItemActivated(row);
|
||||||
|
return true;
|
||||||
|
} else if (baseFilename.length > 0) {
|
||||||
Action result = _action;
|
Action result = _action;
|
||||||
result.stringParam = _filename;
|
result.stringParam = _filename;
|
||||||
// success if either selected dir & has to open dir or if selected file
|
// success if either selected dir & has to open dir or if selected file
|
||||||
|
|
@ -467,10 +473,6 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
close(result);
|
close(result);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (_filename.length == 0){
|
|
||||||
auto row = _fileList.row();
|
|
||||||
onItemActivated(row);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.handleAction(action);
|
return super.handleAction(action);
|
||||||
|
|
@ -1000,4 +1002,4 @@ class DirEditLine : FileNameEditLine {
|
||||||
}
|
}
|
||||||
|
|
||||||
//import dlangui.widgets.metadata;
|
//import dlangui.widgets.metadata;
|
||||||
//mixin(registerWidgets!(FileNameEditLine, DirEditLine)());
|
//mixin(registerWidgets!(FileNameEditLine, DirEditLine)());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue