Recording notification icon now functional.
authorStephaneLenclud
Thu, 21 Jan 2016 20:13:05 +0100
changeset 1803500fe1ad785
parent 179 533eb8a80d56
child 181 503b711d5e8c
Recording notification icon now functional.
Server/MainForm.cs
     1.1 --- a/Server/MainForm.cs	Thu Jan 21 18:16:15 2016 +0100
     1.2 +++ b/Server/MainForm.cs	Thu Jan 21 20:13:05 2016 +0100
     1.3 @@ -595,7 +595,7 @@
     1.4          {
     1.5              iRecordingNotification.Icon = GetIcon("record.ico");
     1.6              iRecordingNotification.Text = "No recording";
     1.7 -            iRecordingNotification.Visible = true;
     1.8 +            iRecordingNotification.Visible = false;
     1.9          }
    1.10  
    1.11          /// <summary>
    1.12 @@ -1759,6 +1759,35 @@
    1.13          }
    1.14  
    1.15          /// <summary>
    1.16 +        /// Update our recording notification.
    1.17 +        /// </summary>
    1.18 +        private void UpdateRecordingNotification()
    1.19 +        {
    1.20 +            //Go through each 
    1.21 +            bool activeRecording = false;
    1.22 +            string text="";
    1.23 +            RecordingField recField=new RecordingField();
    1.24 +            foreach (var client in iClients)
    1.25 +            {
    1.26 +                RecordingField rec=(RecordingField)client.Value.FindSameFieldAs(recField);
    1.27 +                if (rec!=null && rec.IsActive)
    1.28 +                {
    1.29 +                    activeRecording = true;
    1.30 +                    //Don't break cause we are collecting the names.
    1.31 +                    text += client.Value.Name + " recording\n";
    1.32 +                }
    1.33 +            }
    1.34 +
    1.35 +            //Change visibility of notification if needed
    1.36 +            if (iRecordingNotification.Visible != activeRecording)
    1.37 +            {
    1.38 +                iRecordingNotification.Text = text;
    1.39 +                iRecordingNotification.Visible = activeRecording;
    1.40 +
    1.41 +            }
    1.42 +        }
    1.43 +
    1.44 +        /// <summary>
    1.45          ///
    1.46          /// </summary>
    1.47          /// <param name="aClient"></param>
    1.48 @@ -1771,6 +1800,9 @@
    1.49                  return;
    1.50              }
    1.51  
    1.52 +            //Hook in record icon update too
    1.53 +            UpdateRecordingNotification();
    1.54 +
    1.55              TreeNode node = null;
    1.56              //Check that our client node already exists
    1.57              //Get our client root node using its key which is our session ID