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

Diff of /infoscreen/mainview.cpp

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

revision 872 by torben, Tue Jun 22 07:24:14 2010 UTC revision 875 by torben, Tue Jun 22 20:43:13 2010 UTC
# Line 16  Line 16 
16  #include "videoview.h"  #include "videoview.h"
17    
18  #include "httpwrapper.h"  #include "httpwrapper.h"
19    #include "screenmanager.h"
20    
21    
22    
# Line 71  MainView::MainView(QWidget* parent) Line 72  MainView::MainView(QWidget* parent)
72          web->start(url,screenid);          web->start(url,screenid);
73      }      }
74    
75      if (currentMode == ModeXml || currentMode == ModeLocal) {      if (enableScreenManager) {
76          qDebug() << "Starting timer...";          screenManager = new ScreenManager();
77          timer = new QTimer(this);      } else {
78          connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));          qDebug() << "ScreenManager is disabled";
         timer->start(100);  
79      }      }
80    
81    
82        qDebug() << "Starting timer...";
83        timer = new QTimer(this);
84        connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
85        timer->start(100);
86  }  }
87    
88  void MainView::loadSettings()  void MainView::loadSettings()
# Line 98  void MainView::loadSettings() Line 104  void MainView::loadSettings()
104          exit(1);          exit(1);
105      }      }
106    
107        enableScreenManager = settings->value("enableScreenManager").toBool();
108    
109    
110      if (currentMode == ModeSimpleWeb || currentMode == ModeXml) {      if (currentMode == ModeSimpleWeb || currentMode == ModeXml) {
111          url = settings->value("url").toString();          url = settings->value("url").toString();
# Line 135  void MainView::keyPressEvent ( QKeyEvent Line 143  void MainView::keyPressEvent ( QKeyEvent
143    
144  void MainView::onTimer()  void MainView::onTimer()
145  {  {
146      screenManager.timerTick();      if (enableScreenManager == true) {
147            screenManager->timerTick();
148        }
149    
150      if (currentMode == ModeXml) {      if (currentMode == ModeXml) {
151          readXml();          readXml();
152      }      }
153    
154      switchScreens();      if (currentMode == ModeXml || currentMode == ModeLocal) {
155            switchScreens();
156        }
157  }  }
158    
159    
# Line 269  void MainView::switchScreens() Line 281  void MainView::switchScreens()
281              }              }
282    
283          } else {          } else {
             qDebug() << "no screen";  
284              errorInfoScreen("Der er ingen information at vise");              errorInfoScreen("Der er ingen information at vise");
285          }          }
286          lastScreenSwitch = QTime::currentTime();          lastScreenSwitch = QTime::currentTime();

Legend:
Removed from v.872  
changed lines
  Added in v.875

  ViewVC Help
Powered by ViewVC 1.1.20