@@ -28,6 +28,7 @@ private void buttonConnect_Click(object sender, EventArgs e)
2828 {
2929 panelProperties . Enabled = true ;
3030 tabsControl . Enabled = true ;
31+ buttonMisc . Enabled = true ;
3132 textIP . Enabled = false ;
3233 textPort . Enabled = false ;
3334 textPriority . Enabled = false ;
@@ -45,6 +46,7 @@ private void buttonConnect_Click(object sender, EventArgs e)
4546 listLights . Items . Clear ( ) ;
4647 panelProperties . Enabled = false ;
4748 tabsControl . Enabled = false ;
49+ buttonMisc . Enabled = false ;
4850 textIP . Enabled = true ;
4951 textPort . Enabled = true ;
5052 textPriority . Enabled = true ;
@@ -119,8 +121,11 @@ private void buttonMisc_Click(object sender, EventArgs e)
119121 if ( tabsControl . SelectedIndex == tabLights . TabIndex )
120122 {
121123 string groupName = Interaction . InputBox ( "Please enter a name for this light group:" , "New Light Group" ) ;
122- listGroups . Items . Add ( new lightGroup ( getSelectedLights ( ) , groupName ) ) ;
123- tabsControl . SelectedIndex = tabGroups . TabIndex ;
124+ if ( ! String . IsNullOrWhiteSpace ( groupName ) && listLights . SelectedItems . Count != 0 )
125+ {
126+ listGroups . Items . Add ( new lightGroup ( getSelectedLights ( ) , groupName ) ) ;
127+ tabsControl . SelectedIndex = tabGroups . TabIndex ;
128+ }
124129 }
125130 else if ( tabsControl . SelectedIndex == tabGroups . TabIndex )
126131 {
0 commit comments