1 |
#include "MainView.h" |
#include "mainview.h" |
2 |
#include <QApplication> |
#include <QApplication> |
3 |
#include <QPushButton> |
#include <QPushButton> |
4 |
#include <QLabel> |
#include <QLabel> |
5 |
#include <QStackedLayout> |
#include <QStackedLayout> |
6 |
#include <QSvgWidget> |
#include <QSvgWidget> |
7 |
|
|
8 |
|
#include <QDir> |
9 |
#include <QTimer> |
#include <QTimer> |
10 |
#include <QKeyEvent> |
#include <QKeyEvent> |
11 |
#include <QSettings> |
#include <QSettings> |
44 |
readLocalFiles(); |
readLocalFiles(); |
45 |
} |
} |
46 |
|
|
47 |
this->resize(400,400); |
this->resize(640,480); |
48 |
this->setWindowState( Qt::WindowFullScreen ); |
this->setWindowState( Qt::WindowFullScreen ); |
49 |
this->grabKeyboard(); |
this->grabKeyboard(); |
50 |
|
|
69 |
layout->setContentsMargins(0,0,0,0); |
layout->setContentsMargins(0,0,0,0); |
70 |
setLayout(layout); |
setLayout(layout); |
71 |
|
|
72 |
clockOverlay = new ClockOverlay(this); |
if (showClock == true) { |
73 |
clockOverlay->move(10,10); |
clockOverlay = new ClockOverlay(this); |
74 |
clockOverlay->resize(100,50); |
clockOverlay->move(10,10); |
75 |
|
clockOverlay->resize(150,75); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
120 |
screenManagerOff = settings->value("screenmanager_off").toTime(); |
screenManagerOff = settings->value("screenmanager_off").toTime(); |
121 |
} |
} |
122 |
|
|
123 |
|
showClock = settings->value("showclock").toBool(); |
124 |
|
|
125 |
xmlInterval = settings->value("xmlinterval", 30).toInt(); |
xmlInterval = settings->value("xmlinterval", 30).toInt(); |
126 |
xmlInterval = (xmlInterval * 60 * 1000); //convert to milliseconds |
xmlInterval = (xmlInterval * 60 * 1000); //convert to milliseconds |
127 |
|
|
158 |
if (key == ' ' || key == Qt::Key_Return || key == Qt::Key_Enter) { |
if (key == ' ' || key == Qt::Key_Return || key == Qt::Key_Enter) { |
159 |
close(); |
close(); |
160 |
} |
} |
161 |
|
|
162 |
|
if (key == 'f' || key == 'F') { |
163 |
|
Qt::WindowStates current = this->windowState(); |
164 |
|
if (current == Qt::WindowFullScreen) { |
165 |
|
this->setWindowState(Qt::WindowActive); |
166 |
|
} else { |
167 |
|
this->setWindowState(Qt::WindowFullScreen); |
168 |
|
} |
169 |
|
} |
170 |
|
|
171 |
} |
} |
172 |
|
|
173 |
void MainView::onTimer() |
void MainView::onTimer() |
183 |
if (currentMode == ModeXml || currentMode == ModeLocal) { |
if (currentMode == ModeXml || currentMode == ModeLocal) { |
184 |
switchScreens(); |
switchScreens(); |
185 |
} |
} |
186 |
clockOverlay->timerTick(); |
if (showClock == true) { |
187 |
|
clockOverlay->timerTick(); |
188 |
|
} |
189 |
} |
} |
190 |
|
|
191 |
|
|
323 |
|
|
324 |
void MainView::errorInfoScreen(QString msg) |
void MainView::errorInfoScreen(QString msg) |
325 |
{ |
{ |
326 |
ensureVisible(web); |
ensureVisible(web); |
327 |
web->setHtml("<html>\ |
QString html("<html><body text='#505050' bgcolor='#000000'>"); |
328 |
<body text='#505050' bgcolor='#000000'>\ |
html.append("<table width='100%' height='100%'><tr><td align='center' valign='middel'><h1>") |
329 |
<table width='100%' height='100%'><tr><td align='center' valign='middel'><h1>" + msg+ "</h1></td></tr></table>\ |
.append(msg) |
330 |
</body></html>"); |
.append("</h1></td></tr></table></body></html>"); |
331 |
|
web->setHtml(html); |
332 |
} |
} |
333 |
|
|
334 |
void MainView::ensureVisible(QWidget* widget) |
void MainView::ensureVisible(QWidget* widget) |