Skip to content

Commit 89fecfe

Browse files
author
SlavaRa
committed
Improved display of the path of a new project
1 parent b909af4 commit 89fecfe

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

External/Plugins/ProjectManager/Controls/NewProjectDialog.cs

Lines changed: 5 additions & 8 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;
@@ -350,7 +346,7 @@ void NewProjectDialog_Load(object sender, EventArgs e)
350346
createDirectoryBox.Checked = PluginMain.Settings.CreateProjectDirectory;
351347

352348
string locationDir = PluginMain.Settings.NewProjectDefaultDirectory;
353-
if (locationDir != null && locationDir.Length > 0 && Directory.Exists(locationDir))
349+
if (!string.IsNullOrEmpty(locationDir) && Directory.Exists(locationDir))
354350
locationTextBox.Text = locationDir;
355351
else locationTextBox.Text = ProjectPaths.DefaultProjectsDirectory;
356352
locationTextBox.SelectionStart = locationTextBox.Text.Length;
@@ -554,13 +550,14 @@ private void browseButton_Click(object sender, System.EventArgs e)
554550

555551
private void UpdateStatusBar()
556552
{
557-
string sep = Path.DirectorySeparatorChar.ToString();
558553
string ext = ProjectExt;
559554
if (ext != null)
560555
{
561556
statusBar.Text = " " + TextHelper.GetString("Info.WillCreate") + " ";
562-
if (createDirectoryBox.Checked) statusBar.Text += locationTextBox.Text + sep + nameTextBox.Text + sep + nameTextBox.Text + ext;
563-
else statusBar.Text += locationTextBox.Text + sep + nameTextBox.Text + ext;
557+
statusBar.Text += Path.Combine(locationTextBox.Text.TrimEnd('\\', '/'), nameTextBox.Text);
558+
if (createDirectoryBox.Checked) statusBar.Text = Path.Combine(statusBar.Text, nameTextBox.Text);
559+
statusBar.Text += ext;
560+
statusBar.Text = statusBar.Text.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
564561
}
565562
else statusBar.Text = "";
566563
}

0 commit comments

Comments
 (0)