10 |
#include <QSettings> |
#include <QSettings> |
11 |
#include <QMessageBox> |
#include <QMessageBox> |
12 |
|
|
13 |
#include "MyWebView.h" |
#include "webview.h" |
14 |
#include "clientsiderender.h" |
#include "clientsiderender.h" |
15 |
#include "pictureview.h" |
#include "pictureview.h" |
16 |
#include "videoview.h" |
#include "videoview.h" |
17 |
|
#include "clockoverlay.h" |
18 |
#include "httpwrapper.h" |
#include "httpwrapper.h" |
19 |
#include "screenmanager.h" |
#include "screenmanager.h" |
20 |
|
|
29 |
xmlUrl = url + "?screen_id=" + screenid; |
xmlUrl = url + "?screen_id=" + screenid; |
30 |
qDebug() << "Starting XML mode"; |
qDebug() << "Starting XML mode"; |
31 |
qDebug() << "xmlUrl" << xmlUrl; |
qDebug() << "xmlUrl" << xmlUrl; |
32 |
|
qDebug() << "xmlInterval" << xmlInterval/(60*1000); |
33 |
} |
} |
34 |
|
|
35 |
if (currentMode == ModeSimpleWeb){ |
if (currentMode == ModeSimpleWeb){ |
51 |
|
|
52 |
render = new ClientSideRender(this); |
render = new ClientSideRender(this); |
53 |
|
|
54 |
web = new MyWebView(this); |
web = new WebView(this); |
55 |
|
|
56 |
picture = new PictureView(this); |
picture = new PictureView(this); |
57 |
|
|
68 |
layout->setContentsMargins(0,0,0,0); |
layout->setContentsMargins(0,0,0,0); |
69 |
setLayout(layout); |
setLayout(layout); |
70 |
|
|
71 |
|
clockOverlay = new ClockOverlay(this); |
72 |
|
clockOverlay->move(10,10); |
73 |
|
clockOverlay->resize(150,75); |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
if (currentMode == ModeSimpleWeb) { |
if (currentMode == ModeSimpleWeb) { |
78 |
web->setVisible(true); |
web->setVisible(true); |
79 |
web->start(url,screenid); |
web->start(url,screenid); |
168 |
if (currentMode == ModeXml || currentMode == ModeLocal) { |
if (currentMode == ModeXml || currentMode == ModeLocal) { |
169 |
switchScreens(); |
switchScreens(); |
170 |
} |
} |
171 |
|
clockOverlay->timerTick(); |
172 |
} |
} |
173 |
|
|
174 |
|
|
249 |
} |
} |
250 |
|
|
251 |
if (lastScreenSwitch.isNull() || lastScreenSwitch.elapsed() > (currentItem.runtime*1000)) { |
if (lastScreenSwitch.isNull() || lastScreenSwitch.elapsed() > (currentItem.runtime*1000)) { |
|
|
|
252 |
QTime now = QTime::currentTime(); |
QTime now = QTime::currentTime(); |
253 |
if (lastScreenSwitch.isNull()) |
if (lastScreenSwitch.isNull()) |
254 |
currentItemIdx = -1; |
currentItemIdx = -1; |
296 |
|
|
297 |
} else { |
} else { |
298 |
errorInfoScreen("Der er ingen information at vise"); |
errorInfoScreen("Der er ingen information at vise"); |
299 |
|
currentItem = ScreenItem(); |
300 |
|
currentItem.runtime = 60; //switch screens again in 1 minute |
301 |
} |
} |
302 |
lastScreenSwitch = QTime::currentTime(); |
lastScreenSwitch = QTime::currentTime(); |
303 |
|
|
306 |
|
|
307 |
void MainView::errorInfoScreen(QString msg) |
void MainView::errorInfoScreen(QString msg) |
308 |
{ |
{ |
309 |
ensureVisible(web); |
ensureVisible(web); |
310 |
web->setHtml("<html>\ |
QString html("<html><body text='#505050' bgcolor='#000000'>"); |
311 |
<body text='#505050' bgcolor='#000000'>\ |
html.append("<table width='100%' height='100%'><tr><td align='center' valign='middel'><h1>") |
312 |
<table width='100%' height='100%'><tr><td align='center' valign='middel'><h1>" + msg+ "</h1></td></tr></table>\ |
.append(msg) |
313 |
</body></html>"); |
.append("</h1></td></tr></table></body></html>"); |
314 |
|
web->setHtml(html); |
315 |
} |
} |
316 |
|
|
317 |
void MainView::ensureVisible(QWidget* widget) |
void MainView::ensureVisible(QWidget* widget) |