mirror of https://github.com/buggins/dlangide.git
save recent directories for opening / creating workspaces/projects - #179
This commit is contained in:
parent
c2c19fbf86
commit
d344dd0d01
|
@ -1179,7 +1179,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
||||||
void createNewProject(bool newWorkspace) {
|
void createNewProject(bool newWorkspace) {
|
||||||
if (currentWorkspace is null)
|
if (currentWorkspace is null)
|
||||||
newWorkspace = true;
|
newWorkspace = true;
|
||||||
NewProjectDlg dlg = new NewProjectDlg(this, newWorkspace, currentWorkspace);
|
string location = _settings.getRecentPath("FILE_OPEN_WORKSPACE_PATH");
|
||||||
|
if (newWorkspace && location)
|
||||||
|
location = location.dirName;
|
||||||
|
NewProjectDlg dlg = new NewProjectDlg(this, newWorkspace, currentWorkspace, location);
|
||||||
dlg.dialogResult = delegate(Dialog dlg, const Action result) {
|
dlg.dialogResult = delegate(Dialog dlg, const Action result) {
|
||||||
if (result.id == ACTION_FILE_NEW_PROJECT.id || result.id == ACTION_FILE_NEW_WORKSPACE.id) {
|
if (result.id == ACTION_FILE_NEW_PROJECT.id || result.id == ACTION_FILE_NEW_WORKSPACE.id) {
|
||||||
//Log.d("settings after edit:\n", s.toJSON(true));
|
//Log.d("settings after edit:\n", s.toJSON(true));
|
||||||
|
|
|
@ -37,14 +37,14 @@ class NewProjectDlg : Dialog {
|
||||||
Workspace _currentWorkspace;
|
Workspace _currentWorkspace;
|
||||||
IDEFrame _ide;
|
IDEFrame _ide;
|
||||||
|
|
||||||
this(IDEFrame parent, bool newWorkspace, Workspace currentWorkspace) {
|
this(IDEFrame parent, bool newWorkspace, Workspace currentWorkspace, string dir) {
|
||||||
super(newWorkspace ? UIString("New Workspace"d) : UIString("New Project"d), parent.window,
|
super(newWorkspace ? UIString("New Workspace"d) : UIString("New Project"d), parent.window,
|
||||||
DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
|
DialogFlag.Modal | DialogFlag.Resizable | DialogFlag.Popup, 500, 400);
|
||||||
_ide = parent;
|
_ide = parent;
|
||||||
_icon = "dlangui-logo1";
|
_icon = "dlangui-logo1";
|
||||||
this._currentWorkspace = currentWorkspace;
|
this._currentWorkspace = currentWorkspace;
|
||||||
_newWorkspace = newWorkspace;
|
_newWorkspace = newWorkspace;
|
||||||
_location = currentWorkspace !is null ? currentWorkspace.dir : currentDir;
|
_location = dir !is null ? dir : (currentWorkspace !is null ? currentWorkspace.dir : currentDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// override to implement creation of dialog controls
|
/// override to implement creation of dialog controls
|
||||||
|
|
Loading…
Reference in New Issue