--- infoscreen/MainView.cpp 2010/06/24 09:44:57 884 +++ infoscreen/mainview.cpp 2014/02/04 14:16:40 2103 @@ -1,10 +1,11 @@ -#include "MainView.h" +#include "mainview.h" #include #include #include #include #include +#include #include #include #include @@ -43,7 +44,7 @@ readLocalFiles(); } - this->resize(400,400); + this->resize(640,480); this->setWindowState( Qt::WindowFullScreen ); this->grabKeyboard(); @@ -68,9 +69,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 +120,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 @@ -153,6 +158,16 @@ if (key == ' ' || key == Qt::Key_Return || key == Qt::Key_Enter) { close(); } + + if (key == 'f' || key == 'F') { + Qt::WindowStates current = this->windowState(); + if (current == Qt::WindowFullScreen) { + this->setWindowState(Qt::WindowActive); + } else { + this->setWindowState(Qt::WindowFullScreen); + } + } + } void MainView::onTimer() @@ -168,7 +183,9 @@ if (currentMode == ModeXml || currentMode == ModeLocal) { switchScreens(); } - clockOverlay->timerTick(); + if (showClock == true) { + clockOverlay->timerTick(); + } } @@ -249,7 +266,6 @@ } if (lastScreenSwitch.isNull() || lastScreenSwitch.elapsed() > (currentItem.runtime*1000)) { - QTime now = QTime::currentTime(); if (lastScreenSwitch.isNull()) currentItemIdx = -1; @@ -297,6 +313,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 +323,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)