diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp index 9cf37f4a5..0ca9e86b4 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp @@ -59,9 +59,17 @@ RSPermissionMatrixWidget::RSPermissionMatrixWidget(QWidget *parent) setMouseTracking(true) ; - //_timer = new QTimer ; - //QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(update())) ; - //_timer->start(1000); + _timer = new QTimer ; + QObject::connect(_timer,SIGNAL(timeout()),this,SLOT(updateDisplay())) ; + _timer->start(5000); +} + +void RSPermissionMatrixWidget::updateDisplay() +{ + if(isHidden()) + return ; + + update() ; } void RSPermissionMatrixWidget::mousePressEvent(QMouseEvent *e) @@ -123,6 +131,9 @@ void RSPermissionMatrixWidget::mouseMoveEvent(QMouseEvent *e) /** Default destructor */ RSPermissionMatrixWidget::~RSPermissionMatrixWidget() { + _timer->stop() ; + + delete _timer ; delete _painter; } @@ -167,7 +178,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) RsPeerDetails details ; rsPeers->getPeerDetails(*it,details) ; - QString name = QString::fromUtf8(details.name.c_str()); + QString name = QString::fromUtf8(details.name.c_str()) + " (" + QString::fromUtf8(details.location.c_str()) + ")"; peer_name_size = std::max(peer_name_size, fm.width(name)) ; names.push_back(name) ; } diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h index 53379e0c1..2d3423dce 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h @@ -63,13 +63,14 @@ public: protected slots: // Calls the internal source for a new data points; called by the timer. You might want to overload this // if the collection system needs it. Otherwise, the default method will call getValues() - void updateDisplay() {} + void updateDisplay() ; void defaultPermissionSwitched(uint32_t ServiceId,bool b); void userPermissionSwitched(uint32_t ServiceId,const RsPeerId& friend_id,bool b); virtual void mousePressEvent(QMouseEvent *e) ; virtual void mouseMoveEvent(QMouseEvent *e) ; + protected: /** Overloaded QWidget::paintEvent() */ void paintEvent(QPaintEvent *event); @@ -89,6 +90,8 @@ private: /** A QPainter object that handles drawing the various graph elements. */ QPainter* _painter; + QTimer *_timer ; + /** The current dimensions of the graph. */ QRect _rec;