mirror of https://github.com/buggins/dlangide.git
Merge pull request #123 from default0/master
Add Reveal in Explorer for Projects
This commit is contained in:
commit
5781886da6
|
@ -27,6 +27,7 @@ enum IDEActions : int {
|
|||
RefreshProject,
|
||||
UpdateProjectDependencies,
|
||||
SetStartupProject,
|
||||
RevealProjectInExplorer,
|
||||
ProjectSettings,
|
||||
RunWithRdmd,
|
||||
|
||||
|
@ -95,6 +96,7 @@ const Action ACTION_PROJECT_BUILD = new Action(IDEActions.BuildProject, "MENU_BU
|
|||
const Action ACTION_PROJECT_REBUILD = new Action(IDEActions.RebuildProject, "MENU_BUILD_PROJECT_REBUILD"c, "run-build-clean", KeyCode.F7, KeyFlag.Control);
|
||||
const Action ACTION_PROJECT_CLEAN = new Action(IDEActions.CleanProject, "MENU_BUILD_PROJECT_CLEAN"c, null);
|
||||
const Action ACTION_PROJECT_SET_STARTUP = new Action(IDEActions.SetStartupProject, "MENU_PROJECT_SET_AS_STARTUP"c, null);
|
||||
const Action ACTION_PROJECT_REVEAL_IN_EXPLORER = new Action(IDEActions.RevealProjectInExplorer, "MENU_PROJECT_REVEAL_IN_EXPLORER"c);
|
||||
const Action ACTION_PROJECT_SETTINGS = (new Action(IDEActions.ProjectSettings, "MENU_PROJECT_SETTINGS"c, null)).disableByDefault();
|
||||
const Action ACTION_PROJECT_REFRESH = new Action(IDEActions.RefreshProject, "MENU_PROJECT_REFRESH"c);
|
||||
const Action ACTION_PROJECT_UPDATE_DEPENDENCIES = new Action(IDEActions.UpdateProjectDependencies, "MENU_PROJECT_UPDATE_DEPENDENCIES"c);
|
||||
|
|
|
@ -743,6 +743,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
|||
case IDEActions.RefreshProject:
|
||||
case IDEActions.SetStartupProject:
|
||||
case IDEActions.ProjectSettings:
|
||||
case IDEActions.RevealProjectInExplorer:
|
||||
// enable when project exists
|
||||
if (currentWorkspace && currentWorkspace.startupProject && !_currentBackgroundOperation)
|
||||
a.state = ACTION_STATE_ENABLED;
|
||||
|
@ -867,6 +868,9 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
|||
case IDEActions.RefreshProject:
|
||||
refreshWorkspace();
|
||||
return true;
|
||||
case IDEActions.RevealProjectInExplorer:
|
||||
revealProjectInExplorer(cast(Project)a.objectParam);
|
||||
return true;
|
||||
case IDEActions.WindowCloseDocument:
|
||||
onTabClose(_tabs.selectedTabId);
|
||||
return true;
|
||||
|
@ -1301,6 +1305,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
|||
}
|
||||
}
|
||||
|
||||
void revealProjectInExplorer(Project project) {
|
||||
Platform.instance.showInFileManager(project.items.filename);
|
||||
}
|
||||
|
||||
void buildProject(BuildOperation buildOp, Project project, BuildResultListener listener = null) {
|
||||
if (!currentWorkspace) {
|
||||
_logPanel.logLine("No workspace is opened");
|
||||
|
|
|
@ -80,13 +80,14 @@ class WorkspacePanel : DockWindow {
|
|||
|
||||
_projectPopupMenu = new MenuItem();
|
||||
_projectPopupMenu.add(ACTION_PROJECT_SET_STARTUP,
|
||||
ACTION_PROJECT_FOLDER_REFRESH,
|
||||
ACTION_FILE_NEW_SOURCE_FILE,
|
||||
ACTION_PROJECT_FOLDER_REFRESH,
|
||||
ACTION_FILE_NEW_SOURCE_FILE,
|
||||
//ACTION_PROJECT_FOLDER_OPEN_ITEM,
|
||||
ACTION_PROJECT_BUILD,
|
||||
ACTION_PROJECT_REBUILD,
|
||||
ACTION_PROJECT_CLEAN,
|
||||
ACTION_PROJECT_UPDATE_DEPENDENCIES,
|
||||
ACTION_PROJECT_REVEAL_IN_EXPLORER,
|
||||
ACTION_PROJECT_SETTINGS,
|
||||
//ACTION_PROJECT_FOLDER_REMOVE_ITEM
|
||||
);
|
||||
|
|
|
@ -93,4 +93,5 @@ MENU_PROJECT_FOLDER_OPEN_ITEM=Open
|
|||
MENU_PROJECT_FOLDER_REMOVE_ITEM=Remove
|
||||
MENU_PROJECT_FOLDER_RENAME_ITEM=Rename...
|
||||
MENU_PROJECT_FOLDER_REFRESH=Refresh
|
||||
MENU_PROJECT_REVEAL_IN_EXPLORER=Reveal in Explorer
|
||||
|
||||
|
|
Loading…
Reference in New Issue