/[projects]/infoscreen/mainview.cpp
ViewVC logotype

Diff of /infoscreen/mainview.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 529 by torben, Wed Jan 6 23:13:21 2010 UTC revision 533 by torben, Thu Jan 7 19:31:07 2010 UTC
# Line 5  Line 5 
5  #include <QVBoxLayout>  #include <QVBoxLayout>
6    
7  #include <QTimer>  #include <QTimer>
8    #include <QKeyEvent>
9    
10  #include "MyWebView.h"  #include "MyWebView.h"
11  #include "clientsiderender.h"  #include "clientsiderender.h"
# Line 19  MainView::MainView(QWidget* parent) Line 20  MainView::MainView(QWidget* parent)
20  {  {
21          this->resize(400,400);          this->resize(400,400);
22          this->setWindowState( Qt::WindowFullScreen );          this->setWindowState( Qt::WindowFullScreen );
23                    this->grabKeyboard();
24    
25          qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );          qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
26    
# Line 51  MainView::MainView(QWidget* parent) Line 53  MainView::MainView(QWidget* parent)
53    
54  }  }
55    
56    void MainView::keyPressEvent ( QKeyEvent* event )
57    {
58        int key = event->key();
59        if (key == ' ' || key == Qt::Key_Return || key == Qt::Key_Enter) {
60            qApp->quit();
61        }
62    }  
63    
64  void MainView::onTimer()  void MainView::onTimer()
65  {  {
# Line 95  void MainView::switchScreens() Line 104  void MainView::switchScreens()
104          bool found = false;          bool found = false;
105          int tries = 0;          int tries = 0;
106    
107                    if (screenItems.size() > 0) { //only try if we have a any screens
108          while (found == false && tries <= screenItems.size()) { //find next with valid display time                  while (found == false && tries <= screenItems.size()) { //find next with valid display time
109              tries++;                  tries++;
110              currentItemIdx = (currentItemIdx+1) % screenItems.size();                  currentItemIdx = (currentItemIdx+1) % screenItems.size();
111              currentItem = screenItems.at(currentItemIdx);                  currentItem = screenItems.at(currentItemIdx);
112    
113              if (currentItem.start <= now && now <= currentItem.stop )                  if (currentItem.start <= now && now <= currentItem.stop )
114                  found = true;                          found = true;
115                            }
116          }          }
117    
118          if (found) {          if (found) {

Legend:
Removed from v.529  
changed lines
  Added in v.533

  ViewVC Help
Powered by ViewVC 1.1.20