Skip to content

Commit 74c5b7f

Browse files
committed
Merge pull request fdorg#112 from Gama11/CommandPromptProjectManager
ProjectManager: Add command prompt to folder context menu
2 parents 814718b + 73e8498 commit 74c5b7f

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎External/Plugins/ProjectManager/Controls/Icons.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class Icons
9191
public static FDImage SyncToFile;
9292
public static FDImage ClasspathFolder;
9393
public static FDImage DocumentClass;
94+
public static FDImage CommandPrompt;
9495

9596
public static ImageList ImageList { get { return imageList; } }
9697

@@ -133,7 +134,7 @@ public static void Initialize(IMainForm mainForm)
133134
AddFile = GetResource("Icons.AddFile.png"); //Get("304|0|5|4");
134135
OpenFile = Get(214);
135136
EditFile = Get(282);
136-
Browse = Get(46);
137+
Browse = Get(56);
137138

138139
FindAndReplace = Get(484);
139140
FindInFiles = Get(209);
@@ -159,6 +160,7 @@ public static void Initialize(IMainForm mainForm)
159160
SyncToFile = Get("315|9|-3|-4");
160161
ClasspathFolder = Get(544);
161162
DocumentClass = Get(147);
163+
CommandPrompt = Get(57);
162164
}
163165

164166
public static FDImage GetGray(string data)

‎External/Plugins/ProjectManager/Controls/TreeView/ProjectContextMenu.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class ProjectContextMenu : ContextMenuStrip
6060
public ToolStripMenuItem CopyClassName = new ToolStripMenuItem(TextHelper.GetString("Label.CopyClassName"));
6161
public ToolStripMenuItem AddSourcePath = new ToolStripMenuItem(TextHelper.GetString("Label.AddSourcePath"), Icons.Classpath.Img);
6262
public ToolStripMenuItem RemoveSourcePath = new ToolStripMenuItem(TextHelper.GetString("Label.SourcePath"));
63+
public ToolStripMenuItem CommandPrompt = new ToolStripMenuItem(TextHelper.GetString("FlashDevelop.Label.CommandPrompt"), Icons.CommandPrompt.Img);
6364
public event FileAddHandler AddFileFromTemplate;
6465

6566
public ProjectContextMenu()
@@ -325,6 +326,7 @@ private void AddInvalidClassPathNodes(MergableMenu menu, string path)
325326
private void AddFolderItems(MergableMenu menu, string path)
326327
{
327328
menu.Add(AddMenu, 0);
329+
menu.Add(CommandPrompt, 0);
328330
menu.Add(Browse, 0);
329331
menu.Add(FindInFiles, 0);
330332
menu.Add(ShellMenu, 0);

‎External/Plugins/ProjectManager/PluginMain.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public void Initialize()
270270
pluginUI.Menu.CloseProject.Click += delegate { CloseProject(false); };
271271
pluginUI.Menu.Properties.Click += delegate { OpenProjectProperties(); };
272272
pluginUI.Menu.ShellMenu.Click += delegate { TreeShowShellMenu(); };
273+
pluginUI.Menu.CommandPrompt.Click += delegate { TreeShowCommandPrompt(); };
273274
pluginUI.Menu.BuildProjectFile.Click += delegate { BackgroundBuild(); };
274275
pluginUI.Menu.BuildProjectFiles.Click += delegate { BackgroundBuild(); };
275276
pluginUI.Menu.BuildAllProjects.Click += delegate { FullBuild(); };
@@ -1299,6 +1300,17 @@ public void TreeRefreshSelectedNode()
12991300
Tree.RefreshTree();
13001301
}
13011302

1303+
/// <summary>
1304+
/// Shows the command prompt
1305+
/// </summary>
1306+
private void TreeShowCommandPrompt()
1307+
{
1308+
ProcessStartInfo cmdPrompt = new ProcessStartInfo();
1309+
cmdPrompt.FileName = "cmd.exe";
1310+
cmdPrompt.WorkingDirectory = Tree.SelectedPath;
1311+
Process.Start(cmdPrompt);
1312+
}
1313+
13021314
/// <summary>
13031315
/// Shows the explorer shell menu
13041316
/// </summary>

0 commit comments

Comments
 (0)