NowTreeView refresh modified
authorhanzes <hanzes@localhost>
Tue, 26 Jan 2010 09:58:46 +0000 (09:58 +0000)
committerhanzes <hanzes@localhost>
Tue, 26 Jan 2010 09:58:46 +0000 (09:58 +0000)
src/gui/mainwindow.cpp
src/gui/mainwindow.h

index 4e35e93..1429731 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <QDialog>
 #include <QMessageBox>
+#include <QTimer>
 #include "ui_about.h"
 #include "eventdialog.h"
 #include "daynavigatorwidget.h"
@@ -95,6 +96,11 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
        nowTreeView->setModel(new EventModel());
        nowTreeView->setItemDelegate(new Delegate(nowTreeView));
 
+       // NOW View refresh timer
+    QTimer *timer = new QTimer( this );
+    connect( timer, SIGNAL(timeout()), SLOT(timerUpdateNowView()) );
+    timer->start( 30000); // 30 seconds timer
+
     // ROOMS View
     roomTreeView->setHeaderHidden(true);
     roomTreeView->setRootIsDecorated(false);
@@ -383,3 +389,13 @@ void MainWindow::tabHasChanged(int aIndex)
     updateNowView();
 }
 
+void MainWindow::timerUpdateNowView()
+{
+       QWidget * pCurrentWidget = tabWidget->widget(tabWidget->currentIndex());
+
+       if( pCurrentWidget != NULL )
+       {
+               if( pCurrentWidget == tab )
+                   updateNowView();
+       }
+}
index f79c2f3..58e24f8 100644 (file)
@@ -32,6 +32,7 @@ private slots:
     void conferenceMapClicked();
     void tabHasChanged(int aIndex);
     void eventHasChanged(int aEventId);
+    void timerUpdateNowView();
 private:
     SqlEngine *mSqlEngine;
 };