Skip to content

Commit 7c1e378

Browse files
committed
Merge pull request #819 from SlavaRa/feature/NewProjectDialog_improvements
[UI NewProjectDialog] Improved display of the path of a new project
2 parents 531d594 + 62ca4cc commit 7c1e378

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

External/Plugins/ProjectManager/Controls/NewProjectDialog.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using System;
22
using System.Text.RegularExpressions;
33
using System.Drawing;
4-
using System.Diagnostics;
5-
using System.Collections;
6-
using System.ComponentModel;
74
using System.IO;
85
using System.Windows.Forms;
9-
using System.Reflection;
106
using ProjectManager.Projects;
117
using ProjectManager.Helpers;
128
using PluginCore.Localization;
@@ -362,7 +358,7 @@ void NewProjectDialog_Load(object sender, EventArgs e)
362358
createDirectoryBox.Checked = PluginMain.Settings.CreateProjectDirectory;
363359

364360
string locationDir = PluginMain.Settings.NewProjectDefaultDirectory;
365-
if (locationDir != null && locationDir.Length > 0 && Directory.Exists(locationDir))
361+
if (!string.IsNullOrEmpty(locationDir) && Directory.Exists(locationDir))
366362
locationTextBox.Text = locationDir;
367363
else locationTextBox.Text = ProjectPaths.DefaultProjectsDirectory;
368364
locationTextBox.SelectionStart = locationTextBox.Text.Length;
@@ -566,15 +562,19 @@ private void browseButton_Click(object sender, System.EventArgs e)
566562

567563
private void UpdateStatusBar()
568564
{
569-
string sep = Path.DirectorySeparatorChar.ToString();
565+
string status = string.Empty;
570566
string ext = ProjectExt;
571567
if (ext != null)
572568
{
573-
statusBar.Text = " " + TextHelper.GetString("Info.WillCreate") + " ";
574-
if (createDirectoryBox.Checked) statusBar.Text += locationTextBox.Text + sep + nameTextBox.Text + sep + nameTextBox.Text + ext;
575-
else statusBar.Text += locationTextBox.Text + sep + nameTextBox.Text + ext;
569+
char separator = Path.DirectorySeparatorChar;
570+
string name = nameTextBox.Text;
571+
status = " " + TextHelper.GetString("Info.WillCreate") + " ";
572+
status += locationTextBox.Text.TrimEnd('\\', '/') + separator + name;
573+
if (createDirectoryBox.Checked) status += separator + name;
574+
status += ext;
575+
status = status.Replace('\\', separator).Replace('/', separator);
576576
}
577-
else statusBar.Text = "";
577+
statusBar.Text = status;
578578
}
579579

580580
private void locationTextBox_TextChanged(object sender, System.EventArgs e) { UpdateStatusBar(); }

0 commit comments

Comments
 (0)