Skip to content

Commit 4742fa3

Browse files
solve merge error
1 parent 6013d73 commit 4742fa3

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Source/Menu/DownloadContentForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private async void DownloadContentButton_Click(object sender, EventArgs e)
204204
string topPathDirectoryExe = determineTopDirectory(pathDirectoryExe.Substring(6));
205205
string topInstallPath = determineTopDirectory(installPath);
206206

207-
if (OptionsForm.isWrongPath(installPath, Catalog)) {
207+
if (OptionsForm.ContentFolder.isWrongPath(installPath, Catalog)) {
208208
// cancelled
209209
EnableButtons();
210210
return;

Source/Menu/Options.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ public ContentFolder()
5656
Name = "";
5757
Path = "";
5858
}
59+
60+
public static bool isWrongPath(string path, GettextResourceManager catalog)
61+
{
62+
if (path.ToLower().Contains(Application.StartupPath.ToLower()))
63+
{
64+
// check added because a succesful Update operation will empty the Open Rails folder and lose any content stored within it.
65+
MessageBox.Show(catalog.GetString
66+
($"Cannot use content from any folder which lies inside the Open Rails program folder {Application.StartupPath}\n\n")
67+
, "Invalid content location"
68+
, MessageBoxButtons.OK
69+
, MessageBoxIcon.Error);
70+
return true;
71+
}
72+
73+
return false;
74+
}
5975
}
6076

6177
public OptionsForm(UserSettings settings, UpdateManager updateManager, bool initialContentSetup)
@@ -728,7 +744,7 @@ private void textBoxContentName_TextChanged(object sender, EventArgs e)
728744
var current = bindingSourceContent.Current as ContentFolder;
729745
if (current != null && current.Name != textBoxContentName.Text)
730746
{
731-
if (isWrongPath(current.Path, catalog))
747+
if (ContentFolder.isWrongPath(current.Path, catalog))
732748
{
733749
DeleteContent();
734750
return;
@@ -786,22 +802,6 @@ private void checkPerformanceTuner_Click(object sender, EventArgs e)
786802
labelPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
787803
}
788804

789-
public static bool isWrongPath(string path, GettextResourceManager catalog)
790-
{
791-
if (path.ToLower().Contains(Application.StartupPath.ToLower()))
792-
{
793-
// check added because a succesful Update operation will empty the Open Rails folder and lose any content stored within it.
794-
MessageBox.Show(catalog.GetString
795-
($"Cannot use content from any folder which lies inside the Open Rails program folder {Application.StartupPath}\n\n")
796-
, "Invalid content location"
797-
, MessageBoxButtons.OK
798-
, MessageBoxIcon.Error);
799-
return true;
800-
}
801-
802-
return false;
803-
}
804-
805805
#region Help for Options
806806
// The icons all share the same code which assumes they are named according to a simple scheme as follows:
807807
// 1. To add a new Help Icon, copy an existing one and paste it onto the tab.

0 commit comments

Comments
 (0)