@@ -141,6 +141,8 @@ public ContentForm(UserSettings settings, string baseDocumentationUrl)
141141
142142 ManualInstallBrouwseDir = determineBrowseDir ( ) ;
143143 buttonCancel . Enabled = false ;
144+
145+ setTextBoxesManualInstall ( ) ;
144146 }
145147
146148 void changeManualInstallRoute ( string Route )
@@ -1563,6 +1565,7 @@ private void setTextBoxesManualInstall()
15631565 }
15641566 else
15651567 {
1568+ // route automatically installed
15661569 textBoxManualInstallRoute . Text = "" ;
15671570 textBoxManualInstallPath . Text = "" ;
15681571 textBoxManualInstallRoute . Enabled = false ;
@@ -1571,26 +1574,47 @@ private void setTextBoxesManualInstall()
15711574 buttonManualInstallDelete . Enabled = false ;
15721575 }
15731576 }
1577+ else
1578+ {
1579+ // empty form, like after installing OR
1580+ textBoxManualInstallRoute . Text = "" ;
1581+ textBoxManualInstallPath . Text = "" ;
1582+ textBoxManualInstallRoute . Enabled = false ;
1583+ textBoxManualInstallPath . Enabled = false ;
1584+ buttonManualInstallBrowse . Enabled = false ;
1585+ buttonManualInstallDelete . Enabled = false ;
1586+ }
15741587 }
15751588
15761589 string determineUniqueRoute ( string Route )
15771590 {
15781591 string route = Route ;
15791592 long seqNr = 0 ;
1580- bool found = false ;
1593+ bool foundUniqueRoute = false ;
15811594
1582- while ( ! found )
1595+ if ( AutoInstallRoutes . ContainsKey ( route ) )
15831596 {
1584- found = true ;
1597+ // route already exists in the AutoInstall routes
1598+ seqNr = 1 ;
1599+ route = Route + " (" + seqNr + ")" ;
1600+ }
1601+
1602+ while ( ! foundUniqueRoute )
1603+ {
1604+ bool found = false ;
15851605 for ( int i = 0 ; i < dataGridViewManualInstall . Rows . Count ; i ++ )
15861606 {
1587- if ( ( ( ! dataGridViewManualInstall . Rows [ i ] . Selected ) ) && ( dataGridViewManualInstall . Rows [ i ] . Cells [ 0 ] . Value . ToString ( ) == route ) ||
1588- ( AutoInstallRoutes . ContainsKey ( route ) ) ) {
1607+ if ( ( ! dataGridViewManualInstall . Rows [ i ] . Selected ) && ( dataGridViewManualInstall . Rows [ i ] . Cells [ 0 ] . Value . ToString ( ) == route ) )
1608+ {
15891609 seqNr ++ ;
15901610 route = Route + " (" + seqNr + ")" ;
1591- found = false ;
1611+ found = true ;
15921612 }
15931613 }
1614+ if ( ! found )
1615+ {
1616+ foundUniqueRoute = true ;
1617+ }
15941618 }
15951619
15961620 return route ;
0 commit comments