From 33fa1056ddc8bf7a270d75bb6644661e1e342f93 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 22 Sep 2017 11:14:27 +0300 Subject: [PATCH] fix workspace explorer Open popup menu item handling - fix #316 --- src/dlangide/ui/frame.d | 16 +++++++++++----- src/dlangide/ui/newproject.d | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index bb20a62..76725fa 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -973,6 +973,12 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL window.showMessageBox(UIString.fromId("ABOUT"c) ~ " " ~ DLANGIDE_VERSION, UIString.fromRaw(msg)); return true; + case IDEActions.ProjectFolderOpenItem: + ProjectItem item = cast(ProjectItem)a.objectParam; + if (item && !item.isFolder) { + openSourceFile(item.filename); + } + return true; case StandardAction.OpenUrl: platform.openURL(a.stringParam); return true; @@ -1324,15 +1330,15 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL 1, delegate(const Action result) { if (result == StandardAction.Yes) { // save and close + import std.file : remove; + closeTab(srcfile.filename); try { - import std.file : remove; - closeTab(srcfile.filename); remove(srcfile.filename); - project.refresh(); - refreshWorkspace(); } catch (Exception e) { - Log.e("Error while removing file"); + Log.e("Cannot remove file"); } + project.refresh(); + refreshWorkspace(); } // else ignore return true; diff --git a/src/dlangide/ui/newproject.d b/src/dlangide/ui/newproject.d index 8e08426..919a43a 100644 --- a/src/dlangide/ui/newproject.d +++ b/src/dlangide/ui/newproject.d @@ -433,7 +433,7 @@ void handleRequest(HTTPServerRequest req, immutable string DUB_JSON_VIBED_HELLOWORLD = q{ { "dependencies": { - "vibe-d": "~>0.7.30-rc.1" + "vibe-d": "~>0.8.1" }, "versions": ["VibeDefaultMain"] }