1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-10 21:33:46 +00:00

Fixed registry read exception.

This commit is contained in:
Ylian Saint-Hilaire
2020-04-05 12:43:31 -07:00
parent 9ecafc5af2
commit 503ed7bf08
5 changed files with 160 additions and 35 deletions

View File

@@ -23,11 +23,17 @@ namespace MeshCentralRouter
public void UpdateInfo()
{
if (parent.getShowGroupNames()) { deviceNameLabel.Text = mesh.name + ", " + node.name; } else { deviceNameLabel.Text = node.name; }
if (node.conn == 0) {
devicePictureBox.Image = disabledDeviceImageList.Images[node.icon - 1];
} else {
devicePictureBox.Image = deviceImageList.Images[node.icon - 1];
if (parent.getShowGroupNames() && (mesh != null)) { deviceNameLabel.Text = mesh.name + ", " + node.name; } else { deviceNameLabel.Text = node.name; }
if (node.icon > 1)
{
if (node.conn == 0)
{
devicePictureBox.Image = disabledDeviceImageList.Images[node.icon - 1];
}
else
{
devicePictureBox.Image = deviceImageList.Images[node.icon - 1];
}
}
string status = "";
@@ -51,10 +57,17 @@ namespace MeshCentralRouter
rdpButton.Visible = false;
}
// Compute rights on this device
ulong rights = node.rights;
if (mesh != null) { rights |= mesh.rights; }
// Must have remote control rights
if ((mesh.rights & 8) != 0) {
if ((rights & 8) != 0)
{
sshButton.Enabled = scpButton.Enabled = rdpButton.Enabled = httpsButton.Enabled = httpButton.Enabled = ((node.conn & 1) != 0);
} else {
}
else
{
sshButton.Enabled = scpButton.Enabled = rdpButton.Enabled = httpsButton.Enabled = httpButton.Enabled = false;
}
}