diff --git a/Action/ScheduleCommand.cs b/Action/ScheduleCommand.cs index 8e93e7e3..5959fc74 100644 --- a/Action/ScheduleCommand.cs +++ b/Action/ScheduleCommand.cs @@ -47,7 +47,7 @@ public void Run() // Notify the state of the command (success or failure) using (xmds.xmds statusXmds = new xmds.xmds()) { - statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; statusXmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, "{\"lastCommandSuccess\":" + success + "}"); } } diff --git a/Forms/OptionForm.cs b/Forms/OptionForm.cs index b44a918e..10aa9dd4 100644 --- a/Forms/OptionForm.cs +++ b/Forms/OptionForm.cs @@ -121,7 +121,7 @@ private void buttonSaveSettings_Click(object sender, EventArgs e) ApplicationSettings.Default.HardwareKey = tbHardwareKey.Text; // Also tweak the address of the xmds1 - xmds1.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds1.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=registerDisplay"; // Proxy Settings ApplicationSettings.Default.ProxyUser = textBoxProxyUser.Text; diff --git a/Log/ClientInfo.cs b/Log/ClientInfo.cs index f6669e23..941a8e02 100644 --- a/Log/ClientInfo.cs +++ b/Log/ClientInfo.cs @@ -363,7 +363,7 @@ public void notifyStatusToXmds() // Notify the state of the command (success or failure) using (xmds.xmds statusXmds = new xmds.xmds()) { - statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; statusXmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, sb.ToString()); } } diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index b4a2e601..100e9067 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -1,6 +1,6 @@ /* * Xibo - Digitial Signage - http://www.xibo.org.uk - * Copyright (C) 2006-17 Spring Signage Ltd + * Copyright (C) 2006-18 Spring Signage Ltd * * This file is part of Xibo. * @@ -40,9 +40,9 @@ public class ApplicationSettings private List _globalProperties; // Application Specific Settings we want to protect - private string _clientVersion = "1.8.3"; + private string _clientVersion = "1.8.8"; private string _version = "5"; - private int _clientCodeVersion = 130; + private int _clientCodeVersion = 131; public string ClientVersion { get { return _clientVersion; } } public string Version { get { return _version; } } diff --git a/Logic/RequiredFiles.cs b/Logic/RequiredFiles.cs index 5baa0c4a..20cf223d 100644 --- a/Logic/RequiredFiles.cs +++ b/Logic/RequiredFiles.cs @@ -91,7 +91,7 @@ public RequiredFiles() // Start up the Xmds Service Object _report.Credentials = null; - _report.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + _report.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=mediaInventory"; _report.UseDefaultCredentials = false; } diff --git a/Logic/ScreenShot.cs b/Logic/ScreenShot.cs index 2a221359..97a10a79 100644 --- a/Logic/ScreenShot.cs +++ b/Logic/ScreenShot.cs @@ -74,7 +74,7 @@ private static void send(Bitmap bitmap) using (xmds.xmds screenShotXmds = new xmds.xmds()) { - screenShotXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + screenShotXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=submitScreenshot"; screenShotXmds.SubmitScreenShotCompleted += screenShotXmds_SubmitScreenShotCompleted; screenShotXmds.SubmitScreenShotAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, bytes); } diff --git a/MainForm.cs b/MainForm.cs index 1b49768d..46029481 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -116,7 +116,7 @@ enum EXECUTION_STATE : uint public MainForm(IntPtr previewHandle) { InitializeComponent(); - + // Set the preview window of the screen saver selection // dialog in Windows as the parent of this form. SetParent(this.Handle, previewHandle); @@ -129,7 +129,7 @@ public MainForm(IntPtr previewHandle) // preview window in the screen saver selection dialog in Windows. Rectangle ParentRect; GetClientRect(previewHandle, out ParentRect); - + ApplicationSettings.Default.SizeX = ParentRect.Size.Width; ApplicationSettings.Default.SizeY = ParentRect.Size.Height; ApplicationSettings.Default.OffsetX = 0; @@ -145,7 +145,7 @@ public MainForm(bool screenSaver) if (screenSaver) InitializeScreenSaver(false); - + InitializeXibo(); } @@ -171,21 +171,11 @@ private void InitializeXibo() // Default the XmdsConnection ApplicationSettings.Default.XmdsLastConnection = DateTime.MinValue; - // Override the default size if necessary - if (ApplicationSettings.Default.SizeX != 0) - { - _clientSize = new Size((int)ApplicationSettings.Default.SizeX, (int)ApplicationSettings.Default.SizeY); - Size = _clientSize; - WindowState = FormWindowState.Normal; - Location = new Point((int)ApplicationSettings.Default.OffsetX, (int)ApplicationSettings.Default.OffsetY); - StartPosition = FormStartPosition.Manual; - } - else - { - _clientSize = SystemInformation.PrimaryMonitorSize; - ApplicationSettings.Default.SizeX = _clientSize.Width; - ApplicationSettings.Default.SizeY = _clientSize.Height; - } + // Set the Main Window Size + SetMainWindowSize(); + + // Bind to the resize event + Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged; // Show in taskbar ShowInTaskbar = ApplicationSettings.Default.ShowInTaskbar; @@ -251,7 +241,7 @@ private void InitializeXibo() #endif // An empty set of overlay regions _overlays = new Collection(); - + Trace.WriteLine(new LogMessage("MainForm", "Client Initialised"), LogType.Info.ToString()); } @@ -542,7 +532,7 @@ private void ChangeToNextLayout(string layoutPath) { using (xmds.xmds statusXmds = new xmds.xmds()) { - statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; statusXmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, "{\"currentLayoutId\":" + _layoutId + "}"); } } @@ -560,7 +550,7 @@ private void ChangeToNextLayout(string layoutPath) if (!_showingSplash) ShowSplashScreen(); - + // In 10 seconds fire the next layout System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 10000; @@ -620,7 +610,7 @@ private void PrepareLayout(string layoutPath) fs.Close(); } } - catch (IOException ioEx) + catch (IOException ioEx) { _cacheManager.Remove(layoutPath); Trace.WriteLine(new LogMessage("MainForm - PrepareLayout", "IOException: " + ioEx.ToString()), LogType.Error.ToString()); @@ -708,7 +698,7 @@ private void PrepareLayout(string layoutPath) catch (Exception ex) { Trace.WriteLine(new LogMessage("MainForm - PrepareLayout", "Unable to set background: " + ex.Message), LogType.Error.ToString()); - + // Assume there is no background image this.BackgroundImage = null; options.backgroundImage = ""; @@ -944,7 +934,7 @@ void temp_DurationElapsedEvent() } bool isExpired = true; - + // Check the other regions to see if they are also expired. foreach (Region temp in _regions) { @@ -968,7 +958,7 @@ void temp_DurationElapsedEvent() // We are changing the layout _changingLayout = true; - + // Yield and restart _schedule.NextLayout(); } @@ -977,11 +967,11 @@ void temp_DurationElapsedEvent() /// /// Disposes Layout - removes the controls /// - private void DestroyLayout() + private void DestroyLayout() { Debug.WriteLine("Destroying Layout", "MainForm - DestoryLayout"); - if (_regions == null) + if (_regions == null) return; lock (_regions) @@ -995,7 +985,7 @@ private void DestroyLayout() // Clear the region region.Clear(); - + Trace.WriteLine(new LogMessage("MainForm - DestoryLayout", "Calling Dispose on Region " + region.regionOptions.regionId), LogType.Audit.ToString()); region.Dispose(); } @@ -1254,5 +1244,46 @@ public void ManageOverlays(Collection overlays) Trace.WriteLine(new LogMessage("MainForm - _schedule_OverlayChangeEvent", "Unknown issue managing overlays. Ex = " + e.Message), LogType.Info.ToString()); } } + + /// + /// Set the Main Window Size, either to the primary monitor, or the configured size + /// + private void SetMainWindowSize() + { + // Override the default size if necessary + if (ApplicationSettings.Default.SizeX != 0) + { + _clientSize = new Size((int)ApplicationSettings.Default.SizeX, (int)ApplicationSettings.Default.SizeY); + Size = _clientSize; + WindowState = FormWindowState.Normal; + Location = new Point((int)ApplicationSettings.Default.OffsetX, (int)ApplicationSettings.Default.OffsetY); + StartPosition = FormStartPosition.Manual; + } + else + { + _clientSize = SystemInformation.PrimaryMonitorSize; + ApplicationSettings.Default.SizeX = _clientSize.Width; + ApplicationSettings.Default.SizeY = _clientSize.Height; + } + } + + /// + /// Display Settings Changed + /// + /// + /// + private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e) + { + Trace.WriteLine(new LogMessage("SystemEvents_DisplaySettingsChanged", "Display Settings have changed, resizing the Player window and moving on to the next Layout"), LogType.Info.ToString()); + + // Reassert the size of our client (should resize if necessary) + SetMainWindowSize(); + + // Expire the current layout and move on + _changingLayout = true; + + // Yield and restart + _schedule.NextLayout(); + } } } \ No newline at end of file diff --git a/Media/IeWebMedia.cs b/Media/IeWebMedia.cs index 96b15a55..9ffa20ac 100644 --- a/Media/IeWebMedia.cs +++ b/Media/IeWebMedia.cs @@ -205,7 +205,7 @@ private void ReadControlMeta() private void RefreshFromXmds() { xmds.xmds xmds = new XiboClient.xmds.xmds(); - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=getResource"; xmds.GetResourceCompleted += new XiboClient.xmds.GetResourceCompletedEventHandler(xmds_GetResourceCompleted); xmds.GetResourceAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, _options.layoutId, _options.regionId, _options.mediaid, ApplicationSettings.Default.Version); diff --git a/Media/ShellCommand.cs b/Media/ShellCommand.cs index 34e9a833..179f32a0 100644 --- a/Media/ShellCommand.cs +++ b/Media/ShellCommand.cs @@ -70,7 +70,7 @@ public override void RenderMedia() // Notify the state of the command (success or failure) using (xmds.xmds statusXmds = new xmds.xmds()) { - statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + statusXmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; statusXmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, "{\"lastCommandSuccess\":" + success + "}"); } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 938e014a..cfe0ae89 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xibo Digital Signage")] [assembly: AssemblyProduct("Xibo")] -[assembly: AssemblyCopyright("Copyright Dan Garner © 2008-2017")] +[assembly: AssemblyCopyright("Copyright Dan Garner © 2008-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -30,6 +30,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("10.8.2.0")] -[assembly: AssemblyFileVersion("10.8.2.0")] +[assembly: AssemblyVersion("10.8.8.0")] +[assembly: AssemblyFileVersion("10.8.8.0")] [assembly: NeutralResourcesLanguageAttribute("en-GB")] diff --git a/XmdsAgents/FileAgent.cs b/XmdsAgents/FileAgent.cs index b6d13fce..1ad04b0f 100644 --- a/XmdsAgents/FileAgent.cs +++ b/XmdsAgents/FileAgent.cs @@ -1,6 +1,6 @@ /* * Xibo - Digitial Signage - http://www.xibo.org.uk - * Copyright (C) 2006 - 2012 Daniel Garner + * Copyright (C) 2006 - 2017 Spring Signage Ltd * * This file is part of Xibo. * @@ -144,7 +144,7 @@ public void Run() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=getResource"; xmds.UseDefaultCredentials = true; string result = xmds.GetResource(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, file.LayoutId, file.RegionId, file.MediaId); @@ -204,7 +204,7 @@ public void Run() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=getFile"; xmds.UseDefaultCredentials = false; getFileReturn = xmds.GetFile(ApplicationSettings.Default.ServerKey, _hardwareKey, file.Id, file.FileType, file.ChunkOffset, file.ChunkSize); diff --git a/XmdsAgents/LogAgent.cs b/XmdsAgents/LogAgent.cs index 82f37862..4271b9a5 100644 --- a/XmdsAgents/LogAgent.cs +++ b/XmdsAgents/LogAgent.cs @@ -76,12 +76,14 @@ public void Run() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=submitLog"; xmds.UseDefaultCredentials = false; // Log ProcessFiles(xmds, key.Key, ApplicationSettings.Default.LogLocation); + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=submitStats"; + // Stat ProcessFiles(xmds, key.Key, ApplicationSettings.Default.StatsLogFile); } diff --git a/XmdsAgents/RegisterAgent.cs b/XmdsAgents/RegisterAgent.cs index 93fbbb7d..90f626af 100644 --- a/XmdsAgents/RegisterAgent.cs +++ b/XmdsAgents/RegisterAgent.cs @@ -81,7 +81,7 @@ public void Run() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=registerDisplay"; xmds.UseDefaultCredentials = false; // Store the XMR address @@ -206,7 +206,7 @@ private void reportTimezone() string status = "{\"timeZone\":\"" + WindowsToIana(TimeZone.CurrentTimeZone.StandardName) + "\"}"; xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; xmds.UseDefaultCredentials = false; xmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, status); } diff --git a/XmdsAgents/ScheduleAndFilesAgent.cs b/XmdsAgents/ScheduleAndFilesAgent.cs index 1dd0eedc..aaced973 100644 --- a/XmdsAgents/ScheduleAndFilesAgent.cs +++ b/XmdsAgents/ScheduleAndFilesAgent.cs @@ -177,7 +177,7 @@ public void Run() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=requiredFiles"; xmds.UseDefaultCredentials = false; // Get required files from XMDS @@ -369,7 +369,7 @@ private void reportStorage() string status = "{\"availableSpace\":\"" + drive.TotalFreeSpace + "\", \"totalSpace\":\"" + drive.TotalSize + "\", \"deviceName\":\"" + Environment.MachineName + "\"}"; xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=notifyStatus"; xmds.UseDefaultCredentials = false; xmds.NotifyStatusAsync(ApplicationSettings.Default.ServerKey, ApplicationSettings.Default.HardwareKey, status); } @@ -396,7 +396,7 @@ private void scheduleAgent() using (xmds.xmds xmds = new xmds.xmds()) { xmds.Credentials = null; - xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds; + xmds.Url = ApplicationSettings.Default.XiboClient_xmds_xmds + "&method=schedule"; xmds.UseDefaultCredentials = false; string scheduleXml = xmds.Schedule(ApplicationSettings.Default.ServerKey, _hardwareKey);