Skip to content

Commit bb120c4

Browse files
committed
Grouping improvements
1 parent 8decd31 commit bb120c4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

boblightGUI.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

boblightGUI.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)