mirror of https://github.com/buggins/dlangide.git
new file dialog enhancements #258
This commit is contained in:
parent
4a7a6d0b07
commit
09d5470dda
2
dub.json
2
dub.json
|
@ -12,7 +12,7 @@
|
||||||
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dlangui": "==0.9.119",
|
"dlangui": "==0.9.120",
|
||||||
"dcd": "~>0.9.1"
|
"dcd": "~>0.9.1"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,11 @@ class NewFileDlg : Dialog {
|
||||||
_edLocation.addFilter(FileFilterEntry(UIString.fromRaw("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini;*.dt"));
|
_edLocation.addFilter(FileFilterEntry(UIString.fromRaw("DlangIDE files"d), "*.dlangidews;*.d;*.dd;*.di;*.ddoc;*.dh;*.json;*.xml;*.ini;*.dt"));
|
||||||
_edLocation.caption = "Select directory"d;
|
_edLocation.caption = "Select directory"d;
|
||||||
|
|
||||||
|
_edFileName.editorAction.connect(&onEditorAction);
|
||||||
|
_edFilePath.editorAction.connect(&onEditorAction);
|
||||||
|
_edModuleName.editorAction.connect(&onEditorAction);
|
||||||
|
_edLocation.editorAction.connect(&onEditorAction);
|
||||||
|
|
||||||
// fill templates
|
// fill templates
|
||||||
dstring[] names;
|
dstring[] names;
|
||||||
foreach(t; _templates)
|
foreach(t; _templates)
|
||||||
|
@ -156,6 +161,23 @@ class NewFileDlg : Dialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// called after window with dialog is shown
|
||||||
|
override void onShow() {
|
||||||
|
super.onShow();
|
||||||
|
_edFileName.selectAll();
|
||||||
|
_edFileName.setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected bool onEditorAction(const Action action) {
|
||||||
|
if (action.id == EditorActions.InsertNewLine) {
|
||||||
|
if (!validate())
|
||||||
|
return false;
|
||||||
|
close(_buttonActions[0]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StringListWidget _projectTemplateList;
|
StringListWidget _projectTemplateList;
|
||||||
EditBox _templateDescription;
|
EditBox _templateDescription;
|
||||||
DirEditLine _edLocation;
|
DirEditLine _edLocation;
|
||||||
|
|
Loading…
Reference in New Issue