|
1 | 1 | using System;
|
2 | 2 | using System.Text.RegularExpressions;
|
3 | 3 | using System.Drawing;
|
4 |
| -using System.Diagnostics; |
5 |
| -using System.Collections; |
6 |
| -using System.ComponentModel; |
7 | 4 | using System.IO;
|
8 | 5 | using System.Windows.Forms;
|
9 |
| -using System.Reflection; |
10 | 6 | using ProjectManager.Projects;
|
11 | 7 | using ProjectManager.Helpers;
|
12 | 8 | using PluginCore.Localization;
|
@@ -350,7 +346,7 @@ void NewProjectDialog_Load(object sender, EventArgs e)
|
350 | 346 | createDirectoryBox.Checked = PluginMain.Settings.CreateProjectDirectory;
|
351 | 347 |
|
352 | 348 | string locationDir = PluginMain.Settings.NewProjectDefaultDirectory;
|
353 |
| - if (locationDir != null && locationDir.Length > 0 && Directory.Exists(locationDir)) |
| 349 | + if (!string.IsNullOrEmpty(locationDir) && Directory.Exists(locationDir)) |
354 | 350 | locationTextBox.Text = locationDir;
|
355 | 351 | else locationTextBox.Text = ProjectPaths.DefaultProjectsDirectory;
|
356 | 352 | locationTextBox.SelectionStart = locationTextBox.Text.Length;
|
@@ -554,13 +550,14 @@ private void browseButton_Click(object sender, System.EventArgs e)
|
554 | 550 |
|
555 | 551 | private void UpdateStatusBar()
|
556 | 552 | {
|
557 |
| - string sep = Path.DirectorySeparatorChar.ToString(); |
558 | 553 | string ext = ProjectExt;
|
559 | 554 | if (ext != null)
|
560 | 555 | {
|
561 | 556 | 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); |
564 | 561 | }
|
565 | 562 | else statusBar.Text = "";
|
566 | 563 | }
|
|
0 commit comments