Skip to content

Commit

Permalink
Merge pull request #57 from xibosignage/develop
Browse files Browse the repository at this point in the history
Release 1.8.8
  • Loading branch information
dasgarner authored Apr 5, 2018
2 parents ef0a017 + b40f1de commit 058dd23
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Action/ScheduleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "}");
}
}
Expand Down
2 changes: 1 addition & 1 deletion Forms/OptionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Log/ClientInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down
6 changes: 3 additions & 3 deletions Logic/ApplicationSettings.cs
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -40,9 +40,9 @@ public class ApplicationSettings
private List<string> _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; } }
Expand Down
2 changes: 1 addition & 1 deletion Logic/RequiredFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Logic/ScreenShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
87 changes: 59 additions & 28 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -145,7 +145,7 @@ public MainForm(bool screenSaver)

if (screenSaver)
InitializeScreenSaver(false);

InitializeXibo();
}

Expand All @@ -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;
Expand Down Expand Up @@ -251,7 +241,7 @@ private void InitializeXibo()
#endif
// An empty set of overlay regions
_overlays = new Collection<Region>();

Trace.WriteLine(new LogMessage("MainForm", "Client Initialised"), LogType.Info.ToString());
}

Expand Down Expand Up @@ -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 + "}");
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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)
{
Expand All @@ -968,7 +958,7 @@ void temp_DurationElapsedEvent()

// We are changing the layout
_changingLayout = true;

// Yield and restart
_schedule.NextLayout();
}
Expand All @@ -977,11 +967,11 @@ void temp_DurationElapsedEvent()
/// <summary>
/// Disposes Layout - removes the controls
/// </summary>
private void DestroyLayout()
private void DestroyLayout()
{
Debug.WriteLine("Destroying Layout", "MainForm - DestoryLayout");

if (_regions == null)
if (_regions == null)
return;

lock (_regions)
Expand All @@ -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();
}
Expand Down Expand Up @@ -1254,5 +1244,46 @@ public void ManageOverlays(Collection<ScheduleItem> overlays)
Trace.WriteLine(new LogMessage("MainForm - _schedule_OverlayChangeEvent", "Unknown issue managing overlays. Ex = " + e.Message), LogType.Info.ToString());
}
}

/// <summary>
/// Set the Main Window Size, either to the primary monitor, or the configured size
/// </summary>
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;
}
}

/// <summary>
/// Display Settings Changed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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();
}
}
}
2 changes: 1 addition & 1 deletion Media/IeWebMedia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Media/ShellCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "}");
}
}
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("")]

Expand All @@ -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")]
6 changes: 3 additions & 3 deletions XmdsAgents/FileAgent.cs
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion XmdsAgents/LogAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions XmdsAgents/RegisterAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions XmdsAgents/ScheduleAndFilesAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down

0 comments on commit 058dd23

Please sign in to comment.