mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
a433eb6abd
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2234 b45a01b8-16f6-495d-af2f-9b41ad6348cc
34 lines
703 B
C++
34 lines
703 B
C++
#include <iostream>
|
|
#include <QTimer>
|
|
#include "RsAutoUpdatePage.h"
|
|
#include "MessengerWindow.h"
|
|
|
|
RsAutoUpdatePage::RsAutoUpdatePage(int ms_update_period,QWidget *parent)
|
|
: MainPage(parent)
|
|
{
|
|
_timer = new QTimer ;
|
|
|
|
QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(timerUpdate())) ;
|
|
|
|
_timer->start(ms_update_period) ;
|
|
}
|
|
|
|
void RsAutoUpdatePage::showEvent(QShowEvent *event)
|
|
{
|
|
//std::cout << "RsAutoUpdatePage::showEvent() In show event !!" << std::endl ;
|
|
updateDisplay();
|
|
}
|
|
|
|
void RsAutoUpdatePage::timerUpdate()
|
|
{
|
|
// only update when the widget is visible.
|
|
//
|
|
if(!isVisible())
|
|
return ;
|
|
|
|
updateDisplay();
|
|
MessengerWindow::getInstance()->insertPeers();
|
|
update() ; // Qt flush
|
|
}
|
|
|