|
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;
|
@@ -362,7 +358,7 @@ void NewProjectDialog_Load(object sender, EventArgs e)
|
362 | 358 | createDirectoryBox.Checked = PluginMain.Settings.CreateProjectDirectory;
|
363 | 359 |
|
364 | 360 | string locationDir = PluginMain.Settings.NewProjectDefaultDirectory;
|
365 |
| - if (locationDir != null && locationDir.Length > 0 && Directory.Exists(locationDir)) |
| 361 | + if (!string.IsNullOrEmpty(locationDir) && Directory.Exists(locationDir)) |
366 | 362 | locationTextBox.Text = locationDir;
|
367 | 363 | else locationTextBox.Text = ProjectPaths.DefaultProjectsDirectory;
|
368 | 364 | locationTextBox.SelectionStart = locationTextBox.Text.Length;
|
@@ -566,15 +562,19 @@ private void browseButton_Click(object sender, System.EventArgs e)
|
566 | 562 |
|
567 | 563 | private void UpdateStatusBar()
|
568 | 564 | {
|
569 |
| - string sep = Path.DirectorySeparatorChar.ToString(); |
| 565 | + string status = string.Empty; |
570 | 566 | string ext = ProjectExt;
|
571 | 567 | if (ext != null)
|
572 | 568 | {
|
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); |
576 | 576 | }
|
577 |
| - else statusBar.Text = ""; |
| 577 | + statusBar.Text = status; |
578 | 578 | }
|
579 | 579 |
|
580 | 580 | private void locationTextBox_TextChanged(object sender, System.EventArgs e) { UpdateStatusBar(); }
|
|
0 commit comments