Changeset 4843

Show
Ignore:
Timestamp:
01/28/07 01:30:18 (19 months ago)
Author:
flynd
Message:

Added local time to column information.
To keep the times updated a timer is added that refreshes the contact list every minute.
This closes #1.

Location:
trunk/qt-gui/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/mainwin.cpp

    r4805 r4843  
    686686                    "<li><tt>%i - </tt>user ip</li>" 
    687687                    "<li><tt>%l - </tt>last name</li>" 
     688                    "<li><tt>%L - </tt>local time</li>" 
    688689                    "<li><tt>%m - </tt># pending messages</li>" 
    689690                    "<li><tt>%n - </tt>full name</li>" 
  • trunk/qt-gui/src/userbox.cpp

    r4734 r4843  
    3636#include <qimage.h> 
    3737#include <qmime.h> 
     38#include <qtimer.h> 
    3839 
    3940#include "userbox.moc" 
     
    10291030 
    10301031  carId = onlId = 0; 
     1032 
     1033  // Redraw once a minute in case there are cells showing timestamps 
     1034  tmrRefresh = new QTimer(this); 
     1035  connect(tmrRefresh, SIGNAL(timeout()), this, SLOT(updateItems())); 
     1036  tmrRefresh->start(60000); 
    10311037} 
    10321038 
     
    10361042CUserView::~CUserView() 
    10371043{ 
     1044  tmrRefresh->stop(); 
    10381045  barOnline = barOffline = barNotInList = NULL; 
    10391046  if (parent() == NULL) 
     
    16251632} 
    16261633 
     1634// ----------------------------------------------------------------------------- 
     1635 
     1636void CUserView::updateItems() 
     1637{ 
     1638  for (QListViewItemIterator it(firstChild()); it.current() != 0; ++it) 
     1639  { 
     1640    CUserViewItem* item = static_cast<CUserViewItem*>(it.current()); 
     1641 
     1642    ICQUser *u = gUserManager.FetchUser(item->ItemId(), item->ItemPPID(), LOCK_R); 
     1643    if (u == 0) 
     1644      continue; 
     1645    item->setGraphics(u); 
     1646    gUserManager.DropUser(u); 
     1647  } 
     1648  triggerUpdate(); 
     1649} 
    16271650 
    16281651// ----------------------------------------------------------------------------- 
  • trunk/qt-gui/src/userbox.h

    r4800 r4843  
    2727#include <qptrvector.h> 
    2828 
     29class QTimer; 
    2930class ICQUser; 
    3031class CUserView; 
     
    155156  virtual void setSorting( int column, bool ascending = true); 
    156157 
     158public slots: 
     159  void updateItems(); 
     160 
    157161protected: 
    158162  int m_nFlashCounter; 
     
    166170  unsigned long carPPID; 
    167171  unsigned long onlPPID; 
     172  QTimer *tmrRefresh; 
    168173 
    169174  QString m_typeAhead;      /*! type-ahead buffer  */