@@ -113,7 +113,7 @@ private void CheckGitBashPathInWinPath()
113113 private static bool IsInWinPath ( string substring )
114114 {
115115 bool result = false ;
116- string winPath = Environment . GetEnvironmentVariable ( "Path" , EnvironmentVariableTarget . Machine ) ;
116+ string winPath = Environment . GetEnvironmentVariable ( "Path" , EnvironmentVariableTarget . Machine ) ;
117117 if ( winPath != null ) result = winPath . Contains ( substring ) ;
118118 return result ;
119119 }
@@ -651,7 +651,7 @@ private string Translate(string index) // could add (string index, string _curre
651651
652652 return result ;
653653 }
654-
654+
655655 private static Control FindFocusedControl ( List < Control > container )
656656 {
657657 return container . FirstOrDefault ( control => control . Focused ) ;
@@ -995,7 +995,7 @@ private static bool IsInlistView(ListView listView, ListViewItem lviItem, int co
995995
996996 return result ;
997997 }
998-
998+
999999 private static bool NotHavingWords ( string source , IEnumerable < string > badWords , bool caseSensitive = false )
10001000 {
10011001 bool result = true ;
@@ -1021,7 +1021,7 @@ private static bool NotHavingWords(string source, IEnumerable<string> badWords,
10211021 {
10221022 string tmpbadWord = badWord . Trim ( ) . ToLower ( ) ;
10231023 string tmpSource = source . Trim ( ) . ToLower ( ) ;
1024- if ( tmpSource . Contains ( tmpbadWord ) )
1024+ if ( tmpSource . Contains ( tmpbadWord ) )
10251025 {
10261026 result = false ;
10271027 break ;
@@ -1471,12 +1471,12 @@ private void buttonAddGitBinaryToWinPath_Click(object sender, EventArgs e)
14711471 return ;
14721472 }
14731473
1474- winPath += Punctuation . SemiColon + Punctuation . Backslash +
1474+ winPath += Punctuation . SemiColon + Punctuation . Backslash +
14751475 textBoxGitBashBinariesPath . Text . Substring ( 0 , textBoxGitBashBinariesPath . Text . Length - 8 ) ;
14761476#if Debug
14771477 MessageBox . Show ( "Here is your modifed Windows Path variable: " + winPath ) ;
14781478#endif
1479- bool additionSuccessful = false ;
1479+ bool additionSuccessful ;
14801480 try
14811481 {
14821482 Environment . SetEnvironmentVariable ( "Path" , winPath , EnvironmentVariableTarget . Machine ) ;
@@ -1485,23 +1485,36 @@ private void buttonAddGitBinaryToWinPath_Click(object sender, EventArgs e)
14851485 catch ( SecurityException securityException )
14861486 {
14871487 additionSuccessful = false ;
1488- Logger . Add ( textBoxLog , Translate ( "There was a security error, probably lack of rights" ) + Punctuation . Colon +
1489- Punctuation . OneSpace + securityException . Message ) ;
1488+ Logger . Add ( textBoxLog , Translate ( "There was a security error" ) +
1489+ Punctuation . Comma + Punctuation . OneSpace +
1490+ Translate ( "probably lack of rights" ) +
1491+ Punctuation . Colon + Punctuation . OneSpace +
1492+ securityException . Message ) ;
14901493 }
14911494 catch ( Exception exception )
14921495 {
14931496 additionSuccessful = false ;
14941497 Logger . Add ( textBoxLog , Translate ( "There was an error" ) + Punctuation . Colon +
1495- Punctuation . OneSpace + exception . Message ) ;
1498+ Punctuation . CrLf + exception . Message ) ;
14961499 }
14971500
14981501 if ( additionSuccessful )
14991502 {
1500- DisplayMessageOk ( Translate ( "" ) , Translate ( "" ) , MessageBoxButtons . OK ) ;
1503+ string message = Translate ( "The following path" ) + Punctuation . Colon + Punctuation . CrLf +
1504+ textBoxGitBashBinariesPath . Text . Substring ( 0 , textBoxGitBashBinariesPath . Text . Length - 8 ) +
1505+ Punctuation . CrLf + Translate ( "has been added to the Windows Path variable" ) +
1506+ Punctuation . CrLf + Translate ( "YOU HAVE TO REBOOT YOUR PC FOR THE VARIABLE TO BE TAKEN INTO EFFECT" ) ;
1507+ Logger . Add ( textBoxLog , message ) ;
1508+ DisplayMessageOk ( message , Translate ( "Path added" ) , MessageBoxButtons . OK ) ;
15011509 }
15021510 else
15031511 {
1504- DisplayMessageOk ( Translate ( "" ) , Translate ( "" ) , MessageBoxButtons . OK ) ;
1512+ string message = Translate ( "The following path" ) + Punctuation . Colon + Punctuation . CrLf +
1513+ textBoxGitBashBinariesPath . Text . Substring ( 0 , textBoxGitBashBinariesPath . Text . Length - 8 ) +
1514+ Punctuation . CrLf + Translate ( "has not been added to the Windows Path variable" ) +
1515+ Punctuation . CrLf + Translate ( "Check with the developer" ) ;
1516+ Logger . Add ( textBoxLog , message ) ;
1517+ DisplayMessageOk ( message , Translate ( "Error" ) , MessageBoxButtons . OK ) ;
15051518 }
15061519 }
15071520 }
0 commit comments