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

Diff of /infoscreen/MainView.cpp

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

revision 533 by torben, Thu Jan 7 19:31:07 2010 UTC revision 534 by torben, Thu Jan 7 19:42:12 2010 UTC
# Line 16  Line 16 
16    
17    
18  MainView::MainView(QWidget* parent)  MainView::MainView(QWidget* parent)
19   : QWidget(parent)      : QWidget(parent)
20  {  {
21          this->resize(400,400);      this->resize(400,400);
22          this->setWindowState( Qt::WindowFullScreen );      this->setWindowState( Qt::WindowFullScreen );
23                  this->grabKeyboard();      this->grabKeyboard();
24    
25          qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );      qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
26    
27          render = new ClientSideRender(this);      render = new ClientSideRender(this);
28          render->setVisible( false );      render->setVisible( false );
29    
30          web = new MyWebView(this);      web = new MyWebView(this);
31          web->setVisible( false);      web->setVisible( false);
32    
33          picture = new PictureView(this);      picture = new PictureView(this);
34          picture->setVisible( false );      picture->setVisible( false );
35    
36          video = new VideoView(this);      video = new VideoView(this);
37          video->setVisible(false);      video->setVisible(false);
38    
39          QVBoxLayout* layout = new QVBoxLayout();      QVBoxLayout* layout = new QVBoxLayout();
40          layout->addWidget(web,1);      layout->addWidget(web,1);
41          layout->addWidget(render,1);      layout->addWidget(render,1);
42          layout->addWidget(picture,1);      layout->addWidget(picture,1);
43          layout->addWidget(video,1);      layout->addWidget(video,1);
44          layout->addStretch();      layout->addStretch();
45          layout->setContentsMargins(0,0,0,0);      layout->setContentsMargins(0,0,0,0);
46          setLayout(layout);      setLayout(layout);
47    
48    
49    
50          QTimer* timer = new QTimer(this);      QTimer* timer = new QTimer(this);
51          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));      connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
52          timer->start(100);      timer->start(100);
53    
54  }  }
55    
# Line 104  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          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.533  
changed lines
  Added in v.534

  ViewVC Help
Powered by ViewVC 1.1.20