File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,11 @@ private void buttonContentAdd_Click(object sender, EventArgs e)
674674 }
675675
676676 private void buttonContentDelete_Click ( object sender , EventArgs e )
677+ {
678+ DeleteContent ( ) ;
679+ }
680+
681+ private void DeleteContent ( )
677682 {
678683 bindingSourceContent . RemoveCurrent ( ) ;
679684 // ResetBindings() is to work around a bug in the binding and/or data grid where by deleting the bottom item doesn't show the selection moving to the new bottom item.
@@ -713,7 +718,19 @@ private void textBoxContentName_TextChanged(object sender, EventArgs e)
713718 var current = bindingSourceContent . Current as ContentFolder ;
714719 if ( current != null && current . Name != textBoxContentName . Text )
715720 {
716- // Duplicate names lead to an exception, so append " copy" if not unique
721+ if ( current . Path . ToLower ( ) . Contains ( Application . StartupPath . ToLower ( ) ) )
722+ {
723+ // Block added because a succesful Update operation will empty the Open Rails folder and lose any content stored within it.
724+ MessageBox . Show ( catalog . GetString
725+ ( $ "Cannot use content from any folder which lies inside the Open Rails folder { Application . StartupPath } \n \n ")
726+ , "Invalid content location"
727+ , MessageBoxButtons . OK
728+ , MessageBoxIcon . Error ) ;
729+ DeleteContent ( ) ;
730+ return ;
731+ }
732+
733+ // Duplicate names lead to an exception, so append " copy" repeatedly until no longer unique
717734 var suffix = "" ;
718735 var isNameUnique = true ;
719736 while ( isNameUnique )
You can’t perform that action at this time.
0 commit comments