Merge lp:~dangarner/xibo/client-141 into lp:~xibo-maintainers/xibo/d-arrest
- client-141
- Merge into d-arrest
Proposed by
Dan Garner
Status: | Merged | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 262 | ||||||||||||||||||||||||
Proposed branch: | lp:~dangarner/xibo/client-141 | ||||||||||||||||||||||||
Merge into: | lp:~xibo-maintainers/xibo/d-arrest | ||||||||||||||||||||||||
Diff against target: |
678 lines (+223/-79) 13 files modified
client/dotNET/MainForm.cs (+40/-3) client/dotNET/OptionForm.Designer.cs (+46/-18) client/dotNET/OptionForm.cs (+2/-0) client/dotNET/Properties/Settings.Designer.cs (+13/-1) client/dotNET/Properties/Settings.settings (+4/-1) client/dotNET/Region.cs (+2/-0) client/dotNET/Resources/HtmlTemplate.htm (+24/-16) client/dotNET/Rss.cs (+45/-31) client/dotNET/Text.cs (+7/-4) client/dotNET/Video.cs (+4/-1) client/dotNET/WebContent.cs (+20/-3) client/dotNET/XiboClient.csproj (+12/-0) client/dotNET/app.config (+4/-1) |
||||||||||||||||||||||||
To merge this branch: | bzr merge lp:~dangarner/xibo/client-141 | ||||||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xibo Maintainters | Pending | ||
Review via email: mp+137427@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/dotNET/MainForm.cs' |
2 | --- client/dotNET/MainForm.cs 2012-08-23 06:16:17 +0000 |
3 | +++ client/dotNET/MainForm.cs 2012-12-02 17:36:23 +0000 |
4 | @@ -159,12 +159,15 @@ |
5 | Directory.CreateDirectory(Properties.Settings.Default.LibraryPath + @"\backgrounds"); |
6 | } |
7 | |
8 | - // Hide the cursor |
9 | - Cursor.Position = new Point(_clientSize.Width, _clientSize.Height); |
10 | - |
11 | + // Is the mouse enabled? |
12 | if (!Properties.Settings.Default.EnableMouse) |
13 | + // Hide the cursor |
14 | Cursor.Hide(); |
15 | |
16 | + // Move the cursor to the starting place |
17 | + SetCursorStartPosition(); |
18 | + |
19 | + // Show the splash screen |
20 | ShowSplashScreen(); |
21 | |
22 | // Change the default Proxy class |
23 | @@ -504,6 +507,10 @@ |
24 | options.top = (int)(double.Parse(nodeAttibutes["top"].Value) * _scaleFactor); |
25 | options.scaleFactor = _scaleFactor; |
26 | |
27 | + // Store the original width and original height for scaling |
28 | + options.originalWidth = Convert.ToInt32(nodeAttibutes["width"].Value); |
29 | + options.originalHeight = Convert.ToInt32(nodeAttibutes["height"].Value); |
30 | + |
31 | // Set the backgrounds (used for Web content offsets) |
32 | options.backgroundLeft = options.left * -1; |
33 | options.backgroundTop = options.top * -1; |
34 | @@ -666,6 +673,36 @@ |
35 | } |
36 | |
37 | /// <summary> |
38 | + /// Set the Cursor start position |
39 | + /// </summary> |
40 | + private void SetCursorStartPosition() |
41 | + { |
42 | + Point position; |
43 | + |
44 | + switch (Settings.Default.CursorStartPosition) |
45 | + { |
46 | + case "Top Left": |
47 | + position = new Point(0, 0); |
48 | + break; |
49 | + |
50 | + case "Top Right": |
51 | + position = new Point(_clientSize.Width, 0); |
52 | + break; |
53 | + |
54 | + case "Bottom Left": |
55 | + position = new Point(0, _clientSize.Height); |
56 | + break; |
57 | + |
58 | + case "Bottom Right": |
59 | + default: |
60 | + position = new Point(_clientSize.Width, _clientSize.Height); |
61 | + break; |
62 | + } |
63 | + |
64 | + Cursor.Position = position; |
65 | + } |
66 | + |
67 | + /// <summary> |
68 | /// Force a flush of the stats log |
69 | /// </summary> |
70 | public void FlushStats() |
71 | |
72 | === modified file 'client/dotNET/OptionForm.Designer.cs' |
73 | --- client/dotNET/OptionForm.Designer.cs 2012-08-04 11:12:39 +0000 |
74 | +++ client/dotNET/OptionForm.Designer.cs 2012-12-02 17:36:23 +0000 |
75 | @@ -82,6 +82,8 @@ |
76 | this.clientHeight = new System.Windows.Forms.NumericUpDown(); |
77 | this.clientWidth = new System.Windows.Forms.NumericUpDown(); |
78 | this.tabPage5 = new System.Windows.Forms.TabPage(); |
79 | + this.logToDiskLocation = new System.Windows.Forms.TextBox(); |
80 | + this.label21 = new System.Windows.Forms.Label(); |
81 | this.showInTaskbar = new System.Windows.Forms.CheckBox(); |
82 | this.label20 = new System.Windows.Forms.Label(); |
83 | this.logLevel = new System.Windows.Forms.ComboBox(); |
84 | @@ -102,8 +104,8 @@ |
85 | this.folderBrowserLibrary = new System.Windows.Forms.FolderBrowserDialog(); |
86 | this.splashScreenOverride = new System.Windows.Forms.OpenFileDialog(); |
87 | this.xmds1 = new XiboClient.xmds.xmds(); |
88 | - this.label21 = new System.Windows.Forms.Label(); |
89 | - this.logToDiskLocation = new System.Windows.Forms.TextBox(); |
90 | + this.label22 = new System.Windows.Forms.Label(); |
91 | + this.cursorStartPosition = new System.Windows.Forms.ComboBox(); |
92 | this.tabControl1.SuspendLayout(); |
93 | this.tabPage1.SuspendLayout(); |
94 | ((System.ComponentModel.ISupportInitialize)(this.nupScrollStepAmount)).BeginInit(); |
95 | @@ -682,6 +684,8 @@ |
96 | // |
97 | // tabPage5 |
98 | // |
99 | + this.tabPage5.Controls.Add(this.cursorStartPosition); |
100 | + this.tabPage5.Controls.Add(this.label22); |
101 | this.tabPage5.Controls.Add(this.logToDiskLocation); |
102 | this.tabPage5.Controls.Add(this.label21); |
103 | this.tabPage5.Controls.Add(this.showInTaskbar); |
104 | @@ -703,10 +707,26 @@ |
105 | this.tabPage5.Text = "Advanced"; |
106 | this.tabPage5.UseVisualStyleBackColor = true; |
107 | // |
108 | + // logToDiskLocation |
109 | + // |
110 | + this.logToDiskLocation.Location = new System.Drawing.Point(176, 176); |
111 | + this.logToDiskLocation.Name = "logToDiskLocation"; |
112 | + this.logToDiskLocation.Size = new System.Drawing.Size(121, 20); |
113 | + this.logToDiskLocation.TabIndex = 19; |
114 | + // |
115 | + // label21 |
116 | + // |
117 | + this.label21.AutoSize = true; |
118 | + this.label21.Location = new System.Drawing.Point(20, 179); |
119 | + this.label21.Name = "label21"; |
120 | + this.label21.Size = new System.Drawing.Size(105, 13); |
121 | + this.label21.TabIndex = 18; |
122 | + this.label21.Text = "Log to Disk Location"; |
123 | + // |
124 | // showInTaskbar |
125 | // |
126 | this.showInTaskbar.AutoSize = true; |
127 | - this.showInTaskbar.Location = new System.Drawing.Point(176, 206); |
128 | + this.showInTaskbar.Location = new System.Drawing.Point(176, 238); |
129 | this.showInTaskbar.Name = "showInTaskbar"; |
130 | this.showInTaskbar.Size = new System.Drawing.Size(130, 17); |
131 | this.showInTaskbar.TabIndex = 17; |
132 | @@ -876,21 +896,27 @@ |
133 | this.xmds1.Url = "http://localhost/Xibo/server/xmds.php"; |
134 | this.xmds1.UseDefaultCredentials = false; |
135 | // |
136 | - // label21 |
137 | - // |
138 | - this.label21.AutoSize = true; |
139 | - this.label21.Location = new System.Drawing.Point(20, 179); |
140 | - this.label21.Name = "label21"; |
141 | - this.label21.Size = new System.Drawing.Size(105, 13); |
142 | - this.label21.TabIndex = 18; |
143 | - this.label21.Text = "Log to Disk Location"; |
144 | - // |
145 | - // logToDiskLocation |
146 | - // |
147 | - this.logToDiskLocation.Location = new System.Drawing.Point(176, 176); |
148 | - this.logToDiskLocation.Name = "logToDiskLocation"; |
149 | - this.logToDiskLocation.Size = new System.Drawing.Size(121, 20); |
150 | - this.logToDiskLocation.TabIndex = 19; |
151 | + // label22 |
152 | + // |
153 | + this.label22.AutoSize = true; |
154 | + this.label22.Location = new System.Drawing.Point(23, 206); |
155 | + this.label22.Name = "label22"; |
156 | + this.label22.Size = new System.Drawing.Size(102, 13); |
157 | + this.label22.TabIndex = 20; |
158 | + this.label22.Text = "Cursor Start Position"; |
159 | + // |
160 | + // cursorStartPosition |
161 | + // |
162 | + this.cursorStartPosition.FormattingEnabled = true; |
163 | + this.cursorStartPosition.Items.AddRange(new object[] { |
164 | + "Top Left", |
165 | + "Top Right", |
166 | + "Bottom Left", |
167 | + "Bottom Right"}); |
168 | + this.cursorStartPosition.Location = new System.Drawing.Point(176, 203); |
169 | + this.cursorStartPosition.Name = "cursorStartPosition"; |
170 | + this.cursorStartPosition.Size = new System.Drawing.Size(121, 21); |
171 | + this.cursorStartPosition.TabIndex = 21; |
172 | // |
173 | // OptionForm |
174 | // |
175 | @@ -1009,5 +1035,7 @@ |
176 | private System.Windows.Forms.CheckBox showInTaskbar; |
177 | private System.Windows.Forms.Label label21; |
178 | private System.Windows.Forms.TextBox logToDiskLocation; |
179 | + private System.Windows.Forms.Label label22; |
180 | + private System.Windows.Forms.ComboBox cursorStartPosition; |
181 | } |
182 | } |
183 | \ No newline at end of file |
184 | |
185 | === modified file 'client/dotNET/OptionForm.cs' |
186 | --- client/dotNET/OptionForm.cs 2012-08-04 11:12:39 +0000 |
187 | +++ client/dotNET/OptionForm.cs 2012-12-02 17:36:23 +0000 |
188 | @@ -104,6 +104,7 @@ |
189 | maxConcurrentDownloads.Value = Settings.Default.MaxConcurrentDownloads; |
190 | logToDiskLocation.Text = Settings.Default.LogToDiskLocation; |
191 | showInTaskbar.Checked = Settings.Default.ShowInTaskbar; |
192 | + cursorStartPosition.Text = Settings.Default.CursorStartPosition; |
193 | |
194 | Debug.WriteLine("Loaded Options Form", "OptionForm"); |
195 | } |
196 | @@ -200,6 +201,7 @@ |
197 | Settings.Default.LogLevel = logLevel.Text; |
198 | Settings.Default.LogToDiskLocation = logToDiskLocation.Text; |
199 | Settings.Default.ShowInTaskbar = showInTaskbar.Checked; |
200 | + Settings.Default.CursorStartPosition = cursorStartPosition.Text; |
201 | |
202 | // Commit these changes back to the user settings |
203 | Settings.Default.Save(); |
204 | |
205 | === modified file 'client/dotNET/Properties/Settings.Designer.cs' |
206 | --- client/dotNET/Properties/Settings.Designer.cs 2012-10-18 13:58:07 +0000 |
207 | +++ client/dotNET/Properties/Settings.Designer.cs 2012-12-02 17:36:23 +0000 |
208 | @@ -271,7 +271,7 @@ |
209 | |
210 | [global::System.Configuration.ApplicationScopedSettingAttribute()] |
211 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
212 | - [global::System.Configuration.DefaultSettingValueAttribute("1.4.0")] |
213 | + [global::System.Configuration.DefaultSettingValueAttribute("1.4.1")] |
214 | public string ClientVersion { |
215 | get { |
216 | return ((string)(this["ClientVersion"])); |
217 | @@ -520,5 +520,17 @@ |
218 | this["VideoRenderingEngine"] = value; |
219 | } |
220 | } |
221 | + |
222 | + [global::System.Configuration.UserScopedSettingAttribute()] |
223 | + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
224 | + [global::System.Configuration.DefaultSettingValueAttribute("Bottom Right")] |
225 | + public string CursorStartPosition { |
226 | + get { |
227 | + return ((string)(this["CursorStartPosition"])); |
228 | + } |
229 | + set { |
230 | + this["CursorStartPosition"] = value; |
231 | + } |
232 | + } |
233 | } |
234 | } |
235 | |
236 | === modified file 'client/dotNET/Properties/Settings.settings' |
237 | --- client/dotNET/Properties/Settings.settings 2012-10-18 13:58:07 +0000 |
238 | +++ client/dotNET/Properties/Settings.settings 2012-12-02 17:36:23 +0000 |
239 | @@ -69,7 +69,7 @@ |
240 | <Value Profile="(Default)">cacheManager.xml</Value> |
241 | </Setting> |
242 | <Setting Name="ClientVersion" Type="System.String" Scope="Application"> |
243 | - <Value Profile="(Default)">1.4.0</Value> |
244 | + <Value Profile="(Default)">1.4.1</Value> |
245 | </Setting> |
246 | <Setting Name="scrollStepAmount" Type="System.Decimal" Scope="User"> |
247 | <Value Profile="(Default)">1</Value> |
248 | @@ -134,5 +134,8 @@ |
249 | <Setting Name="VideoRenderingEngine" Type="System.String" Scope="User"> |
250 | <Value Profile="(Default)">WindowsMediaPlayer</Value> |
251 | </Setting> |
252 | + <Setting Name="CursorStartPosition" Type="System.String" Scope="User"> |
253 | + <Value Profile="(Default)">Bottom Right</Value> |
254 | + </Setting> |
255 | </Settings> |
256 | </SettingsFile> |
257 | \ No newline at end of file |
258 | |
259 | === modified file 'client/dotNET/Region.cs' |
260 | --- client/dotNET/Region.cs 2012-09-05 20:34:12 +0000 |
261 | +++ client/dotNET/Region.cs 2012-12-02 17:36:23 +0000 |
262 | @@ -649,6 +649,8 @@ |
263 | public int height; |
264 | public int top; |
265 | public int left; |
266 | + public int originalWidth; |
267 | + public int originalHeight; |
268 | |
269 | public int backgroundLeft; |
270 | public int backgroundTop; |
271 | |
272 | === modified file 'client/dotNET/Resources/HtmlTemplate.htm' |
273 | --- client/dotNET/Resources/HtmlTemplate.htm 2012-07-07 10:42:08 +0000 |
274 | +++ client/dotNET/Resources/HtmlTemplate.htm 2012-12-02 17:36:23 +0000 |
275 | @@ -120,7 +120,7 @@ |
276 | width = $marquee.attr('width') || $marquee.width(), |
277 | height = $marquee.attr('height') || $marquee.height(), |
278 | direction = ($marquee.attr('direction') || 'left').toLowerCase(), |
279 | - $marqueeRedux = $marquee.after('<div id="' + $marquee.attr("id") + '" ' + (klass ? 'class="' + klass + '" ' : '') + 'style="display: block-inline; width: ' + width + 'px; height: ' + height + 'px; overflow: hidden;"><div style="float: left; ' + ((/left|right/.test(direction)) ? "white-space: nowrap;" : "") + '">' + $marquee.html() + '</div></div>').next(), |
280 | + $marqueeRedux = $marquee.after('<div ' + (klass ? 'class="' + klass + '" ' : '') + 'style="display: block-inline; width: ' + width + 'px; height: ' + height + 'px; overflow: hidden;"><div style="float: left; ' + ((/left|right/.test(direction)) ? "white-space: nowrap;" : "") + '">' + $marquee.html() + '</div></div>').next(), |
281 | marqueeRedux = $marqueeRedux.get(0), |
282 | hitedge = 0, |
283 | marqueeState = { |
284 | @@ -252,6 +252,8 @@ |
285 | direction: "none", |
286 | width: 100, |
287 | height: 100, |
288 | + originalWidth: 100, |
289 | + originalHeight: 100, |
290 | scrollSpeed: 2, |
291 | scaleText: false, |
292 | fitText: false, |
293 | @@ -262,12 +264,11 @@ |
294 | this.each(function() { |
295 | // Scale text to fit the box |
296 | if (options.scaleText) { |
297 | - // Go through every <span> element, and scale it accordingly. |
298 | - $("span, p", this).each(function(){ |
299 | - // Already has a font? |
300 | - var fontSize = $(this).css("font-size"); |
301 | - |
302 | - $(this).css("font-size", Math.round(fontSize.replace("px", "") * options.scaleFactor)); |
303 | + // Apply the ZOOM attribute to the body |
304 | + $(this).css({ |
305 | + zoom: options.scaleFactor, |
306 | + width: options.originalWidth, |
307 | + height: options.originalHeight |
308 | }); |
309 | } |
310 | |
311 | @@ -297,7 +298,7 @@ |
312 | |
313 | $(".XiboRssItem", this).css({ |
314 | display: "block", |
315 | - width: options.width |
316 | + width: options.originalWidth |
317 | }); |
318 | } |
319 | |
320 | @@ -331,15 +332,22 @@ |
321 | |
322 | // Set some options on the node, before calling marquee (behaviour, direction, scrollAmount, width, height) |
323 | $(this).attr({ |
324 | - direction: options.direction, |
325 | - width: options.width, |
326 | - height: options.height, |
327 | - scrollamount: options.scrollSpeed, |
328 | - behaviour: "scroll" |
329 | + width: options.originalWidth, |
330 | + height: options.originalHeight |
331 | }); |
332 | - |
333 | - // Create a marquee out of it |
334 | - $(this).marquee(); |
335 | + |
336 | + // Wrap in an extra DIV - this will be what is scrolled. |
337 | + $(this).wrap("<div class='scroll'>"); |
338 | + |
339 | + // Set some options on the extra DIV and make it a marquee |
340 | + $(this).parent().attr({ |
341 | + scrollamount: options.scrollSpeed, |
342 | + scaleFactor: options.scaleFactor, |
343 | + behaviour: "scroll", |
344 | + direction: options.direction, |
345 | + height: options.height, |
346 | + width: options.width |
347 | + }).marquee(); |
348 | } |
349 | }); |
350 | } |
351 | |
352 | === modified file 'client/dotNET/Rss.cs' |
353 | --- client/dotNET/Rss.cs 2012-08-21 19:04:26 +0000 |
354 | +++ client/dotNET/Rss.cs 2012-12-02 17:36:23 +0000 |
355 | @@ -25,9 +25,10 @@ |
356 | using System.Xml; |
357 | using System.Net; |
358 | using System.Diagnostics; |
359 | -using System.ServiceModel.Syndication; |
360 | using System.Globalization; |
361 | using System.Linq; |
362 | +using FeedDotNet; |
363 | +using FeedDotNet.Common; |
364 | |
365 | namespace XiboClient |
366 | { |
367 | @@ -49,6 +50,8 @@ |
368 | private int _duration; |
369 | private bool _fitText; |
370 | |
371 | + private RegionOptions _options; |
372 | + |
373 | private int _numItems; |
374 | private string _takeItemsFrom; |
375 | private int _durationIsPerItem; |
376 | @@ -76,6 +79,10 @@ |
377 | public Rss(RegionOptions options) |
378 | : base(options.width, options.height, options.top, options.left) |
379 | { |
380 | + // Store the options |
381 | + _options = options; |
382 | + |
383 | + // Get the URI |
384 | if (String.IsNullOrEmpty(options.uri)) |
385 | { |
386 | throw new ArgumentNullException("Uri", "The Uri for the RSS feed can not be empty"); |
387 | @@ -106,9 +113,8 @@ |
388 | _duration = options.duration; |
389 | _fitText = (options.Dictionary.Get("fitText", "0") == "0" ? false : true); |
390 | |
391 | - // Adjust the scale factor |
392 | - // Scale factor is always slightly over stated, we need to reduce it. |
393 | - _scaleFactor = options.scaleFactor * 0.85; |
394 | + // Scale factor |
395 | + _scaleFactor = options.scaleFactor; |
396 | |
397 | // Update interval and scrolling speed |
398 | _updateInterval = options.updateInterval; |
399 | @@ -210,10 +216,12 @@ |
400 | headContent += " type: 'ticker',"; |
401 | headContent += " direction: '" + _direction + "',"; |
402 | headContent += " duration: " + _duration + ","; |
403 | - headContent += " durationIsPerItem: false,"; |
404 | + headContent += " durationIsPerItem: " + ((_durationIsPerItem == 0) ? "true" : "false") + ","; |
405 | headContent += " numItems: 0,"; |
406 | headContent += " width: " + _width + ","; |
407 | headContent += " height: " + _height + ","; |
408 | + headContent += " originalWidth: " + _options.originalWidth + ","; |
409 | + headContent += " originalHeight: " + _options.originalHeight + ","; |
410 | headContent += " scrollSpeed: " + _scrollSpeed + ","; |
411 | headContent += " fitText: " + ((!_fitText) ? "false" : "true") + ","; |
412 | headContent += " scaleText: " + ((_fitText) ? "false" : "true") + ","; |
413 | @@ -258,26 +266,28 @@ |
414 | { |
415 | string localFeedUrl = Properties.Settings.Default.LibraryPath + @"\" + _mediaid + ".xml"; |
416 | |
417 | - using (XmlReader reader = XmlReader.Create(localFeedUrl)) |
418 | + using (StreamReader sr = new StreamReader(localFeedUrl)) |
419 | { |
420 | - SyndicationFeed feed = SyndicationFeed.Load(reader); |
421 | - |
422 | - int countItems = 0; |
423 | - int currentItem = 0; |
424 | - |
425 | - foreach (SyndicationItem item in feed.Items) |
426 | - countItems++; |
427 | + Feed feed = FeedReader.Read(sr.BaseStream, _filePath, new FeedReaderSettings()); |
428 | + |
429 | + if (FeedReader.HasErrors || feed == null) |
430 | + { |
431 | + throw new Exception("Error reading feed. " + FeedReader.GetErrors()[0]); |
432 | + } |
433 | |
434 | // What if the _numItems we want is 0? Take them all. |
435 | if (_numItems == 0) |
436 | - _numItems = countItems; |
437 | + _numItems = feed.Items.Count; |
438 | |
439 | // Make sure we dont have a count higher than the actual number of items returned |
440 | - if (_numItems > countItems) |
441 | - _numItems = countItems; |
442 | + if (_numItems > feed.Items.Count) |
443 | + _numItems = feed.Items.Count; |
444 | + |
445 | + // Read items |
446 | + int currentItem = 0; |
447 | |
448 | // Go through each item and construct the HTML for the feed |
449 | - foreach(SyndicationItem item in feed.Items) |
450 | + foreach (FeedItem item in feed.Items) |
451 | { |
452 | currentItem++; |
453 | |
454 | @@ -296,20 +306,24 @@ |
455 | // Load the template into a temporary variable |
456 | string temp = _documentTemplate; |
457 | |
458 | - temp = temp.Replace("[Title]", item.Title.Text.ToString()); |
459 | - |
460 | - string description; |
461 | - |
462 | - if (item.Summary == null) |
463 | - description = item.ElementExtensions.ReadElementExtensions<string>("encoded", "http://purl.org/rss/1.0/modules/content/")[0].ToString(); |
464 | - else |
465 | - description = item.Summary.Text; |
466 | - |
467 | - temp = temp.Replace("[Description]", description); |
468 | - temp = temp.Replace("[Date]", item.PublishDate.ToString("F")); |
469 | - |
470 | - if (item.Links.Count > 0) |
471 | - temp = temp.Replace("[Link]", item.Links[0].Uri.ToString()); |
472 | + // Get some generic items |
473 | + temp = temp.Replace("[Title]", item.Title); |
474 | + temp = temp.Replace("[Summary]", item.Summary); |
475 | + |
476 | + string date = ""; |
477 | + if (item.Published.HasValue) |
478 | + date = item.Published.Value.ToString("F"); |
479 | + else if (item.Updated.HasValue) |
480 | + date = item.Updated.Value.ToString("F"); |
481 | + |
482 | + temp = temp.Replace("[Date]", (item.Published.HasValue) ? item.Published.Value.ToString("F") : ""); |
483 | + temp = temp.Replace("[Description]", item.ContentOrSummary); |
484 | + |
485 | + string links = ""; |
486 | + foreach (FeedUri uri in item.WebUris) |
487 | + links += " " + uri.Uri; |
488 | + |
489 | + temp = temp.Replace("[Link]", links); |
490 | |
491 | // Assemble the RSS items based on the direction we are displaying |
492 | if (_direction == "left" || _direction == "right") |
493 | |
494 | === modified file 'client/dotNET/Text.cs' |
495 | --- client/dotNET/Text.cs 2012-08-21 19:04:26 +0000 |
496 | +++ client/dotNET/Text.cs 2012-12-02 17:36:23 +0000 |
497 | @@ -43,6 +43,7 @@ |
498 | private double _scaleFactor; |
499 | private int _scrollSpeed; |
500 | private bool _fitText; |
501 | + private RegionOptions _options; |
502 | |
503 | private TemporaryHtml _tempHtml; |
504 | |
505 | @@ -55,6 +56,7 @@ |
506 | { |
507 | // Collect some options from the Region Options passed in |
508 | // and store them in member variables. |
509 | + _options = options; |
510 | _filePath = options.uri; |
511 | _direction = options.direction; |
512 | _backgroundImage = options.backgroundImage; |
513 | @@ -66,9 +68,8 @@ |
514 | _headJavaScript = options.javaScript; |
515 | _fitText = (options.Dictionary.Get("fitText", "0") == "0" ? false : true); |
516 | |
517 | - // Adjust the scale factor |
518 | - // Scale factor is always slightly over stated, we need to reduce it. |
519 | - _scaleFactor = options.scaleFactor * 0.85; |
520 | + // Scale Factor |
521 | + _scaleFactor = options.scaleFactor; |
522 | |
523 | // Generate a temporary file to store the rendered object in. |
524 | _tempHtml = new TemporaryHtml(); |
525 | @@ -101,7 +102,7 @@ |
526 | |
527 | // Generate the body content |
528 | bodyContent += "<div id=\"contentPane\" style=\"overflow: none; width:" + _width + "px; height:" + _height + "px;\">"; |
529 | - bodyContent += " <div id=\"text\">"; |
530 | + bodyContent += " <div id=\"" + _options.type + "\">"; |
531 | bodyContent += " " + _documentText; |
532 | bodyContent += " </div>"; |
533 | bodyContent += "</div>"; |
534 | @@ -132,6 +133,8 @@ |
535 | headContent += " numItems: 0,"; |
536 | headContent += " width: " + _width + ","; |
537 | headContent += " height: " + _height + ","; |
538 | + headContent += " originalWidth: " + _options.originalWidth + ","; |
539 | + headContent += " originalHeight: " + _options.originalHeight + ","; |
540 | headContent += " scrollSpeed: " + _scrollSpeed + ","; |
541 | headContent += " fitText: " + ((!_fitText) ? "false" : "true") + ","; |
542 | headContent += " scaleText: " + ((_fitText) ? "false" : "true") + ","; |
543 | |
544 | === modified file 'client/dotNET/Video.cs' |
545 | --- client/dotNET/Video.cs 2012-09-05 20:34:12 +0000 |
546 | +++ client/dotNET/Video.cs 2012-12-02 17:36:23 +0000 |
547 | @@ -26,6 +26,7 @@ |
548 | using System.IO; |
549 | |
550 | /// 09/06/12 Dan Changed to raise an event when the video is finished |
551 | +/// 03/11/12 Dan Fix for non zero duration timers. |
552 | |
553 | namespace XiboClient |
554 | { |
555 | @@ -35,6 +36,7 @@ |
556 | private VideoPlayer _videoPlayer; |
557 | private int _duration; |
558 | private bool _expired = false; |
559 | + private bool _detectEnd = false; |
560 | |
561 | /// <summary> |
562 | /// Constructor |
563 | @@ -71,6 +73,7 @@ |
564 | |
565 | // Set the duration to 1 second |
566 | Duration = 1; |
567 | + _detectEnd = true; |
568 | } |
569 | |
570 | // Render media as normal (starts the timer, shows the form, etc) |
571 | @@ -119,7 +122,7 @@ |
572 | /// <param name="e"></param> |
573 | protected override void timer_Tick(object sender, EventArgs e) |
574 | { |
575 | - if (_expired) |
576 | + if (!_detectEnd || _expired) |
577 | base.timer_Tick(sender, e); |
578 | } |
579 | |
580 | |
581 | === modified file 'client/dotNET/WebContent.cs' |
582 | --- client/dotNET/WebContent.cs 2012-09-05 20:34:12 +0000 |
583 | +++ client/dotNET/WebContent.cs 2012-12-02 17:36:23 +0000 |
584 | @@ -1,6 +1,6 @@ |
585 | /* |
586 | * Xibo - Digitial Signage - http://www.xibo.org.uk |
587 | - * Copyright (C) 2006-2012 Daniel Garner and James Packer |
588 | + * Copyright (C) 2006-2012 Daniel Garner |
589 | * |
590 | * This file is part of Xibo. |
591 | * |
592 | @@ -54,6 +54,7 @@ |
593 | // Offset? |
594 | double offsetTop = Convert.ToDouble(options.Dictionary.Get("offsetTop", "0")); |
595 | double offsetLeft = Convert.ToDouble(options.Dictionary.Get("offsetLeft", "0")); |
596 | + double scaling = Convert.ToDouble(options.Dictionary.Get("scaling", "100")); |
597 | |
598 | // Attach event |
599 | webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); |
600 | @@ -78,14 +79,30 @@ |
601 | Trace.WriteLine(new LogMessage("WebContent", "Unable to get a URI with exception: " + ex.Message), LogType.Audit.ToString()); |
602 | } |
603 | |
604 | - if (offsetLeft == 0 && offsetTop == 0) |
605 | + if (offsetLeft == 0 && offsetTop == 0 && scaling == 100) |
606 | { |
607 | webBrowser.Navigate(_filePath); |
608 | } |
609 | else |
610 | { |
611 | + double w = Convert.ToDouble(options.width); |
612 | + double h = Convert.ToDouble(options.height); |
613 | + string zoom = ""; |
614 | + |
615 | + // Scale? |
616 | + if (scaling != 100) |
617 | + { |
618 | + // Convert from percentage |
619 | + scaling = scaling / 100; |
620 | + |
621 | + // Alter the width and height |
622 | + w = w * (1 / scaling); |
623 | + h = h * (1 / scaling); |
624 | + zoom = "zoom: " + scaling.ToString() + ";"; |
625 | + } |
626 | + |
627 | // Load an IFRAME into the DocumentText |
628 | - string iframe = "<html><body style='margin:0; border:0;'><iframe style='margin-left:-" + offsetLeft.ToString() + "px; margin-top:-" + offsetTop.ToString() + "px;' scrolling=\"no\" width=\"" + (options.width + offsetLeft).ToString() + "px\" height=\"" + (options.height + offsetTop).ToString() + "px\" src=\"" + _filePath + "\"></body></html>"; |
629 | + string iframe = "<html><body style='margin:0; border:0;'><iframe style='border:0;margin-left:-" + offsetLeft.ToString() + "px; margin-top:-" + offsetTop.ToString() + "px;" + zoom + "' scrolling=\"no\" width=\"" + (w + offsetLeft).ToString() + "px\" height=\"" + (h + offsetTop).ToString() + "px\" src=\"" + _filePath + "\"></body></html>"; |
630 | webBrowser.DocumentText = iframe; |
631 | } |
632 | } |
633 | |
634 | === modified file 'client/dotNET/XiboClient.csproj' |
635 | --- client/dotNET/XiboClient.csproj 2012-09-05 20:34:12 +0000 |
636 | +++ client/dotNET/XiboClient.csproj 2012-12-02 17:36:23 +0000 |
637 | @@ -74,6 +74,18 @@ |
638 | <ErrorReport>prompt</ErrorReport> |
639 | </PropertyGroup> |
640 | <ItemGroup> |
641 | + <Reference Include="FeedDotNet, Version=1.2.1.1, Culture=neutral, processorArchitecture=MSIL"> |
642 | + <SpecificVersion>False</SpecificVersion> |
643 | + <HintPath>..\..\..\..\FeedDotNet-master\FeedDotNet\bin\x86\Release\FeedDotNet.dll</HintPath> |
644 | + </Reference> |
645 | + <Reference Include="FeedDotNet.Common, Version=1.2.1.1, Culture=neutral, processorArchitecture=MSIL"> |
646 | + <SpecificVersion>False</SpecificVersion> |
647 | + <HintPath>..\..\..\..\FeedDotNet-master\FeedDotNet\bin\x86\Release\FeedDotNet.Common.dll</HintPath> |
648 | + </Reference> |
649 | + <Reference Include="FeedDotNet.Modules, Version=1.2.1.1, Culture=neutral, processorArchitecture=MSIL"> |
650 | + <SpecificVersion>False</SpecificVersion> |
651 | + <HintPath>..\..\..\..\FeedDotNet-master\FeedDotNet\bin\x86\Release\FeedDotNet.Modules.dll</HintPath> |
652 | + </Reference> |
653 | <Reference Include="System" /> |
654 | <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /> |
655 | <Reference Include="System.Data" /> |
656 | |
657 | === modified file 'client/dotNET/app.config' |
658 | --- client/dotNET/app.config 2012-10-27 12:45:04 +0000 |
659 | +++ client/dotNET/app.config 2012-12-02 17:36:23 +0000 |
660 | @@ -112,6 +112,9 @@ |
661 | <setting name="VideoRenderingEngine" serializeAs="String"> |
662 | <value>WindowsMediaPlayer</value> |
663 | </setting> |
664 | + <setting name="CursorStartPosition" serializeAs="String"> |
665 | + <value>Bottom Right</value> |
666 | + </setting> |
667 | </XiboClient.Properties.Settings> |
668 | </userSettings> |
669 | <applicationSettings> |
670 | @@ -135,7 +138,7 @@ |
671 | <value>cacheManager.xml</value> |
672 | </setting> |
673 | <setting name="ClientVersion" serializeAs="String"> |
674 | - <value>1.4.0</value> |
675 | + <value>1.4.1</value> |
676 | </setting> |
677 | <setting name="xmdsResetTimeout" serializeAs="String"> |
678 | <value>900</value> |