--- infoscreen/MainView.cpp 2010/06/24 08:59:43 883 +++ infoscreen/mainview.cpp 2010/06/25 07:17:40 902 @@ -1,4 +1,4 @@ -#include "MainView.h" +#include "mainview.h" #include #include #include @@ -10,7 +10,7 @@ #include #include -#include "MyWebView.h" +#include "webview.h" #include "clientsiderender.h" #include "pictureview.h" #include "videoview.h" @@ -51,7 +51,7 @@ render = new ClientSideRender(this); - web = new MyWebView(this); + web = new WebView(this); picture = new PictureView(this); @@ -68,9 +68,11 @@ layout->setContentsMargins(0,0,0,0); setLayout(layout); - clockOverlay = new ClockOverlay(this); - clockOverlay->move(10,10); - clockOverlay->resize(100,50); + if (showClock == true) { + clockOverlay = new ClockOverlay(this); + clockOverlay->move(10,10); + clockOverlay->resize(150,75); + } @@ -117,6 +119,8 @@ screenManagerOff = settings->value("screenmanager_off").toTime(); } + showClock = settings->value("showclock").toBool(); + xmlInterval = settings->value("xmlinterval", 30).toInt(); xmlInterval = (xmlInterval * 60 * 1000); //convert to milliseconds @@ -168,7 +172,9 @@ if (currentMode == ModeXml || currentMode == ModeLocal) { switchScreens(); } - clockOverlay->timerTick(); + if (showClock == true) { + clockOverlay->timerTick(); + } } @@ -249,7 +255,6 @@ } if (lastScreenSwitch.isNull() || lastScreenSwitch.elapsed() > (currentItem.runtime*1000)) { - QTime now = QTime::currentTime(); if (lastScreenSwitch.isNull()) currentItemIdx = -1; @@ -297,6 +302,8 @@ } else { errorInfoScreen("Der er ingen information at vise"); + currentItem = ScreenItem(); + currentItem.runtime = 60; //switch screens again in 1 minute } lastScreenSwitch = QTime::currentTime(); @@ -305,11 +312,12 @@ void MainView::errorInfoScreen(QString msg) { - ensureVisible(web); - web->setHtml("\ - \ -

" + msg+ "

\ - "); + ensureVisible(web); + QString html(""); + html.append("

") + .append(msg) + .append("

"); + web->setHtml(html); } void MainView::ensureVisible(QWidget* widget)