@@ -98,7 +98,9 @@ public FDMenus(IMainForm mainForm)
98
98
99
99
public void EnableTargetBuildSelector ( bool enabled )
100
100
{
101
+ var target = TargetBuildSelector . Text ; // prevent occasional loss of value when the control is disabled
101
102
TargetBuildSelector . Enabled = enabled ;
103
+ TargetBuildSelector . Text = target ;
102
104
}
103
105
104
106
public bool DisabledForBuild
@@ -139,18 +141,26 @@ public void ProjectChanged(Project project)
139
141
{
140
142
TargetBuildSelector . Items . AddRange ( project . MovieOptions . TargetBuildTypes ) ;
141
143
string target = project . TargetBuild ?? project . MovieOptions . TargetBuildTypes [ 0 ] ;
142
- if ( ! String . IsNullOrEmpty ( target ) && ! TargetBuildSelector . Items . Contains ( target ) ) TargetBuildSelector . Items . Insert ( 0 , target ) ;
144
+ AddTargetBuild ( target ) ;
143
145
TargetBuildSelector . Text = target ;
144
146
}
145
147
else
146
148
{
147
149
string target = project . TargetBuild ?? "" ;
148
- if ( target != "" ) TargetBuildSelector . Items . Insert ( 0 , target ) ;
150
+ AddTargetBuild ( target ) ;
149
151
TargetBuildSelector . Text = target ;
150
152
}
151
153
EnableTargetBuildSelector ( true ) ;
152
154
}
153
155
156
+ internal void AddTargetBuild ( string target )
157
+ {
158
+ if ( target == null ) return ;
159
+ target = target . Trim ( ) ;
160
+ if ( target . Length > 0 && ! TargetBuildSelector . Items . Contains ( target ) )
161
+ TargetBuildSelector . Items . Insert ( 0 , target ) ;
162
+ }
163
+
154
164
155
165
public void ToggleDebugRelease ( )
156
166
{
0 commit comments